@c8y/ngx-components 1021.51.1 → 1021.54.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 (252) 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/dashboard/dashboard-child-action.component.d.ts +1 -1
  12. package/core/dashboard/dashboard-child-action.component.d.ts.map +1 -1
  13. package/core/dashboard/dashboard.module.d.ts +29 -29
  14. package/core/dashboard/index.d.ts +3 -0
  15. package/core/dashboard/index.d.ts.map +1 -1
  16. package/core/dashboard/widgets-dashboard.component.d.ts +1 -1
  17. package/core/dashboard/widgets-dashboard.component.d.ts.map +1 -1
  18. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts +1 -1
  19. package/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.d.ts.map +1 -1
  20. package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts +1 -1
  21. package/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.d.ts.map +1 -1
  22. package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts +10 -0
  23. package/core/dashboard/wiget-time-context/widget-time-context-date-range.service.d.ts.map +1 -0
  24. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +7 -4
  25. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
  26. package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts +0 -1
  27. package/core/dashboard/wiget-time-context/widget-time-context.model.d.ts.map +1 -1
  28. package/core/date-picker/date-picker.component.d.ts +1 -1
  29. package/core/date-picker/date-picker.component.d.ts.map +1 -1
  30. package/core/date-picker/date-picker.module.d.ts +9 -9
  31. package/core/date-time-picker/close-date-picker.directive.d.ts +1 -1
  32. package/core/date-time-picker/close-date-picker.directive.d.ts.map +1 -1
  33. package/core/date-time-picker/date-time-picker.component.d.ts +6 -3
  34. package/core/date-time-picker/date-time-picker.component.d.ts.map +1 -1
  35. package/core/date-time-picker/date-time-picker.module.d.ts +11 -11
  36. package/core/date-time-picker/date-time-picker.module.d.ts.map +1 -1
  37. package/core/forms/forms.module.d.ts +18 -18
  38. package/core/forms/required-input-placeholder.directive.d.ts +1 -1
  39. package/core/forms/required-input-placeholder.directive.d.ts.map +1 -1
  40. package/core/router/router.service.d.ts.map +1 -1
  41. package/core/user/user-menu.service.d.ts +36 -11
  42. package/core/user/user-menu.service.d.ts.map +1 -1
  43. package/datapoint-explorer/c8y-ngx-components-datapoint-explorer.d.ts.map +1 -0
  44. package/datapoint-explorer/datapoint-explorer.module.d.ts +7 -0
  45. package/datapoint-explorer/datapoint-explorer.module.d.ts.map +1 -0
  46. package/datapoint-explorer/index.d.ts +2 -0
  47. package/datapoint-explorer/index.d.ts.map +1 -0
  48. package/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.d.ts.map +1 -0
  49. package/datapoint-explorer/view/configuration/naming-dictionary.d.ts +3 -0
  50. package/datapoint-explorer/view/configuration/naming-dictionary.d.ts.map +1 -0
  51. package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts +38 -0
  52. package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts.map +1 -0
  53. package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts +7 -0
  54. package/datapoint-explorer/view/configuration/workspace-configuration.model.d.ts.map +1 -0
  55. package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts +15 -0
  56. package/datapoint-explorer/view/configuration/workspace-configuration.service.d.ts.map +1 -0
  57. package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts +25 -0
  58. package/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.d.ts.map +1 -0
  59. package/datapoint-explorer/view/datapoint-explorer.component.d.ts +67 -0
  60. package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -0
  61. package/datapoint-explorer/view/datapoint-explorer.service.d.ts +9 -0
  62. package/datapoint-explorer/view/datapoint-explorer.service.d.ts.map +1 -0
  63. package/datapoint-explorer/view/index.d.ts +2 -0
  64. package/datapoint-explorer/view/index.d.ts.map +1 -0
  65. package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts +23 -0
  66. package/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.d.ts.map +1 -0
  67. package/echart/c8y-ngx-components-echart.d.ts.map +1 -0
  68. package/echart/chart-alerts/chart-alerts.component.d.ts +8 -0
  69. package/echart/chart-alerts/chart-alerts.component.d.ts.map +1 -0
  70. package/echart/charts.component.d.ts +63 -0
  71. package/echart/charts.component.d.ts.map +1 -0
  72. package/echart/index.d.ts +5 -0
  73. package/echart/index.d.ts.map +1 -0
  74. package/echart/models/c8y-ngx-components-echart-models.d.ts.map +1 -0
  75. package/echart/models/chart.model.d.ts +37 -0
  76. package/echart/models/chart.model.d.ts.map +1 -0
  77. package/echart/models/datapoints-graph-widget.model.d.ts +126 -0
  78. package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -0
  79. package/echart/models/index.d.ts +4 -0
  80. package/echart/models/index.d.ts.map +1 -0
  81. package/echart/models/svg-icons.model.d.ts +22 -0
  82. package/echart/models/svg-icons.model.d.ts.map +1 -0
  83. package/echart/services/chart-alarms.service.d.ts +17 -0
  84. package/echart/services/chart-alarms.service.d.ts.map +1 -0
  85. package/echart/services/chart-events.service.d.ts +17 -0
  86. package/echart/services/chart-events.service.d.ts.map +1 -0
  87. package/echart/services/chart-realtime.service.d.ts +35 -0
  88. package/echart/services/chart-realtime.service.d.ts.map +1 -0
  89. package/echart/services/chart-types.service.d.ts +15 -0
  90. package/echart/services/chart-types.service.d.ts.map +1 -0
  91. package/echart/services/custom-measurements.service.d.ts +12 -0
  92. package/echart/services/custom-measurements.service.d.ts.map +1 -0
  93. package/echart/services/echarts-options.service.d.ts +143 -0
  94. package/echart/services/echarts-options.service.d.ts.map +1 -0
  95. package/echart/services/y-axis.service.d.ts +17 -0
  96. package/echart/services/y-axis.service.d.ts.map +1 -0
  97. package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.mjs +37 -12
  98. package/esm2022/alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.model.mjs +2 -0
  99. package/esm2022/alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.mjs +39 -12
  100. package/esm2022/alarm-event-selector/alarm-event-selector-list-item/alarm-event-selector-list-item.component.mjs +6 -4
  101. package/esm2022/alarm-event-selector/alarm-event-selector.component.mjs +1 -1
  102. package/esm2022/alarm-event-selector/alarm-event-selector.model.mjs +1 -1
  103. package/esm2022/alarm-event-selector/custom-alarm-event-form/custom-alarm-event-form.component.mjs +1 -1
  104. package/esm2022/alarms/alarms-filter.component.mjs +3 -3
  105. package/esm2022/core/dashboard/dashboard-child-action.component.mjs +3 -3
  106. package/esm2022/core/dashboard/dashboard.module.mjs +17 -14
  107. package/esm2022/core/dashboard/index.mjs +4 -1
  108. package/esm2022/core/dashboard/widgets-dashboard.component.mjs +9 -9
  109. package/esm2022/core/dashboard/wiget-time-context/aggregation-picker/aggregation-picker.component.mjs +11 -9
  110. package/esm2022/core/dashboard/wiget-time-context/realtime-control/realtime-control.component.mjs +8 -7
  111. package/esm2022/core/dashboard/wiget-time-context/widget-time-context-date-range.service.mjs +23 -0
  112. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +70 -26
  113. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.model.mjs +1 -1
  114. package/esm2022/core/date-picker/date-picker.component.mjs +29 -14
  115. package/esm2022/core/date-picker/date-picker.module.mjs +9 -7
  116. package/esm2022/core/date-time-picker/close-date-picker.directive.mjs +4 -3
  117. package/esm2022/core/date-time-picker/date-time-picker.component.mjs +57 -29
  118. package/esm2022/core/date-time-picker/date-time-picker.module.mjs +11 -7
  119. package/esm2022/core/forms/forms.module.mjs +3 -3
  120. package/esm2022/core/forms/ip-range-input-list.component.mjs +5 -5
  121. package/esm2022/core/forms/required-input-placeholder.directive.mjs +4 -3
  122. package/esm2022/core/router/router.service.mjs +1 -1
  123. package/esm2022/core/user/user-menu.service.mjs +57 -17
  124. package/esm2022/datapoint-explorer/c8y-ngx-components-datapoint-explorer.mjs +5 -0
  125. package/esm2022/datapoint-explorer/datapoint-explorer.module.mjs +65 -0
  126. package/esm2022/datapoint-explorer/index.mjs +2 -0
  127. package/esm2022/datapoint-explorer/view/c8y-ngx-components-datapoint-explorer-view.mjs +5 -0
  128. package/esm2022/datapoint-explorer/view/configuration/naming-dictionary.mjs +65 -0
  129. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.component.mjs +169 -0
  130. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.model.mjs +2 -0
  131. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.service.mjs +40 -0
  132. package/esm2022/datapoint-explorer/view/create-new-report-modal/create-new-report-modal.component.mjs +64 -0
  133. package/esm2022/datapoint-explorer/view/datapoint-explorer.component.mjs +279 -0
  134. package/esm2022/datapoint-explorer/view/datapoint-explorer.service.mjs +23 -0
  135. package/esm2022/datapoint-explorer/view/index.mjs +2 -0
  136. package/esm2022/datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.mjs +48 -0
  137. package/esm2022/datapoint-selector/datapoint-attributes-form/datapoint-attributes-form.component.mjs +3 -3
  138. package/esm2022/datapoint-selector/datapoint-selector-list-item/datapoint-selector-list-item.component.mjs +3 -3
  139. 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
  140. package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +3 -3
  141. package/esm2022/device-list/add-smart-group.component.mjs +3 -3
  142. package/esm2022/echart/c8y-ngx-components-echart.mjs +5 -0
  143. package/esm2022/echart/chart-alerts/chart-alerts.component.mjs +16 -0
  144. package/esm2022/echart/charts.component.mjs +560 -0
  145. package/esm2022/echart/index.mjs +5 -0
  146. package/esm2022/echart/models/c8y-ngx-components-echart-models.mjs +5 -0
  147. package/esm2022/echart/models/chart.model.mjs +2 -0
  148. package/esm2022/echart/models/datapoints-graph-widget.model.mjs +17 -0
  149. package/esm2022/echart/models/index.mjs +4 -0
  150. package/esm2022/echart/models/svg-icons.model.mjs +22 -0
  151. package/esm2022/echart/services/chart-alarms.service.mjs +58 -0
  152. package/esm2022/echart/services/chart-events.service.mjs +44 -0
  153. package/esm2022/echart/services/chart-realtime.service.mjs +193 -0
  154. package/esm2022/echart/services/chart-types.service.mjs +102 -0
  155. package/esm2022/echart/services/custom-measurements.service.mjs +52 -0
  156. package/esm2022/echart/services/echarts-options.service.mjs +857 -0
  157. package/esm2022/echart/services/y-axis.service.mjs +150 -0
  158. package/esm2022/icon-selector/icons/platform/index.mjs +10 -8
  159. package/esm2022/interval-picker/interval-picker.component.mjs +3 -3
  160. package/esm2022/interval-picker/interval-picker.model.mjs +1 -1
  161. package/esm2022/report-dashboard/index.mjs +2 -1
  162. package/esm2022/time-context/c8y-ngx-components-time-context.mjs +5 -0
  163. package/esm2022/time-context/index.mjs +2 -0
  164. package/esm2022/time-context/time-context.component.mjs +217 -0
  165. package/esm2022/time-context/time-context.service.mjs +83 -0
  166. package/esm2022/translation-editor/lazy/translation-editor/translation-editor.component.mjs +6 -5
  167. package/esm2022/widgets/cockpit-exports/index.mjs +8 -1
  168. package/esm2022/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +5 -0
  169. package/esm2022/widgets/definitions/datapoints-graph/index.mjs +31 -0
  170. package/esm2022/widgets/definitions/index.mjs +3 -2
  171. package/esm2022/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +5 -0
  172. package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.mjs +239 -0
  173. package/esm2022/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.mjs +241 -0
  174. package/esm2022/widgets/implementations/datapoints-graph/index.mjs +3 -0
  175. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +80 -28
  176. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs.map +1 -1
  177. package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
  178. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  179. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +658 -0
  180. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -0
  181. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +72 -0
  182. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs.map +1 -0
  183. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +4 -4
  184. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
  185. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +4 -4
  186. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  187. package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
  188. package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
  189. package/fesm2022/c8y-ngx-components-echart-models.mjs +46 -0
  190. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -0
  191. package/fesm2022/c8y-ngx-components-echart.mjs +2023 -0
  192. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -0
  193. package/fesm2022/c8y-ngx-components-icon-selector-icons-platform.mjs +9 -7
  194. package/fesm2022/c8y-ngx-components-icon-selector-icons-platform.mjs.map +1 -1
  195. package/fesm2022/c8y-ngx-components-interval-picker.mjs +2 -2
  196. package/fesm2022/c8y-ngx-components-interval-picker.mjs.map +1 -1
  197. package/fesm2022/c8y-ngx-components-report-dashboard.mjs +1 -1
  198. package/fesm2022/c8y-ngx-components-time-context.mjs +300 -0
  199. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -0
  200. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +5 -4
  201. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs.map +1 -1
  202. package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs +7 -0
  203. package/fesm2022/c8y-ngx-components-widgets-cockpit-exports.mjs.map +1 -1
  204. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +38 -0
  205. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs.map +1 -0
  206. package/fesm2022/c8y-ngx-components-widgets-definitions.mjs +2 -1
  207. package/fesm2022/c8y-ngx-components-widgets-definitions.mjs.map +1 -1
  208. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +467 -0
  209. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -0
  210. package/fesm2022/c8y-ngx-components.mjs +429 -277
  211. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  212. package/icon-selector/icons/index.d.ts +1 -1
  213. package/icon-selector/icons/platform/index.d.ts +2 -2
  214. package/icon-selector/icons/platform/index.d.ts.map +1 -1
  215. package/interval-picker/interval-picker.component.d.ts.map +1 -1
  216. package/interval-picker/interval-picker.model.d.ts.map +1 -1
  217. package/locales/de.po +206 -279
  218. package/locales/es.po +206 -279
  219. package/locales/fr.po +206 -279
  220. package/locales/ja_JP.po +196 -279
  221. package/locales/ko.po +455 -444
  222. package/locales/locales.pot +190 -272
  223. package/locales/nl.po +206 -279
  224. package/locales/pl.po +206 -279
  225. package/locales/pt_BR.po +206 -279
  226. package/locales/zh_CN.po +450 -443
  227. package/locales/zh_TW.po +452 -445
  228. package/package.json +1 -1
  229. package/report-dashboard/index.d.ts +1 -0
  230. package/report-dashboard/index.d.ts.map +1 -1
  231. package/time-context/c8y-ngx-components-time-context.d.ts.map +1 -0
  232. package/time-context/index.d.ts +2 -0
  233. package/time-context/index.d.ts.map +1 -0
  234. package/time-context/time-context.component.d.ts +61 -0
  235. package/time-context/time-context.component.d.ts.map +1 -0
  236. package/time-context/time-context.service.d.ts +25 -0
  237. package/time-context/time-context.service.d.ts.map +1 -0
  238. package/translation-editor/lazy/translation-editor/translation-editor.component.d.ts.map +1 -1
  239. package/widgets/cockpit-exports/index.d.ts +6 -0
  240. package/widgets/cockpit-exports/index.d.ts.map +1 -1
  241. package/widgets/definitions/datapoints-graph/c8y-ngx-components-widgets-definitions-datapoints-graph.d.ts.map +1 -0
  242. package/widgets/definitions/datapoints-graph/index.d.ts +16 -0
  243. package/widgets/definitions/datapoints-graph/index.d.ts.map +1 -0
  244. package/widgets/definitions/index.d.ts +1 -0
  245. package/widgets/definitions/index.d.ts.map +1 -1
  246. package/widgets/implementations/datapoints-graph/c8y-ngx-components-widgets-implementations-datapoints-graph.d.ts.map +1 -0
  247. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +43 -0
  248. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -0
  249. package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts +54 -0
  250. package/widgets/implementations/datapoints-graph/datapoints-graph-view/datapoints-graph-widget-view.component.d.ts.map +1 -0
  251. package/widgets/implementations/datapoints-graph/index.d.ts +3 -0
  252. package/widgets/implementations/datapoints-graph/index.d.ts.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-interval-picker.mjs","sources":["../../interval-picker/interval-picker.model.ts","../../interval-picker/interval-picker.component.ts","../../interval-picker/interval-picker.component.html","../../interval-picker/c8y-ngx-components-interval-picker.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\n\nconst todayDate = new Date();\nexport enum TimeSpanInMs {\n 'MINUTE' = 1000 * 60,\n 'HOUR' = 1000 * 60 * 60,\n 'DAY' = 1000 * 60 * 60 * 24,\n 'WEEK' = 1000 * 60 * 60 * 24 * 7,\n 'MONTH' = todayDate.valueOf() - new Date(todayDate.setMonth(todayDate.getMonth() - 1)).valueOf()\n}\n\nexport type Interval = {\n id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';\n title: string;\n timespanInMs?: number;\n};\n\nexport type AlarmFilterInterval =\n | Interval\n | {\n id: 'none';\n title: string;\n timespanInMs?: number;\n };\n\nexport const INTERVALS: Interval[] = [\n {\n id: 'minutes',\n title: gettext('Last minute'),\n timespanInMs: TimeSpanInMs.MINUTE\n },\n {\n id: 'hours',\n title: gettext('Last hour'),\n timespanInMs: TimeSpanInMs.HOUR\n },\n {\n id: 'days',\n title: gettext('Last day'),\n timespanInMs: TimeSpanInMs.DAY\n },\n {\n id: 'weeks',\n title: gettext('Last week'),\n timespanInMs: TimeSpanInMs.WEEK\n },\n {\n id: 'months',\n title: gettext('Last month'),\n timespanInMs: TimeSpanInMs.MONTH\n },\n { id: 'custom', title: gettext('Custom') }\n];\n\nexport const INTERVAL_TITLES: Record<Interval['id'], string> = {\n minutes: gettext('Last minute'),\n hours: gettext('Last hour'),\n days: gettext('Last day'),\n weeks: gettext('Last week'),\n months: gettext('Last month'),\n custom: gettext('Custom')\n};\n\ntype IntervalKey = Interval['id'];\ntype IntervalMap = { [K in IntervalKey]: K };\n\nexport const INTERVAL_VALUES = Object.keys(INTERVAL_TITLES).reduce(\n (acc, key) => ({\n ...acc,\n [key]: key\n }),\n {} as IntervalMap\n);\n","import { Component, forwardRef, Input } from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { AlarmFilterInterval, Interval, INTERVALS } from './interval-picker.model';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-interval-picker',\n templateUrl: './interval-picker.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => IntervalPickerComponent),\n multi: true\n }\n ],\n standalone: true,\n imports: [CommonModule, FormsModule, A11yModule, ReactiveFormsModule, BsDropdownModule]\n})\nexport class IntervalPickerComponent implements ControlValueAccessor {\n @Input() INTERVALS: Interval[] | AlarmFilterInterval[] = INTERVALS;\n\n value: Interval['id'];\n touched = false;\n disabled = false;\n translatedIntervals: { id: string; title: string }[] = [];\n\n constructor(private translate: TranslateService) {}\n\n ngOnInit() {\n this.translatedIntervals = this.INTERVALS.map(interval => ({\n ...interval,\n title: this.translate.instant(interval.title)\n }));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange = _ => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onTouched = () => {};\n\n writeValue(value: Interval['id']) {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(onTouched: any) {\n this.onTouched = onTouched;\n }\n\n markAsTouched() {\n if (!this.touched) {\n this.onTouched();\n this.touched = true;\n }\n }\n\n setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n}\n","<li\n *ngFor=\"let interval of translatedIntervals\"\n [ngClass]=\"{\n active: interval.id === value\n }\"\n>\n <button\n type=\"button\"\n (click)=\"onChange(interval.id)\"\n >\n <span\n [ngClass]=\"{\n 'text-primary': interval.id === value\n }\"\n >\n <span\n c8yIcon=\"check\"\n [ngStyle]=\"{ visibility: interval.id === value ? 'visible' : 'hidden' }\"\n ></span>\n {{ interval.title }}\n </span>\n </button>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IACjB,aAMX;AAND,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,YAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA,GAAA,QAAoB,CAAA;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,OAAA,CAAA,GAAA,MAAuB,CAAA;AACvB,IAAA,YAAA,CAAA,YAAA,CAAA,KAAA,CAAA,GAAA,QAAA,CAAA,GAAA,KAA2B,CAAA;AAC3B,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,SAAA,CAAA,GAAA,MAAgC,CAAA;IAChC,YAAU,CAAA,YAAA,CAAA,OAAA,CAAA,GAAA,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,GAAA,OAAA,CAAA;AAClG,CAAC,EANW,YAAY,KAAZ,YAAY,GAMvB,EAAA,CAAA,CAAA,CAAA;AAgBY,MAAA,SAAS,GAAe;AACnC,IAAA;AACE,QAAA,EAAE,EAAE,SAAS;AACb,QAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC;QAC7B,YAAY,EAAE,YAAY,CAAC,MAAM;AAClC,KAAA;AACD,IAAA;AACE,QAAA,EAAE,EAAE,OAAO;AACX,QAAA,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC;QA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AA,QAAA,EAAA,qBAAqB,EAEpB,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,6BAA6B,CAAC;AACtD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,6eAAA,EAAA,CAAA;qFAG9E,SAAS,EAAA,CAAA;sBAAjB,KAAK;;;AE3BR;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-interval-picker.mjs","sources":["../../interval-picker/interval-picker.model.ts","../../interval-picker/interval-picker.component.ts","../../interval-picker/interval-picker.component.html","../../interval-picker/c8y-ngx-components-interval-picker.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\n\nconst todayDate = new Date();\nexport enum TimeSpanInMs {\n 'MINUTE' = 1000 * 60,\n 'HOUR' = 1000 * 60 * 60,\n 'DAY' = 1000 * 60 * 60 * 24,\n 'WEEK' = 1000 * 60 * 60 * 24 * 7,\n 'MONTH' = todayDate.valueOf() - new Date(todayDate.setMonth(todayDate.getMonth() - 1)).valueOf()\n}\nexport type Interval = {\n id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';\n title: string;\n timespanInMs?: number;\n};\n\nexport type AlarmFilterInterval =\n | Interval\n | {\n id: 'none';\n title: string;\n timespanInMs?: number;\n };\n\nexport const INTERVALS: Interval[] = [\n {\n id: 'minutes',\n title: gettext('Last minute'),\n timespanInMs: TimeSpanInMs.MINUTE\n },\n {\n id: 'hours',\n title: gettext('Last hour'),\n timespanInMs: TimeSpanInMs.HOUR\n },\n {\n id: 'days',\n title: gettext('Last day'),\n timespanInMs: TimeSpanInMs.DAY\n },\n {\n id: 'weeks',\n title: gettext('Last week'),\n timespanInMs: TimeSpanInMs.WEEK\n },\n {\n id: 'months',\n title: gettext('Last month'),\n timespanInMs: TimeSpanInMs.MONTH\n },\n { id: 'custom', title: gettext('Custom') }\n];\n\nexport const INTERVAL_TITLES: Record<Interval['id'], string> = {\n minutes: gettext('Last minute'),\n hours: gettext('Last hour'),\n days: gettext('Last day'),\n weeks: gettext('Last week'),\n months: gettext('Last month'),\n custom: gettext('Custom')\n};\n\ntype IntervalKey = Interval['id'];\ntype IntervalMap = { [K in IntervalKey]: K };\n\nexport const INTERVAL_VALUES = Object.keys(INTERVAL_TITLES).reduce(\n (acc, key) => ({\n ...acc,\n [key]: key\n }),\n {} as IntervalMap\n);\n","import { Component, forwardRef, Input } from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n FormsModule,\n ReactiveFormsModule\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { AlarmFilterInterval, Interval, INTERVALS } from './interval-picker.model';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Component({\n selector: 'c8y-interval-picker',\n templateUrl: './interval-picker.component.html',\n standalone: true,\n imports: [CommonModule, FormsModule, A11yModule, ReactiveFormsModule, BsDropdownModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => IntervalPickerComponent),\n multi: true\n }\n ]\n})\nexport class IntervalPickerComponent implements ControlValueAccessor {\n @Input() INTERVALS: Interval[] | AlarmFilterInterval[] = INTERVALS;\n\n value: Interval['id'];\n touched = false;\n disabled = false;\n\n translatedIntervals: { id: string; title: string }[] = [];\n\n constructor(private translate: TranslateService) {}\n\n ngOnInit() {\n this.translatedIntervals = this.INTERVALS.map(interval => ({\n ...interval,\n title: this.translate.instant(interval.title)\n }));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onChange = _ => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onTouched = () => {};\n\n writeValue(value: Interval['id']) {\n this.value = value;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(onTouched: any) {\n this.onTouched = onTouched;\n }\n\n markAsTouched() {\n if (!this.touched) {\n this.onTouched();\n this.touched = true;\n }\n }\n\n setDisabledState(disabled: boolean) {\n this.disabled = disabled;\n }\n}\n","<li\n *ngFor=\"let interval of translatedIntervals\"\n [ngClass]=\"{\n active: interval.id === value\n }\"\n>\n <button\n type=\"button\"\n (click)=\"onChange(interval.id)\"\n >\n <span\n [ngClass]=\"{\n 'text-primary': interval.id === value\n }\"\n >\n <span\n c8yIcon=\"check\"\n [ngStyle]=\"{ visibility: interval.id === value ? 'visible' : 'hidden' }\"\n ></span>\n {{ interval.title }}\n </span>\n </button>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IACjB,aAMX;AAND,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,YAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA,GAAA,QAAoB,CAAA;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,OAAA,CAAA,GAAA,MAAuB,CAAA;AACvB,IAAA,YAAA,CAAA,YAAA,CAAA,KAAA,CAAA,GAAA,QAAA,CAAA,GAAA,KAA2B,CAAA;AAC3B,IAAA,YAAA,CAAA,YAAA,CAAA,MAAA,CAAA,GAAA,SAAA,CAAA,GAAA,MAAgC,CAAA;IAChC,YAAU,CAAA,YAAA,CAAA,OAAA,CAAA,GAAA,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA,GAAA,OAAA,CAAA;AAClG,CAAC,EANW,YAAY,KAAZ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,EAAA,IAAA,EAAA,WAAW,8BAAE,UAAU,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAS3E,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAbnC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EAEnB,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAC5E,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,6BAA6B,CAAC;AACtD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,QAAA,EAAA,6eAAA,EAAA,CAAA;qFAGQ,SAAS,EAAA,CAAA;sBAAjB,KAAK;;;AE3BR;;AAEG;;;;"}
@@ -290,5 +290,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
290
290
  * Generated bundle index. Do not edit.
291
291
  */
292
292
 
293
- export { ReportDashboardGuard, ReportDashboardModule, ReportDashboardNavigationFactory };
293
+ export { ReportDashboardGuard, ReportDashboardModule, ReportDashboardNavigationFactory, ReportDashboardService };
294
294
  //# sourceMappingURL=c8y-ngx-components-report-dashboard.mjs.map
@@ -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,eAAe,CAAC,QAAQ;SACtC,CAAC;KACH;AAED,IAAA,oBAAoB,CAClB,CAAC,QAAQ,EAAE,MAAM,CAAkB,EACnC,oBAA4C,EAAA;AAK5C,QAAA,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACzE,MAAM,oBAAoB,GAAG,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;QAEhF,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE9D,MAAM,2BAA2B,GAC/B,oBAAoB,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;QAE/E,MAAM,mBAAmB,GAAG,2BAA2B;AACrD,cAAE,oBAAoB;AACtB,cAAE,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAA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hC;;AAEG;;;;"}
@@ -2,7 +2,7 @@ import { NgIf, NgForOf } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Component, Optional, ViewChild } from '@angular/core';
4
4
  import * as i3 from '@c8y/ngx-components';
