@c8y/ngx-components 1021.52.0 → 1021.54.4

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 (259) hide show
  1. package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.d.ts +10 -2
  2. package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.d.ts.map +1 -1
  3. package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.d.ts +11 -0
  4. package/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.d.ts.map +1 -0
  5. package/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.d.ts +10 -4
  6. package/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.d.ts.map +1 -1
  7. package/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.d.ts +3 -1
  8. package/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.d.ts.map +1 -1
  9. package/alarm-event-selector/alarm-event-selector.model.d.ts +7 -0
  10. package/alarm-event-selector/alarm-event-selector.model.d.ts.map +1 -1
  11. package/core/application/app-icon.component.d.ts.map +1 -1
  12. package/core/dashboard/dashboard-child-action.component.d.ts +1 -1
  13. package/core/dashboard/dashboard-child-action.component.d.ts.map +1 -1
  14. package/core/dashboard/dashboard.module.d.ts +29 -29
  15. package/core/dashboard/index.d.ts +3 -0
  16. package/core/dashboard/index.d.ts.map +1 -1
  17. package/core/dashboard/widgets-dashboard.component.d.ts +1 -1
  18. package/core/dashboard/widgets-dashboard.component.d.ts.map +1 -1
  19. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +1 -1
  20. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
  21. package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts +1 -1
  22. package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts.map +1 -1
  23. package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts +10 -0
  24. package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts.map +1 -0
  25. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +7 -4
  26. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
  27. package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts +0 -1
  28. package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts.map +1 -1
  29. package/core/date-picker/date-picker.component.d.ts +1 -1
  30. package/core/date-picker/date-picker.component.d.ts.map +1 -1
  31. package/core/date-picker/date-picker.module.d.ts +9 -9
  32. package/core/date-time-picker/close-date-picker.directive.d.ts +1 -1
  33. package/core/date-time-picker/close-date-picker.directive.d.ts.map +1 -1
  34. package/core/date-time-picker/date-time-picker.component.d.ts +6 -3
  35. package/core/date-time-picker/date-time-picker.component.d.ts.map +1 -1
  36. package/core/date-time-picker/date-time-picker.module.d.ts +11 -11
  37. package/core/date-time-picker/date-time-picker.module.d.ts.map +1 -1
  38. package/core/forms/forms.module.d.ts +18 -18
  39. package/core/forms/required-input-placeholder.directive.d.ts +1 -1
  40. package/core/forms/required-input-placeholder.directive.d.ts.map +1 -1
  41. package/core/router/router.service.d.ts.map +1 -1
  42. package/core/user/user-menu.service.d.ts +36 -11
  43. package/core/user/user-menu.service.d.ts.map +1 -1
  44. package/datapoint-explorer/c8y-ngx-components-datapoint-explorer.d.ts.map +1 -0
  45. package/datapoint-explorer/datapoint-explorer.module.d.ts +7 -0
  46. package/datapoint-explorer/datapoint-explorer.module.d.ts.map +1 -0
  47. package/datapoint-explorer/index.d.ts +2 -0
  48. package/datapoint-explorer/index.d.ts.map +1 -0
  49. package/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.d.ts.map +1 -0
  50. package/datapoint-explorer/view/configuration/naming-dictionary.d.ts +3 -0
  51. package/datapoint-explorer/view/configuration/naming-dictionary.d.ts.map +1 -0
  52. package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts +38 -0
  53. package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts.map +1 -0
  54. package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts +7 -0
  55. package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts.map +1 -0
  56. package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts +15 -0
  57. package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts.map +1 -0
  58. package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts +25 -0
  59. package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts.map +1 -0
  60. package/datapoint-explorer/view/datapoint-explorer.component.d.ts +67 -0
  61. package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -0
  62. package/datapoint-explorer/view/datapoint-explorer.service.d.ts +9 -0
  63. package/datapoint-explorer/view/datapoint-explorer.service.d.ts.map +1 -0
  64. package/datapoint-explorer/view/index.d.ts +2 -0
  65. package/datapoint-explorer/view/index.d.ts.map +1 -0
  66. package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts +23 -0
  67. package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts.map +1 -0
  68. package/echart/c8y-ngx-components-echart.d.ts.map +1 -0
  69. package/echart/chart-alerts/chart-alerts.component.d.ts +8 -0
  70. package/echart/chart-alerts/chart-alerts.component.d.ts.map +1 -0
  71. package/echart/charts.component.d.ts +63 -0
  72. package/echart/charts.component.d.ts.map +1 -0
  73. package/echart/index.d.ts +5 -0
  74. package/echart/index.d.ts.map +1 -0
  75. package/echart/models/c8y-ngx-components-echart-models.d.ts.map +1 -0
  76. package/echart/models/chart.model.d.ts +37 -0
  77. package/echart/models/chart.model.d.ts.map +1 -0
  78. package/echart/models/datapoints-graph-widget.model.d.ts +126 -0
  79. package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -0
  80. package/echart/models/index.d.ts +4 -0
  81. package/echart/models/index.d.ts.map +1 -0
  82. package/echart/models/svg-icons.model.d.ts +22 -0
  83. package/echart/models/svg-icons.model.d.ts.map +1 -0
  84. package/echart/services/chart-alarms.service.d.ts +17 -0
  85. package/echart/services/chart-alarms.service.d.ts.map +1 -0
  86. package/echart/services/chart-events.service.d.ts +17 -0
  87. package/echart/services/chart-events.service.d.ts.map +1 -0
  88. package/echart/services/chart-realtime.service.d.ts +35 -0
  89. package/echart/services/chart-realtime.service.d.ts.map +1 -0
  90. package/echart/services/chart-types.service.d.ts +15 -0
  91. package/echart/services/chart-types.service.d.ts.map +1 -0
  92. package/echart/services/custom-measurements.service.d.ts +12 -0
  93. package/echart/services/custom-measurements.service.d.ts.map +1 -0
  94. package/echart/services/echarts-options.service.d.ts +143 -0
  95. package/echart/services/echarts-options.service.d.ts.map +1 -0
  96. package/echart/services/y-axis.service.d.ts +17 -0
  97. package/echart/services/y-axis.service.d.ts.map +1 -0
  98. package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.mjs +37 -12
  99. package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.mjs +2 -0
  100. package/esm2022/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.mjs +39 -12
  101. package/esm2022/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.mjs +6 -4
  102. package/esm2022/alarm-event-selector/alarm-event-selector.component.mjs +1 -1
  103. package/esm2022/alarm-event-selector/alarm-event-selector.model.mjs +1 -1
  104. package/esm2022/alarm-event-selector/custom-alarm-event-form/custom-alarm-event-form.component.mjs +1 -1
  105. package/esm2022/alarms/alarms-filter.component.mjs +3 -3
  106. package/esm2022/core/application/app-icon.component.mjs +4 -4
  107. package/esm2022/core/dashboard/dashboard-child-action.component.mjs +3 -3
  108. package/esm2022/core/dashboard/dashboard.module.mjs +17 -14
  109. package/esm2022/core/dashboard/index.mjs +4 -1
  110. package/esm2022/core/dashboard/widgets-dashboard.component.mjs +9 -9
  111. package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +11 -9
  112. package/esm2022/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.mjs +8 -7
  113. package/esm2022/core/dashboard/wiget-time-context/widget-time-context-date-range.service.mjs +23 -0
  114. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +70 -26
  115. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.model.mjs +1 -1
  116. package/esm2022/core/date-picker/date-picker.component.mjs +29 -14
  117. package/esm2022/core/date-picker/date-picker.module.mjs +9 -7
  118. package/esm2022/core/date-time-picker/close-date-picker.directive.mjs +4 -3
  119. package/esm2022/core/date-time-picker/date-time-picker.component.mjs +57 -29
  120. package/esm2022/core/date-time-picker/date-time-picker.module.mjs +11 -7
  121. package/esm2022/core/forms/forms.module.mjs +3 -3
  122. package/esm2022/core/forms/ip-range-input-list.component.mjs +5 -5
  123. package/esm2022/core/forms/required-input-placeholder.directive.mjs +4 -3
  124. package/esm2022/core/router/router.service.mjs +1 -1
  125. package/esm2022/core/time-interval/time-interval.component.mjs +3 -3
  126. package/esm2022/core/user/user-menu.service.mjs +57 -17
  127. package/esm2022/datapoint-explorer/c8y-ngx-components-datapoint-explorer.mjs +5 -0
  128. package/esm2022/datapoint-explorer/datapoint-explorer.module.mjs +65 -0
  129. package/esm2022/datapoint-explorer/index.mjs +2 -0
  130. package/esm2022/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.mjs +5 -0
  131. package/esm2022/datapoint-explorer/view/configuration/naming-dictionary.mjs +65 -0
  132. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.component.mjs +169 -0
  133. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.model.mjs +2 -0
  134. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.service.mjs +40 -0
  135. package/esm2022/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.mjs +64 -0
  136. package/esm2022/datapoint-explorer/view/datapoint-explorer.component.mjs +279 -0
  137. package/esm2022/datapoint-explorer/view/datapoint-explorer.service.mjs +23 -0
  138. package/esm2022/datapoint-explorer/view/index.mjs +2 -0
  139. package/esm2022/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.mjs +48 -0
  140. package/esm2022/datapoint-selector/datapoint-attributes-form/datapoint-attributes-form.component.mjs +3 -3
  141. package/esm2022/datapoint-selector/datapoint-selector-list-item/datapoint-selector-list-item.component.mjs +3 -3
  142. package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.mjs +3 -3
  143. package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
  144. package/esm2022/device-list/add-smart-group.component.mjs +3 -3
  145. package/esm2022/echart/c8y-ngx-components-echart.mjs +5 -0
  146. package/esm2022/echart/chart-alerts/chart-alerts.component.mjs +16 -0
  147. package/esm2022/echart/charts.component.mjs +560 -0
  148. package/esm2022/echart/index.mjs +5 -0
  149. package/esm2022/echart/models/c8y-ngx-components-echart-models.mjs +5 -0
  150. package/esm2022/echart/models/chart.model.mjs +2 -0
  151. package/esm2022/echart/models/datapoints-graph-widget.model.mjs +17 -0
  152. package/esm2022/echart/models/index.mjs +4 -0
  153. package/esm2022/echart/models/svg-icons.model.mjs +22 -0
  154. package/esm2022/echart/services/chart-alarms.service.mjs +58 -0
  155. package/esm2022/echart/services/chart-events.service.mjs +44 -0
  156. package/esm2022/echart/services/chart-realtime.service.mjs +193 -0
  157. package/esm2022/echart/services/chart-types.service.mjs +102 -0
  158. package/esm2022/echart/services/custom-measurements.service.mjs +52 -0
  159. package/esm2022/echart/services/echarts-options.service.mjs +857 -0
  160. package/esm2022/echart/services/y-axis.service.mjs +150 -0
  161. package/esm2022/interval-picker/interval-picker.component.mjs +3 -3
  162. package/esm2022/interval-picker/interval-picker.model.mjs +1 -1
  163. package/esm2022/map/map.component.mjs +4 -1
  164. package/esm2022/report-dashboard/index.mjs +2 -1
  165. package/esm2022/time-context/c8y-ngx-components-time-context.mjs +5 -0
  166. package/esm2022/time-context/index.mjs +2 -0
  167. package/esm2022/time-context/time-context.component.mjs +217 -0
  168. package/esm2022/time-context/time-context.service.mjs +83 -0
  169. package/esm2022/tracking/tracking.component.mjs +5 -6
  170. package/esm2022/tracking/tracking.service.mjs +7 -3
  171. package/esm2022/translation-editor/lazy/translation-editor/translation-editor.component.mjs +6 -5
  172. package/esm2022/widgets/cockpit-exports/index.mjs +8 -1
  173. package/esm2022/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +5 -0
  174. package/esm2022/widgets/definitions/datapoints-graph/index.mjs +31 -0
  175. package/esm2022/widgets/definitions/index.mjs +3 -2
  176. package/esm2022/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +5 -0
  177. package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.mjs +239 -0
  178. package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.mjs +241 -0
  179. package/esm2022/widgets/implementations/datapoints-graph/index.mjs +3 -0
  180. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +80 -28
  181. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
  182. package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
  183. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  184. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +658 -0
  185. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -0
  186. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +72 -0
  187. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs.map +1 -0
  188. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +4 -4
  189. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
  190. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +4 -4
  191. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  192. package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
  193. package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
  194. package/fesm2022/c8y-ngx-components-echart-models.mjs +46 -0
  195. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -0
  196. package/fesm2022/c8y-ngx-components-echart.mjs +2023 -0
  197. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -0
  198. package/fesm2022/c8y-ngx-components-interval-picker.mjs +2 -2
  199. package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
  200. package/fesm2022/c8y-ngx-components-map.mjs +3 -0
  201. package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
  202. package/fesm2022/c8y-ngx-components-report-dashboard.mjs +1 -1
  203. package/fesm2022/c8y-ngx-components-time-context.mjs +300 -0
  204. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -0
  205. package/fesm2022/c8y-ngx-components-tracking.mjs +10 -7
  206. package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
  207. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +5 -4
  208. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
  209. package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs +7 -0
  210. package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs.map +1 -1
  211. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +38 -0
  212. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs.map +1 -0
  213. package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
  214. package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
  215. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +467 -0
  216. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -0
  217. package/fesm2022/c8y-ngx-components.mjs +433 -281
  218. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  219. package/interval-picker/interval-picker.component.d.ts.map +1 -1
  220. package/interval-picker/interval-picker.model.d.ts.map +1 -1
  221. package/locales/de.po +206 -279
  222. package/locales/es.po +206 -279
  223. package/locales/fr.po +206 -279
  224. package/locales/ja_JP.po +196 -279
  225. package/locales/ko.po +455 -444
  226. package/locales/locales.pot +200 -0
  227. package/locales/nl.po +206 -279
  228. package/locales/pl.po +206 -279
  229. package/locales/pt_BR.po +206 -279
  230. package/locales/zh_CN.po +450 -443
  231. package/locales/zh_TW.po +452 -445
  232. package/map/map.component.d.ts.map +1 -1
  233. package/package.json +1 -1
  234. package/report-dashboard/index.d.ts +1 -0
  235. package/report-dashboard/index.d.ts.map +1 -1
  236. package/time-context/c8y-ngx-components-time-context.d.ts.map +1 -0
  237. package/time-context/index.d.ts +2 -0
  238. package/time-context/index.d.ts.map +1 -0
  239. package/time-context/time-context.component.d.ts +61 -0
  240. package/time-context/time-context.component.d.ts.map +1 -0
  241. package/time-context/time-context.service.d.ts +25 -0
  242. package/time-context/time-context.service.d.ts.map +1 -0
  243. package/tracking/tracking.component.d.ts.map +1 -1
  244. package/tracking/tracking.service.d.ts.map +1 -1
  245. package/translation-editor/lazy/translation-editor/translation-editor.component.d.ts.map +1 -1
  246. package/widgets/cockpit-exports/index.d.ts +6 -0
  247. package/widgets/cockpit-exports/index.d.ts.map +1 -1
  248. package/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.d.ts.map +1 -0
  249. package/widgets/definitions/datapoints-graph/index.d.ts +16 -0
  250. package/widgets/definitions/datapoints-graph/index.d.ts.map +1 -0
  251. package/widgets/definitions/index.d.ts +1 -0
  252. package/widgets/definitions/index.d.ts.map +1 -1
  253. package/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts.map +1 -0
  254. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +43 -0
  255. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -0
  256. package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts +54 -0
  257. package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts.map +1 -0
  258. package/widgets/implementations/datapoints-graph/index.d.ts +3 -0
  259. package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -0