5
- import { C8yTranslatePipe, IconDirective, ModalModule, MessagesComponent, MessageDirective, C8yTranslateDirective, FormGroupComponent, BuiltInActionType, gettext as gettext$1, TitleComponent, DataGridModule, LoadingComponent, ActionBarItemComponent } from '@c8y/ngx-components';
5
+ import { C8yTranslatePipe, IconDirective, ModalModule, MessagesComponent, MessageDirective, C8yTranslateDirective, FormGroupComponent, BuiltInActionType, gettext as gettext$1, TitleComponent, DataGridModule, LoadingComponent, ActionBarItemComponent, HelpModule } from '@c8y/ngx-components';
6
6
  import * as i1$1 from '@c8y/ngx-components/translation-editor/data';
7
7
  import * as i1 from '@angular/forms';
8
8
  import { FormsModule, Validators, ReactiveFormsModule } from '@angular/forms';
@@ -212,7 +212,7 @@ class TranslationEditorComponent {
212
212
  return columns;
213
213
  }
214
214
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TranslationEditorComponent, deps: [{ token: i1$1.TranslationStoreService }, { token: i2.BsModalService }, { token: i3.AlertService }, { token: i3.AppStateService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
215
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: TranslationEditorComponent, isStandalone: true, selector: "c8y-translation-editor", ngImport: i0, template: "<c8y-title translate>Localization</c8y-title>\n\n<ng-container *ngIf=\"!isLoading; else loading\">\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEntry()\"\n data-cy=\"c8y-translation-editor--add-translation\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n <span translate>Add translation</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"saveTranslations()\"\n data-cy=\"c8y-translation-editor--save-and-apply\"\n >\n <i c8yIcon=\"save\"></i>\n <span translate>Save & apply</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-data-grid\n class=\"content-fullpage d-flex d-col\"\n [title]=\"'Translations' | translate\"\n [columns]=\"columns\"\n [actionControls]=\"actionControls\"\n [pagination]=\"pagination\"\n [displayOptions]=\"displayOptions\"\n (onReload)=\"refresh()\"\n [rows]=\"items\"\n ></c8y-data-grid>\n</ng-container>\n\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "ngmodule", type: DataGridModule }, { kind: "component", type: i3.DataGridComponent, selector: "c8y-data-grid", inputs: ["title", "loadMoreItemsLabel", "loadingItemsLabel", "showSearch", "refresh", "columns", "rows", "pagination", "infiniteScroll", "serverSideDataCallback", "selectable", "singleSelection", "selectionPrimaryKey", "displayOptions", "actionControls", "bulkActionControls", "headerActionControls", "searchText", "configureColumnsEnabled", "showCounterWarning", "activeClassName", "expandableRows"], outputs: ["rowMouseOver", "rowMouseLeave", "rowClick", "onConfigChange", "onBeforeFilter", "onBeforeSearch", "onFilter", "itemsSelect", "onReload", "onAddCustomColumn", "onRemoveCustomColumn", "onColumnFilterReset", "onSort", "onPageSizeChange", "onColumnReordered", "onColumnVisibilityChange"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }] }); }
215
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: TranslationEditorComponent, isStandalone: true, selector: "c8y-translation-editor", ngImport: i0, template: "<c8y-title translate>Localization</c8y-title>\n\n<ng-container *ngIf=\"!isLoading; else loading\">\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEntry()\"\n data-cy=\"c8y-translation-editor--add-translation\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n <span translate>Add translation</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"saveTranslations()\"\n data-cy=\"c8y-translation-editor--save-and-apply\"\n >\n <i c8yIcon=\"save\"></i>\n <span translate>Save & apply</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-help src=\"/docs/standard-tenant/changing-settings/#localization\"></c8y-help>\n\n <c8y-data-grid\n class=\"content-fullpage d-flex d-col\"\n [title]=\"'Translations' | translate\"\n [columns]=\"columns\"\n [actionControls]=\"actionControls\"\n [pagination]=\"pagination\"\n [displayOptions]=\"displayOptions\"\n (onReload)=\"refresh()\"\n [rows]=\"items\"\n ></c8y-data-grid>\n</ng-container>\n\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "ngmodule", type: DataGridModule }, { kind: "component", type: i3.DataGridComponent, selector: "c8y-data-grid", inputs: ["title", "loadMoreItemsLabel", "loadingItemsLabel", "showSearch", "refresh", "columns", "rows", "pagination", "infiniteScroll", "serverSideDataCallback", "selectable", "singleSelection", "selectionPrimaryKey", "displayOptions", "actionControls", "bulkActionControls", "headerActionControls", "searchText", "configureColumnsEnabled", "showCounterWarning", "activeClassName", "expandableRows"], outputs: ["rowMouseOver", "rowMouseLeave", "rowClick", "onConfigChange", "onBeforeFilter", "onBeforeSearch", "onFilter", "itemsSelect", "onReload", "onAddCustomColumn", "onRemoveCustomColumn", "onColumnFilterReset", "onSort", "onPageSizeChange", "onColumnReordered", "onColumnVisibilityChange"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "ngmodule", type: HelpModule }, { kind: "component", type: i3.HelpComponent, selector: "c8y-help", inputs: ["src", "isCollapsed", "priority", "icon"] }] }); }
216
216
  }
217
217
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: TranslationEditorComponent, decorators: [{
218
218
  type: Component,
@@ -224,8 +224,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
224
224
  C8yTranslatePipe,
225
225
  ActionBarItemComponent,
226
226
  IconDirective,
227
- C8yTranslateDirective
228
- ], template: "<c8y-title translate>Localization</c8y-title>\n\n<ng-container *ngIf=\"!isLoading; else loading\">\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEntry()\"\n data-cy=\"c8y-translation-editor--add-translation\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n <span translate>Add translation</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"saveTranslations()\"\n data-cy=\"c8y-translation-editor--save-and-apply\"\n >\n <i c8yIcon=\"save\"></i>\n <span translate>Save & apply</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-data-grid\n class=\"content-fullpage d-flex d-col\"\n [title]=\"'Translations' | translate\"\n [columns]=\"columns\"\n [actionControls]=\"actionControls\"\n [pagination]=\"pagination\"\n [displayOptions]=\"displayOptions\"\n (onReload)=\"refresh()\"\n [rows]=\"items\"\n ></c8y-data-grid>\n</ng-container>\n\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n" }]
227
+ C8yTranslateDirective,
228
+ HelpModule
229
+ ], template: "<c8y-title translate>Localization</c8y-title>\n\n<ng-container *ngIf=\"!isLoading; else loading\">\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"addEntry()\"\n data-cy=\"c8y-translation-editor--add-translation\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n <span translate>Add translation</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item placement=\"right\">\n <button\n class=\"btn btn-link\"\n (click)=\"saveTranslations()\"\n data-cy=\"c8y-translation-editor--save-and-apply\"\n >\n <i c8yIcon=\"save\"></i>\n <span translate>Save & apply</span>\n </button>\n </c8y-action-bar-item>\n\n <c8y-help src=\"/docs/standard-tenant/changing-settings/#localization\"></c8y-help>\n\n <c8y-data-grid\n class=\"content-fullpage d-flex d-col\"\n [title]=\"'Translations' | translate\"\n [columns]=\"columns\"\n [actionControls]=\"actionControls\"\n [pagination]=\"pagination\"\n [displayOptions]=\"displayOptions\"\n (onReload)=\"refresh()\"\n [rows]=\"items\"\n ></c8y-data-grid>\n</ng-container>\n\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n" }]
229
230
  }], ctorParameters: () => [{ type: i1$1.TranslationStoreService }, { type: i2.BsModalService }, { type: i3.AlertService }, { type: i3.AppStateService }, { type: i3.TranslateService }] });
230
231
 
231
232
  /**