@@ -0,0 +1,300 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, inject, DestroyRef, model, Component, Input, ViewChild } from '@angular/core';
3
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import * as i3 from '@angular/forms';
5
+ import { FormBuilder } from '@angular/forms';
6
+ import * as i1 from '@c8y/ngx-components';
7
+ import { AGGREGATION_LIMITS, CoreModule, DateTimePickerModule, AggregationPickerComponent, RealtimeControlComponent } from '@c8y/ngx-components';
8
+ import { INTERVALS, TimeSpanInMs, INTERVAL_TITLES, IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';
9
+ import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
10
+ import * as i4 from 'ngx-bootstrap/dropdown';
11
+ import { BsDropdownDirective, BsDropdownModule } from 'ngx-bootstrap/dropdown';
12
+ import * as i5 from 'ngx-bootstrap/tooltip';
13
+ import { TooltipModule } from 'ngx-bootstrap/tooltip';
14
+ import { interval } from 'rxjs';
15
+ import { aggregationType } from '@c8y/client';
16
+ import * as i2 from '@angular/common';
17
+
18
+ class DatapointExplorerService {
19
+ constructor() {
20
+ this.DEFAULT_INTERVAL = 'days';
21
+ }
22
+ // Create generic? Based on packages/ngx-components/core/dashboard/wiget-time-context/widget-time-context.component.html
23
+ getDefaultContext() {
24
+ return {
25
+ date: this.getDateTimeContextByInterval(this.DEFAULT_INTERVAL),
26
+ interval: this.DEFAULT_INTERVAL,
27
+ realtime: false,
28
+ aggregation: aggregationType.MINUTELY
29
+ };
30
+ }
31
+ calculateAggregation([dateFrom, dateTo], requestedAggregation) {
32
+ const timeRangeValidations = this.validateTimeRanges([dateFrom, dateTo]);
33
+ const disabledAggregations = this.getDisabledAggregations(timeRangeValidations);
34
+ const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);
35
+ const isRequestedAggregationValid = requestedAggregation === null || !disabledAggregations[requestedAggregation];
36
+ const selectedAggregation = isRequestedAggregationValid
37
+ ? requestedAggregation
38
+ : this.determineAggregation(timeRangeInMs);
39
+ return {
40
+ selectedAggregation,
41
+ disabledAggregations
42
+ };
43
+ }
44
+ getDateTimeContextByInterval(intervalId) {
45
+ const interval = INTERVALS.find(({ id }) => id === intervalId);
46
+ const dateTo = new Date();
47
+ const dateFrom = new Date(dateTo.valueOf() - interval.timespanInMs);
48
+ return [dateFrom, dateTo];
49
+ }
50
+ getTimeRangeInMs(dateFrom, dateTo) {
51
+ return dateTo.valueOf() - dateFrom.valueOf();
52
+ }
53
+ validateTimeRanges([dateFrom, dateTo]) {
54
+ const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);
55
+ return [
56
+ {
57
+ aggregationType: aggregationType.DAILY,
58
+ isDisabled: timeRangeInMs <= TimeSpanInMs.DAY
59
+ },
60
+ {
61
+ aggregationType: aggregationType.HOURLY,
62
+ isDisabled: timeRangeInMs <= TimeSpanInMs.HOUR
63
+ },
64
+ {
65
+ aggregationType: aggregationType.MINUTELY,
66
+ isDisabled: timeRangeInMs <= TimeSpanInMs.MINUTE
67
+ }
68
+ ];
69
+ }
70
+ getDisabledAggregations(timeRangeValidations) {
71
+ return timeRangeValidations.reduce((acc, { aggregationType, isDisabled }) => ({
72
+ ...acc,
73
+ [aggregationType]: isDisabled
74
+ }), {});
75
+ }
76
+ determineAggregation(timeRangeInMs) {
77
+ if (timeRangeInMs >= AGGREGATION_LIMITS.DAILY_LIMIT) {
78
+ return aggregationType.DAILY;
79
+ }
80
+ else if (timeRangeInMs >= AGGREGATION_LIMITS.HOURLY_LIMIT) {
81
+ return aggregationType.HOURLY;
82
+ }
83
+ else if (timeRangeInMs >= AGGREGATION_LIMITS.MINUTELY_LIMIT) {
84
+ return aggregationType.MINUTELY;
85
+ }
86
+ return null;
87
+ }
88
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DatapointExplorerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
89
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DatapointExplorerService, providedIn: 'root' }); }
90
+ }
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DatapointExplorerService, decorators: [{
92
+ type: Injectable,
93
+ args: [{ providedIn: 'root' }]
94
+ }] });
95
+
96
+ class TimeContextComponent {
97
+ #destroyRef;
98
+ constructor(widgetTimeContextDateRangeService) {
99
+ this.widgetTimeContextDateRangeService = widgetTimeContextDateRangeService;
100
+ this.datapointExplorerService = inject(DatapointExplorerService);
101
+ this.formBuilder = inject(FormBuilder);
102
+ this.#destroyRef = inject(DestroyRef);
103
+ this.DATE_FORMAT = 'short';
104
+ this.INTERVAL_TITLES = INTERVAL_TITLES;
105
+ this.REALTIME_INTERVAL = 1000;
106
+ this.form = this.createForm(this.datapointExplorerService.getDefaultContext());
107
+ this.valuesSignal = toSignal(this.form.controls.currentDateContextFromDate.valueChanges, {
108
+ initialValue: this.form.controls.currentDateContextFromDate.value
109
+ });
110
+ this.context = model(this.form.value);
111
+ const context = this.datapointExplorerService.getDefaultContext();
112
+ const { disabledAggregations } = this.datapointExplorerService.calculateAggregation(context.date, context.aggregation);
113
+ this.disabledAggregations = disabledAggregations;
114
+ this.subscribeToIntervalChange();
115
+ this.subscribeToRealtimeChange();
116
+ this.subscribeToAggregationChange();
117
+ }
118
+ ngOnChanges(changes) {
119
+ if (changes.changedDateContext && changes.changedDateContext.currentValue) {
120
+ this.update({
121
+ date: [this.changedDateContext.dateFrom, this.changedDateContext.dateTo],
122
+ interval: this.changedDateContext.interval,
123
+ realtime: this.changedDateContext.realtime || false,
124
+ aggregation: this.changedDateContext.aggregation
125
+ });
126
+ if (this.changedDateContext.realtime) {
127
+ this.form.controls.aggregation.disable();
128
+ }
129
+ }
130
+ }
131
+ applyDatetimeContext() {
132
+ this.update({
133
+ date: [
134
+ new Date(this.form.controls.temporaryUserSelectedFromDate.value),
135
+ new Date(this.form.controls.temporaryUserSelectedToDate.value)
136
+ ],
137
+ interval: 'custom',
138
+ realtime: this.form.value.realtime,
139
+ aggregation: this.form.value.aggregation
140
+ });
141
+ }
142
+ subscribeToIntervalChange() {
143
+ this.form.controls.currentDateContextInterval.valueChanges
144
+ .pipe(takeUntilDestroyed(this.#destroyRef))
145
+ .subscribe(interval => {
146
+ let date;
147
+ this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);
148
+ if (interval === 'custom') {
149
+ date = [
150
+ new Date(this.form.controls.currentDateContextFromDate.value),
151
+ new Date(this.form.controls.currentDateContextToDate.value)
152
+ ];
153
+ }
154
+ else {
155
+ date = this.datapointExplorerService.getDateTimeContextByInterval(interval);
156
+ this.dropdown.isOpen = false;
157
+ }
158
+ this.update({
159
+ date,
160
+ interval,
161
+ realtime: this.form.value.realtime,
162
+ aggregation: this.form.value.aggregation
163
+ });
164
+ });
165
+ }
166
+ subscribeToRealtimeChange() {
167
+ this.form.controls.realtime.valueChanges
168
+ .pipe(takeUntilDestroyed(this.#destroyRef))
169
+ .subscribe(realtime => {
170
+ this.onRealtimeValueChange(realtime);
171
+ if (realtime) {
172
+ this.startRealtime();
173
+ }
174
+ else {
175
+ this.stopRealtime();
176
+ }
177
+ });
178
+ }
179
+ subscribeToAggregationChange() {
180
+ this.form.controls.aggregation.valueChanges
181
+ .pipe(takeUntilDestroyed(this.#destroyRef))
182
+ .subscribe(aggregation => {
183
+ this.update({
184
+ date: [
185
+ new Date(this.form.value.currentDateContextFromDate),
186
+ new Date(this.form.value.currentDateContextToDate)
187
+ ],
188
+ interval: this.form.value.currentDateContextInterval,
189
+ realtime: this.form.value.realtime,
190
+ aggregation
191
+ });
192
+ });
193
+ }
194
+ onRealtimeValueChange(realtime) {
195
+ let dateTimeContext;
196
+ if (this.form.value.currentDateContextInterval !== 'custom') {
197
+ dateTimeContext = this.datapointExplorerService.getDateTimeContextByInterval(this.form.value.currentDateContextInterval);
198
+ }
199
+ else {
200
+ const currentTimeSpanInMs = new Date(this.form.value.currentDateContextToDate).valueOf() -
201
+ new Date(this.form.value.currentDateContextFromDate).valueOf();
202
+ const dateTo = new Date();
203
+ const dateFrom = new Date(dateTo.valueOf() - currentTimeSpanInMs);
204
+ dateTimeContext = [dateFrom, dateTo];
205
+ }
206
+ this.update({
207
+ date: dateTimeContext,
208
+ interval: this.form.value.currentDateContextInterval,
209
+ realtime,
210
+ aggregation: null
211
+ });
212
+ }
213
+ startRealtime() {
214
+ this.form.controls.temporaryUserSelectedFromDate.disable();
215
+ this.form.controls.temporaryUserSelectedToDate.disable();
216
+ this.form.controls.aggregation.disable();
217
+ this.realtimeSubscription = interval(this.REALTIME_INTERVAL)
218
+ .pipe(takeUntilDestroyed(this.#destroyRef))
219
+ .subscribe(() => {
220
+ if (!this.form.value.realtime) {
221
+ this.realtimeSubscription.unsubscribe();
222
+ return;
223
+ }
224
+ const newDateFrom = new Date(new Date(this.form.value.currentDateContextFromDate).valueOf() + this.REALTIME_INTERVAL);
225
+ const newDateTo = new Date(new Date(this.form.value.currentDateContextToDate).valueOf() + this.REALTIME_INTERVAL);
226
+ this.updateFormValues({
227
+ date: [newDateFrom, newDateTo],
228
+ interval: this.form.value.currentDateContextInterval,
229
+ realtime: true,
230
+ aggregation: null
231
+ });
232
+ });
233
+ }
234
+ stopRealtime() {
235
+ this.realtimeSubscription?.unsubscribe();
236
+ this.form?.controls.temporaryUserSelectedFromDate.enable();
237
+ this.form?.controls.temporaryUserSelectedToDate.enable();
238
+ this.form?.controls.aggregation.enable();
239
+ }
240
+ update({ date, interval, realtime, aggregation }) {
241
+ const { selectedAggregation, disabledAggregations } = this.datapointExplorerService.calculateAggregation(date, aggregation);
242
+ this.disabledAggregations = disabledAggregations;
243
+ this.updateFormValues({ date, interval, realtime, aggregation: selectedAggregation });
244
+ }
245
+ createForm(context) {
246
+ return this.formBuilder.group({
247
+ temporaryUserSelectedFromDate: context.date[0].toISOString(),
248
+ temporaryUserSelectedToDate: context.date[1].toISOString(),
249
+ currentDateContextFromDate: context.date[0].toISOString(),
250
+ currentDateContextToDate: context.date[1].toISOString(),
251
+ currentDateContextInterval: context.interval || 'custom',
252
+ realtime: context.realtime,
253
+ aggregation: context.aggregation
254
+ });
255
+ }
256
+ updateFormValues({ date, interval, realtime, aggregation }) {
257
+ const newFormValues = {
258
+ temporaryUserSelectedFromDate: date[0].toISOString(),
259
+ temporaryUserSelectedToDate: date[1].toISOString(),
260
+ currentDateContextFromDate: date[0].toISOString(),
261
+ currentDateContextToDate: date[1].toISOString(),
262
+ realtime,
263
+ currentDateContextInterval: interval || 'custom',
264
+ aggregation: aggregation || null
265
+ };
266
+ this.context.set(newFormValues);
267
+ this.form.patchValue(newFormValues, {
268
+ emitEvent: false
269
+ });
270
+ }
271
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TimeContextComponent, deps: [{ token: i1.WidgetTimeContextDateRangeService }], target: i0.ɵɵFactoryTarget.Component }); }
272
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.9", type: TimeContextComponent, isStandalone: true, selector: "c8y-time-context", inputs: { changedDateContext: { classPropertyName: "changedDateContext", publicName: "changedDateContext", isSignal: false, isRequired: false, transformFunction: null }, controlsAvailable: { classPropertyName: "controlsAvailable", publicName: "controlsAvailable", isSignal: false, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { context: "contextChange" }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: BsDropdownDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.DatePipe, name: "c8yDate" }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1.MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "ngmodule", type: BsDatepickerModule }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: IntervalPickerComponent, selector: "c8y-interval-picker", inputs: ["INTERVALS"] }, { kind: "component", type: RealtimeControlComponent, selector: "c8y-realtime-control" }] }); }
273
+ }
274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TimeContextComponent, decorators: [{
275
+ type: Component,
276
+ args: [{ selector: 'c8y-time-context', standalone: true, imports: [
277
+ CoreModule,
278
+ BsDatepickerModule,
279
+ DateTimePickerModule,
280
+ BsDropdownModule,
281
+ AggregationPickerComponent,
282
+ TooltipModule,
283
+ IntervalPickerComponent,
284
+ RealtimeControlComponent
285
+ ], template: "<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n" }]
286
+ }], ctorParameters: () => [{ type: i1.WidgetTimeContextDateRangeService }], propDecorators: { changedDateContext: [{
287
+ type: Input
288
+ }], controlsAvailable: [{
289
+ type: Input
290
+ }], dropdown: [{
291
+ type: ViewChild,
292
+ args: [BsDropdownDirective]
293
+ }] } });
294
+
295
+ /**
296
+ * Generated bundle index. Do not edit.
297
+ */
298
+
299
+ export { TimeContextComponent };
300
+ //# sourceMappingURL=c8y-ngx-components-time-context.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"c8y-ngx-components-time-context.mjs","sources":["../../time-context/time-context.service.ts","../../time-context/time-context.component.ts","../../time-context/time-context.component.html","../../time-context/c8y-ngx-components-time-context.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { aggregationType } from '@c8y/client';\nimport { AGGREGATION_LIMITS, DateTimeContext } from '@c8y/ngx-components';\nimport { Interval, INTERVALS, TimeSpanInMs } from '@c8y/ngx-components/interval-picker';\n\ninterface TimeRangeValidation {\n aggregationType: aggregationType;\n isDisabled: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DatapointExplorerService {\n readonly DEFAULT_INTERVAL: Interval['id'] = 'days';\n\n // Create generic? Based on packages/ngx-components/core/dashboard/wiget-time-context/widget-time-context.component.html\n getDefaultContext() {\n return {\n date: this.getDateTimeContextByInterval(this.DEFAULT_INTERVAL),\n interval: this.DEFAULT_INTERVAL,\n realtime: false,\n aggregation: aggregationType.MINUTELY\n };\n }\n\n calculateAggregation(\n [dateFrom, dateTo]: DateTimeContext,\n requestedAggregation: aggregationType | null\n ): {\n selectedAggregation: aggregationType | null;\n disabledAggregations: Partial<Record<aggregationType, boolean>>;\n } {\n const timeRangeValidations = this.validateTimeRanges([dateFrom, dateTo]);\n const disabledAggregations = this.getDisabledAggregations(timeRangeValidations);\n\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n const isRequestedAggregationValid =\n requestedAggregation === null || !disabledAggregations[requestedAggregation];\n\n const selectedAggregation = isRequestedAggregationValid\n ? requestedAggregation\n : this.determineAggregation(timeRangeInMs);\n\n return {\n selectedAggregation,\n disabledAggregations\n };\n }\n\n getDateTimeContextByInterval(intervalId: Interval['id']): DateTimeContext {\n const interval = INTERVALS.find(({ id }) => id === intervalId);\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - interval.timespanInMs);\n return [dateFrom, dateTo];\n }\n\n private getTimeRangeInMs(dateFrom: Date, dateTo: Date): number {\n return dateTo.valueOf() - dateFrom.valueOf();\n }\n\n private validateTimeRanges([dateFrom, dateTo]: DateTimeContext): TimeRangeValidation[] {\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n return [\n {\n aggregationType: aggregationType.DAILY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.DAY\n },\n {\n aggregationType: aggregationType.HOURLY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.HOUR\n },\n {\n aggregationType: aggregationType.MINUTELY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.MINUTE\n }\n ];\n }\n\n private getDisabledAggregations(\n timeRangeValidations: TimeRangeValidation[]\n ): Partial<Record<aggregationType, boolean>> {\n return timeRangeValidations.reduce(\n (acc, { aggregationType, isDisabled }) => ({\n ...acc,\n [aggregationType]: isDisabled\n }),\n {}\n );\n }\n\n private determineAggregation(timeRangeInMs: number): aggregationType | null {\n if (timeRangeInMs >= AGGREGATION_LIMITS.DAILY_LIMIT) {\n return aggregationType.DAILY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.HOURLY_LIMIT) {\n return aggregationType.HOURLY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.MINUTELY_LIMIT) {\n return aggregationType.MINUTELY;\n }\n return null;\n }\n}\n","import {\n Component,\n DestroyRef,\n inject,\n Input,\n model,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { FormBuilder } from '@angular/forms';\nimport {\n CoreModule,\n DateTimeContext,\n DateTimePickerModule,\n RealtimeControlComponent,\n WidgetTimeContextDateRangeService\n} from '@c8y/ngx-components';\nimport { INTERVAL_TITLES, Interval } from '@c8y/ngx-components/interval-picker';\nimport { AggregationPickerComponent } from '@c8y/ngx-components';\nimport { IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';\nimport { BsDatepickerModule } from 'ngx-bootstrap/datepicker';\nimport { BsDropdownDirective, BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { interval, Subscription } from 'rxjs';\nimport { DatapointExplorerService } from './time-context.service';\n\n@Component({\n selector: 'c8y-time-context',\n templateUrl: './time-context.component.html',\n standalone: true,\n imports: [\n CoreModule,\n BsDatepickerModule,\n DateTimePickerModule,\n BsDropdownModule,\n AggregationPickerComponent,\n TooltipModule,\n IntervalPickerComponent,\n RealtimeControlComponent\n ]\n})\nexport class TimeContextComponent {\n @Input() changedDateContext: {\n dateFrom?: Date;\n dateTo?: Date;\n interval?: Interval['id'];\n realtime?: boolean;\n aggregation?: string;\n };\n @Input() controlsAvailable: any;\n @ViewChild(BsDropdownDirective) dropdown: BsDropdownDirective;\n datapointExplorerService = inject(DatapointExplorerService);\n formBuilder = inject(FormBuilder);\n #destroyRef = inject(DestroyRef);\n\n readonly DATE_FORMAT = 'short';\n readonly INTERVAL_TITLES = INTERVAL_TITLES;\n readonly REALTIME_INTERVAL = 1000;\n form = this.createForm(this.datapointExplorerService.getDefaultContext());\n disabledAggregations;\n\n readonly valuesSignal = toSignal(this.form.controls.currentDateContextFromDate.valueChanges, {\n initialValue: this.form.controls.currentDateContextFromDate.value\n });\n\n context = model(this.form.value);\n\n private realtimeSubscription: Subscription;\n\n constructor(private widgetTimeContextDateRangeService: WidgetTimeContextDateRangeService) {\n const context = this.datapointExplorerService.getDefaultContext();\n const { disabledAggregations } = this.datapointExplorerService.calculateAggregation(\n context.date,\n context.aggregation\n );\n this.disabledAggregations = disabledAggregations;\n\n this.subscribeToIntervalChange();\n this.subscribeToRealtimeChange();\n this.subscribeToAggregationChange();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.changedDateContext && changes.changedDateContext.currentValue) {\n this.update({\n date: [this.changedDateContext.dateFrom, this.changedDateContext.dateTo],\n interval: this.changedDateContext.interval,\n realtime: this.changedDateContext.realtime || false,\n aggregation: this.changedDateContext.aggregation\n });\n if (this.changedDateContext.realtime) {\n this.form.controls.aggregation.disable();\n }\n }\n }\n\n applyDatetimeContext(): void {\n this.update({\n date: [\n new Date(this.form.controls.temporaryUserSelectedFromDate.value),\n new Date(this.form.controls.temporaryUserSelectedToDate.value)\n ],\n interval: 'custom',\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n }\n\n private subscribeToIntervalChange(): void {\n this.form.controls.currentDateContextInterval.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(interval => {\n let date: DateTimeContext;\n this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);\n if (interval === 'custom') {\n date = [\n new Date(this.form.controls.currentDateContextFromDate.value),\n new Date(this.form.controls.currentDateContextToDate.value)\n ];\n } else {\n date = this.datapointExplorerService.getDateTimeContextByInterval(\n interval as Interval['id']\n );\n this.dropdown.isOpen = false;\n }\n this.update({\n date,\n interval,\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n });\n }\n\n private subscribeToRealtimeChange(): void {\n this.form.controls.realtime.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(realtime => {\n this.onRealtimeValueChange(realtime as boolean);\n\n if (realtime) {\n this.startRealtime();\n } else {\n this.stopRealtime();\n }\n });\n }\n\n private subscribeToAggregationChange() {\n this.form.controls.aggregation.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(aggregation => {\n this.update({\n date: [\n new Date(this.form.value.currentDateContextFromDate),\n new Date(this.form.value.currentDateContextToDate)\n ],\n interval: this.form.value.currentDateContextInterval,\n realtime: this.form.value.realtime,\n aggregation\n });\n });\n }\n\n private onRealtimeValueChange(realtime: boolean): void {\n let dateTimeContext: DateTimeContext;\n if (this.form.value.currentDateContextInterval !== 'custom') {\n dateTimeContext = this.datapointExplorerService.getDateTimeContextByInterval(\n this.form.value.currentDateContextInterval as Interval['id']\n );\n } else {\n const currentTimeSpanInMs =\n new Date(this.form.value.currentDateContextToDate).valueOf() -\n new Date(this.form.value.currentDateContextFromDate).valueOf();\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - currentTimeSpanInMs);\n dateTimeContext = [dateFrom, dateTo];\n }\n\n this.update({\n date: dateTimeContext,\n interval: this.form.value.currentDateContextInterval,\n realtime,\n aggregation: null\n });\n }\n\n private startRealtime(): void {\n this.form.controls.temporaryUserSelectedFromDate.disable();\n this.form.controls.temporaryUserSelectedToDate.disable();\n this.form.controls.aggregation.disable();\n\n this.realtimeSubscription = interval(this.REALTIME_INTERVAL)\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => {\n if (!this.form.value.realtime) {\n this.realtimeSubscription.unsubscribe();\n return;\n }\n const newDateFrom = new Date(\n new Date(this.form.value.currentDateContextFromDate).valueOf() + this.REALTIME_INTERVAL\n );\n const newDateTo = new Date(\n new Date(this.form.value.currentDateContextToDate).valueOf() + this.REALTIME_INTERVAL\n );\n this.updateFormValues({\n date: [newDateFrom, newDateTo],\n interval: this.form.value.currentDateContextInterval,\n realtime: true,\n aggregation: null\n });\n });\n }\n\n private stopRealtime(): void {\n this.realtimeSubscription?.unsubscribe();\n this.form?.controls.temporaryUserSelectedFromDate.enable();\n this.form?.controls.temporaryUserSelectedToDate.enable();\n this.form?.controls.aggregation.enable();\n }\n\n private update({ date, interval, realtime, aggregation }): void {\n const { selectedAggregation, disabledAggregations } =\n this.datapointExplorerService.calculateAggregation(date, aggregation);\n this.disabledAggregations = disabledAggregations;\n this.updateFormValues({ date, interval, realtime, aggregation: selectedAggregation });\n }\n\n private createForm(context) {\n return this.formBuilder.group({\n temporaryUserSelectedFromDate: context.date[0].toISOString() as string,\n temporaryUserSelectedToDate: context.date[1].toISOString() as string,\n currentDateContextFromDate: context.date[0].toISOString() as string,\n currentDateContextToDate: context.date[1].toISOString() as string,\n currentDateContextInterval: context.interval || 'custom',\n realtime: context.realtime,\n aggregation: context.aggregation\n });\n }\n\n private updateFormValues({ date, interval, realtime, aggregation }): void {\n const newFormValues = {\n temporaryUserSelectedFromDate: date[0].toISOString() as string,\n temporaryUserSelectedToDate: date[1].toISOString() as string,\n currentDateContextFromDate: date[0].toISOString() as string,\n currentDateContextToDate: date[1].toISOString() as string,\n realtime,\n currentDateContextInterval: interval || 'custom',\n aggregation: aggregation || null\n };\n\n this.context.set(newFormValues);\n this.form.patchValue(newFormValues, {\n emitEvent: false\n });\n }\n}\n","<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAWa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEW,IAAgB,CAAA,gBAAA,GAAmB,MAAM,CAAC;AAyFpD,KAAA;;IAtFC,iBAAiB,GAAA;QACf,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAC9D,QAAQ,EAAE,IAAI,CAAC,gBAAgB;AAC/B,YAAA,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,eA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A,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,uFACvB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAEhB,IAAI,EACP,OAAA,EAAA;wBACP,UAAU;wBACV,kBAAkB;wBAClB,oBAAoB;wBACpB,gBAAgB;wBAChB,0BAA0B;wBAC1B,aAAa;wBACb,uBAAuB;wBACvB,wBAAwB;AACzB,qBAAA,EAAA,QAAA,EAAA,87NAAA,EAAA,CAAA;sGAGQ,kBAAkB,EAAA,CAAA;sBAA1B,KAAK;gBAOG,iBAAiB,EAAA,CAAA;sBAAzB,KAAK;gBAC0B,QAAQ,EAAA,CAAA;sBAAvC,SAAS;uBAAC,mBAAmB,CAAA;;;AEnDhC;;AAEG;;;;"}
@@ -8,9 +8,8 @@ import { CoreModule, ViewContext, EventRealtimeService, ActionBarModule, TimeInt
8
8
  import * as i1 from '@c8y/client';
9
9
  import { identity, isEmpty, last, first } from 'lodash-es';
10
10
  import { BehaviorSubject, Subject, combineLatest, pipe } from 'rxjs';
11
- import { map, share, switchMap, tap } from 'rxjs/operators';
11
+ import { map, share, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
12
12
  import * as i5 from '@angular/common';
13
- import { AsyncPipe } from '@angular/common';
14
13
  import * as i4 from '@c8y/ngx-components/map';
15
14
  import { MapComponent, MapModule } from '@c8y/ngx-components/map';
16
15
 
@@ -31,7 +30,11 @@ class TrackingService {
31
30
  this.timeInterval$ = new Subject();
32
31
  this.reload$ = new BehaviorSubject(null);
33
32
  this.polyline$ = this._polylineEventsSubject$.asObservable().pipe(map(events => (events || []).map(event => this.geo.getLatLong(event)).filter(identity)), share());
34
- this.events$ = combineLatest([this.deviceId$, this.timeInterval$, this.reload$]).pipe(switchMap(([source, interval]) => {
33
+ this.events$ = combineLatest([
34
+ this.deviceId$.pipe(distinctUntilChanged()),
35
+ this.timeInterval$,
36
+ this.reload$
37
+ ]).pipe(switchMap(([source, interval]) => {
35
38
  const { dateFrom, dateTo } = interval;
36
39
  return this.eventService.list({
37
40
  ...TrackingService.BASE_FILTER,
@@ -163,7 +166,7 @@ class TrackingComponent {
163
166
  preventChangeToNextMonth: true
164
167
  };
165
168
  this.config = {
166
- realtime: false,
169
+ realtime: true,
167
170
  follow: false,
168
171
  zoomLevel: 12,
169
172
  fitBoundsOptions: {
@@ -179,6 +182,7 @@ class TrackingComponent {
179
182
  this.device = contextData;
180
183
  }
181
184
  async ngAfterViewInit() {
185
+ this.service.setDeviceId(this.device.id);
182
186
  this.togglePositionRealtime(this.realtime.active);
183
187
  }
184
188
  toggleMarker(event) {
@@ -208,19 +212,18 @@ class TrackingComponent {
208
212
  }
209
213
  }
210
214
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TrackingComponent, deps: [{ token: TrackingService }, { token: i2.EventRealtimeService }, { token: i2.ContextRouteService }, { token: i3.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
211
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: TrackingComponent, isStandalone: true, selector: "c8y-tracking", providers: [EventRealtimeService], viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"100\"\n>\n <c8y-realtime-btn\n [service]=\"realtime\"\n [disabled]=\"realtimeDisabled\"\n (onToggle)=\"togglePositionRealtime($event)\"\n ></c8y-realtime-btn>\n</c8y-action-bar-item>\n<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"60\"\n>\n <c8y-time-interval\n [maxCustomDate]=\"maxDate\"\n [dateRangePickerConfig]=\"dateRangePickerConfig\"\n (interval)=\"service.setInterval($event); toggleRealtime($event)\"\n ></c8y-time-interval>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div class=\"bg-white p-relative\">\n <c8y-map\n [config]=\"config\"\n [assets]=\"device\"\n [polyline$]=\"service.polyline$\"\n [polylineOptions]=\"{ color: 'darkblue' }\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup [context]=\"context\"></c8y-tracking-marker-popup>\n </div>\n </c8y-map>\n </div>\n\n <div class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\">\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Tracking events\n </span>\n </div>\n <div class=\"inner-scroll\">\n <c8y-list-group class=\"c8y-list__group--strip\">\n <ng-template\n c8yFor\n let-event\n [c8yForOf]=\"service.events$\"\n [c8yForPipe]=\"service.pipe\"\n [c8yForRealtime]=\"realtime\"\n [c8yForRealtimeOptions]=\"{ entityOrId: device }\"\n [c8yForLoadMore]=\"'hidden'\"\n [c8yForNotFound]=\"empty\"\n (c8yForLoadMoreComponent)=\"\n loadMoreComponent = $event; loadMoreComponent.useIntersection = false\n \"\n >\n <c8y-li\n class=\"pointer\"\n [ngClass]=\"{ 'text-primary text-bold': activeMarkers['p' + event?.id] }\"\n (click)=\"toggleMarker(event)\"\n >\n <c8y-li-icon [ngClass]=\"{ 'text-primary': activeMarkers['p' + event?.id] }\">\n <i c8yIcon=\"c8y-location\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex\">\n <span>\n {{ event.time | date: 'mediumDate' }}\n </span>\n <span class=\"m-l-auto\">\n {{ event.time | date: 'mediumTime' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </ng-template>\n </c8y-list-group>\n </div>\n\n <!-- empty state -->\n <ng-template #empty>\n <c8y-ui-empty-state\n icon=\"c8y-location\"\n [title]=\"'No tracking events found.' | translate\"\n [subtitle]=\"'Select another time range.' | translate\"\n *ngIf=\"!service.hasEvents\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </ng-template>\n\n <div *ngIf=\"loadMoreComponent?.hasMore\">\n <button\n class=\"btn btn-link fit-w sticky-bottom separator-top\"\n [title]=\"'Load more' | translate\"\n type=\"button\"\n [disabled]=\"loadMoreComponent?.isLoading\"\n (click)=\"loadMoreComponent.loadMore()\"\n >\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Deselect all markers' | translate\"\n type=\"button\"\n [disabled]=\"(activeMarkers | json) === '{}'\"\n (click)=\"map.clearMarkers('event'); activeMarkers = {}\"\n >\n {{ 'Deselect all markers' | translate }}\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: MapModule }, { kind: "component", type: i4.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "directive", type: i4.MapPopupDirective, selector: "[c8yMapPopup]" }, { kind: "ngmodule", type: ActionBarModule }, { kind: "component", type: i2.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i5.JsonPipe, name: "json" }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "directive", type: i2.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i2.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i2.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i2.RealtimeButtonComponent, selector: "c8y-realtime-btn", inputs: ["service", "label", "title", "disabled"], outputs: ["onToggle"] }, { kind: "component", type: i2.TimeIntervalComponent, selector: "c8y-time-interval", inputs: ["minCustomDate", "maxCustomDate", "dateRangePickerConfig", "selectedInterval"], outputs: ["interval"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: TrackingMarkerPopupComponent, selector: "c8y-tracking-marker-popup", inputs: ["context", "showTrackingLink"] }] }); }
215
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: TrackingComponent, isStandalone: true, selector: "c8y-tracking", providers: [EventRealtimeService], viewQueries: [{ propertyName: "map", first: true, predicate: MapComponent, descendants: true }], ngImport: i0, template: "<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"100\"\n>\n <c8y-realtime-btn\n [service]=\"realtime\"\n [disabled]=\"realtimeDisabled\"\n (onToggle)=\"togglePositionRealtime($event)\"\n ></c8y-realtime-btn>\n</c8y-action-bar-item>\n<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"60\"\n>\n <c8y-time-interval\n [maxCustomDate]=\"maxDate\"\n [dateRangePickerConfig]=\"dateRangePickerConfig\"\n (interval)=\"service.setInterval($event); toggleRealtime($event)\"\n ></c8y-time-interval>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div class=\"bg-white p-relative\">\n <c8y-map\n [config]=\"config\"\n [assets]=\"device\"\n [polyline$]=\"service.polyline$\"\n [polylineOptions]=\"{ color: 'darkblue' }\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup [context]=\"context\"></c8y-tracking-marker-popup>\n </div>\n </c8y-map>\n </div>\n\n <div class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\">\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Tracking events\n </span>\n </div>\n <div class=\"inner-scroll\">\n <c8y-list-group class=\"c8y-list__group--strip\">\n <ng-template\n c8yFor\n let-event\n [c8yForOf]=\"service.events$\"\n [c8yForPipe]=\"service.pipe\"\n [c8yForRealtime]=\"realtime\"\n [c8yForRealtimeOptions]=\"{ entityOrId: device }\"\n [c8yForLoadMore]=\"'hidden'\"\n [c8yForNotFound]=\"empty\"\n (c8yForLoadMoreComponent)=\"\n loadMoreComponent = $event; loadMoreComponent.useIntersection = false\n \"\n >\n <c8y-li\n class=\"pointer\"\n [ngClass]=\"{ 'text-primary text-bold': activeMarkers['p' + event?.id] }\"\n (click)=\"toggleMarker(event)\"\n [attr.data-cy]=\"'c8y-tracking--tracking-event-item-' + event?.id\"\n >\n <c8y-li-icon [ngClass]=\"{ 'text-primary': activeMarkers['p' + event?.id] }\">\n <i c8yIcon=\"c8y-location\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex\">\n <span>\n {{ event.time | date: 'mediumDate' }}\n </span>\n <span class=\"m-l-auto\">\n {{ event.time | date: 'mediumTime' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </ng-template>\n </c8y-list-group>\n </div>\n\n <!-- empty state -->\n <ng-template #empty>\n <c8y-ui-empty-state\n icon=\"c8y-location\"\n [title]=\"'No tracking events found.' | translate\"\n [subtitle]=\"'Select another time range.' | translate\"\n *ngIf=\"!service.hasEvents\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </ng-template>\n\n <div *ngIf=\"loadMoreComponent?.hasMore\">\n <button\n class=\"btn btn-link fit-w sticky-bottom separator-top\"\n [title]=\"'Load more' | translate\"\n type=\"button\"\n [disabled]=\"loadMoreComponent?.isLoading\"\n (click)=\"loadMoreComponent.loadMore()\"\n data-cy=\"c8y-tracking--load-more\"\n >\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Deselect all markers' | translate\"\n type=\"button\"\n [disabled]=\"(activeMarkers | json) === '{}'\"\n (click)=\"map.clearMarkers('event'); activeMarkers = {}\"\n >\n {{ 'Deselect all markers' | translate }}\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: MapModule }, { kind: "component", type: i4.MapComponent, selector: "c8y-map", inputs: ["config", "assets", "polyline$", "polylineOptions"], outputs: ["onRealtimeUpdate", "onMove", "onMoveEnd", "onZoomStart", "onZoomEnd", "onMap", "onInit"] }, { kind: "directive", type: i4.MapPopupDirective, selector: "[c8yMapPopup]" }, { kind: "ngmodule", type: ActionBarModule }, { kind: "component", type: i2.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i2.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i5.JsonPipe, name: "json" }, { kind: "pipe", type: i5.DatePipe, name: "date" }, { kind: "directive", type: i2.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "component", type: i2.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i2.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i2.ListItemIconComponent, selector: "c8y-list-item-icon, c8y-li-icon", inputs: ["icon", "status"] }, { kind: "component", type: i2.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i2.RealtimeButtonComponent, selector: "c8y-realtime-btn", inputs: ["service", "label", "title", "disabled"], outputs: ["onToggle"] }, { kind: "component", type: i2.TimeIntervalComponent, selector: "c8y-time-interval", inputs: ["minCustomDate", "maxCustomDate", "dateRangePickerConfig", "selectedInterval"], outputs: ["interval"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: TrackingMarkerPopupComponent, selector: "c8y-tracking-marker-popup", inputs: ["context", "showTrackingLink"] }] }); }
212
216
  }
213
217
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TrackingComponent, decorators: [{
214
218
  type: Component,
215
219
  args: [{ standalone: true, imports: [
216
220
  MapModule,
217
- AsyncPipe,
218
221
  ActionBarModule,
219
222
  CoreModule,
220
223
  TimeIntervalComponent,
221
224
  FormsModule,
222
225
  TrackingMarkerPopupComponent
223
- ], providers: [EventRealtimeService], selector: 'c8y-tracking', template: "<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"100\"\n>\n <c8y-realtime-btn\n [service]=\"realtime\"\n [disabled]=\"realtimeDisabled\"\n (onToggle)=\"togglePositionRealtime($event)\"\n ></c8y-realtime-btn>\n</c8y-action-bar-item>\n<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"60\"\n>\n <c8y-time-interval\n [maxCustomDate]=\"maxDate\"\n [dateRangePickerConfig]=\"dateRangePickerConfig\"\n (interval)=\"service.setInterval($event); toggleRealtime($event)\"\n ></c8y-time-interval>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div class=\"bg-white p-relative\">\n <c8y-map\n [config]=\"config\"\n [assets]=\"device\"\n [polyline$]=\"service.polyline$\"\n [polylineOptions]=\"{ color: 'darkblue' }\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup [context]=\"context\"></c8y-tracking-marker-popup>\n </div>\n </c8y-map>\n </div>\n\n <div class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\">\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Tracking events\n </span>\n </div>\n <div class=\"inner-scroll\">\n <c8y-list-group class=\"c8y-list__group--strip\">\n <ng-template\n c8yFor\n let-event\n [c8yForOf]=\"service.events$\"\n [c8yForPipe]=\"service.pipe\"\n [c8yForRealtime]=\"realtime\"\n [c8yForRealtimeOptions]=\"{ entityOrId: device }\"\n [c8yForLoadMore]=\"'hidden'\"\n [c8yForNotFound]=\"empty\"\n (c8yForLoadMoreComponent)=\"\n loadMoreComponent = $event; loadMoreComponent.useIntersection = false\n \"\n >\n <c8y-li\n class=\"pointer\"\n [ngClass]=\"{ 'text-primary text-bold': activeMarkers['p' + event?.id] }\"\n (click)=\"toggleMarker(event)\"\n >\n <c8y-li-icon [ngClass]=\"{ 'text-primary': activeMarkers['p' + event?.id] }\">\n <i c8yIcon=\"c8y-location\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex\">\n <span>\n {{ event.time | date: 'mediumDate' }}\n </span>\n <span class=\"m-l-auto\">\n {{ event.time | date: 'mediumTime' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </ng-template>\n </c8y-list-group>\n </div>\n\n <!-- empty state -->\n <ng-template #empty>\n <c8y-ui-empty-state\n icon=\"c8y-location\"\n [title]=\"'No tracking events found.' | translate\"\n [subtitle]=\"'Select another time range.' | translate\"\n *ngIf=\"!service.hasEvents\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </ng-template>\n\n <div *ngIf=\"loadMoreComponent?.hasMore\">\n <button\n class=\"btn btn-link fit-w sticky-bottom separator-top\"\n [title]=\"'Load more' | translate\"\n type=\"button\"\n [disabled]=\"loadMoreComponent?.isLoading\"\n (click)=\"loadMoreComponent.loadMore()\"\n >\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Deselect all markers' | translate\"\n type=\"button\"\n [disabled]=\"(activeMarkers | json) === '{}'\"\n (click)=\"map.clearMarkers('event'); activeMarkers = {}\"\n >\n {{ 'Deselect all markers' | translate }}\n </button>\n </div>\n </div>\n</div>\n" }]
226
+ ], providers: [EventRealtimeService], selector: 'c8y-tracking', template: "<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"100\"\n>\n <c8y-realtime-btn\n [service]=\"realtime\"\n [disabled]=\"realtimeDisabled\"\n (onToggle)=\"togglePositionRealtime($event)\"\n ></c8y-realtime-btn>\n</c8y-action-bar-item>\n<c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"60\"\n>\n <c8y-time-interval\n [maxCustomDate]=\"maxDate\"\n [dateRangePickerConfig]=\"dateRangePickerConfig\"\n (interval)=\"service.setInterval($event); toggleRealtime($event)\"\n ></c8y-time-interval>\n</c8y-action-bar-item>\n\n<div class=\"card card--grid content-fullpage d-grid grid__col--8-4--md\">\n <div class=\"bg-white p-relative\">\n <c8y-map\n [config]=\"config\"\n [assets]=\"device\"\n [polyline$]=\"service.polyline$\"\n [polylineOptions]=\"{ color: 'darkblue' }\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup [context]=\"context\"></c8y-tracking-marker-popup>\n </div>\n </c8y-map>\n </div>\n\n <div class=\"d-flex d-col bg-inherit content-fullpage bg-gray-white\">\n <div class=\"card-header large-padding separator sticky-top\">\n <span\n class=\"card-title\"\n translate\n >\n Tracking events\n </span>\n </div>\n <div class=\"inner-scroll\">\n <c8y-list-group class=\"c8y-list__group--strip\">\n <ng-template\n c8yFor\n let-event\n [c8yForOf]=\"service.events$\"\n [c8yForPipe]=\"service.pipe\"\n [c8yForRealtime]=\"realtime\"\n [c8yForRealtimeOptions]=\"{ entityOrId: device }\"\n [c8yForLoadMore]=\"'hidden'\"\n [c8yForNotFound]=\"empty\"\n (c8yForLoadMoreComponent)=\"\n loadMoreComponent = $event; loadMoreComponent.useIntersection = false\n \"\n >\n <c8y-li\n class=\"pointer\"\n [ngClass]=\"{ 'text-primary text-bold': activeMarkers['p' + event?.id] }\"\n (click)=\"toggleMarker(event)\"\n [attr.data-cy]=\"'c8y-tracking--tracking-event-item-' + event?.id\"\n >\n <c8y-li-icon [ngClass]=\"{ 'text-primary': activeMarkers['p' + event?.id] }\">\n <i c8yIcon=\"c8y-location\"></i>\n </c8y-li-icon>\n <c8y-li-body>\n <div class=\"d-flex\">\n <span>\n {{ event.time | date: 'mediumDate' }}\n </span>\n <span class=\"m-l-auto\">\n {{ event.time | date: 'mediumTime' }}\n </span>\n </div>\n </c8y-li-body>\n </c8y-li>\n </ng-template>\n </c8y-list-group>\n </div>\n\n <!-- empty state -->\n <ng-template #empty>\n <c8y-ui-empty-state\n icon=\"c8y-location\"\n [title]=\"'No tracking events found.' | translate\"\n [subtitle]=\"'Select another time range.' | translate\"\n *ngIf=\"!service.hasEvents\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n </ng-template>\n\n <div *ngIf=\"loadMoreComponent?.hasMore\">\n <button\n class=\"btn btn-link fit-w sticky-bottom separator-top\"\n [title]=\"'Load more' | translate\"\n type=\"button\"\n [disabled]=\"loadMoreComponent?.isLoading\"\n (click)=\"loadMoreComponent.loadMore()\"\n data-cy=\"c8y-tracking--load-more\"\n >\n {{ 'Load more' | translate }}\n </button>\n </div>\n\n <div class=\"card-footer separator\">\n <button\n class=\"btn btn-default\"\n [title]=\"'Deselect all markers' | translate\"\n type=\"button\"\n [disabled]=\"(activeMarkers | json) === '{}'\"\n (click)=\"map.clearMarkers('event'); activeMarkers = {}\"\n >\n {{ 'Deselect all markers' | translate }}\n </button>\n </div>\n </div>\n</div>\n" }]
224
227
  }], ctorParameters: () => [{ type: TrackingService }, { type: i2.EventRealtimeService }, { type: i2.ContextRouteService }, { type: i3.ActivatedRoute }], propDecorators: { map: [{
225
228
  type: ViewChild,
226
229
  args: [MapComponent]