@c8y/ngx-components 1024.15.13 → 1024.16.5

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 (60) hide show
  1. package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +303 -63
  2. package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs.map +1 -1
  3. package/fesm2022/c8y-ngx-components-ai-agents-html.mjs +9 -0
  4. package/fesm2022/c8y-ngx-components-ai-agents-html.mjs.map +1 -1
  5. package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs +4 -0
  6. package/fesm2022/c8y-ngx-components-ai-agents-scada.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +394 -52
  8. package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-ai.mjs +329 -19
  10. package/fesm2022/c8y-ngx-components-ai.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +7 -1
  12. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  13. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +95 -76
  14. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  15. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +92 -47
  16. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
  17. package/fesm2022/c8y-ngx-components-echart.mjs +39 -12
  18. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  19. package/fesm2022/c8y-ngx-components-time-context.mjs +13 -9
  20. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
  21. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs +3 -2
  22. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs.map +1 -1
  23. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs +4 -6
  24. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-table.mjs.map +1 -1
  25. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs +3 -2
  26. package/fesm2022/c8y-ngx-components-widgets-implementations-scada.mjs.map +1 -1
  27. package/fesm2022/c8y-ngx-components.mjs +65 -14
  28. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  29. package/locales/de.po +147 -16
  30. package/locales/es.po +143 -11
  31. package/locales/fr.po +459 -324
  32. package/locales/ja_JP.po +143 -11
  33. package/locales/ko.po +143 -11
  34. package/locales/locales.pot +139 -10
  35. package/locales/nl.po +143 -11
  36. package/locales/pl.po +143 -11
  37. package/locales/pt_BR.po +143 -11
  38. package/locales/zh_CN.po +143 -11
  39. package/locales/zh_TW.po +143 -11
  40. package/package.json +1 -1
  41. package/types/c8y-ngx-components-ai-agent-chat.d.ts +111 -4
  42. package/types/c8y-ngx-components-ai-agent-chat.d.ts.map +1 -1
  43. package/types/c8y-ngx-components-ai-agents-html.d.ts.map +1 -1
  44. package/types/c8y-ngx-components-ai-agents-scada.d.ts.map +1 -1
  45. package/types/c8y-ngx-components-ai-ai-chat.d.ts +224 -10
  46. package/types/c8y-ngx-components-ai-ai-chat.d.ts.map +1 -1
  47. package/types/c8y-ngx-components-ai.d.ts +176 -6
  48. package/types/c8y-ngx-components-ai.d.ts.map +1 -1
  49. package/types/c8y-ngx-components-context-dashboard.d.ts.map +1 -1
  50. package/types/c8y-ngx-components-datapoint-explorer-view.d.ts +7 -2
  51. package/types/c8y-ngx-components-datapoint-explorer-view.d.ts.map +1 -1
  52. package/types/c8y-ngx-components-datapoint-selector.d.ts +63 -50
  53. package/types/c8y-ngx-components-datapoint-selector.d.ts.map +1 -1
  54. package/types/c8y-ngx-components-echart.d.ts +12 -0
  55. package/types/c8y-ngx-components-echart.d.ts.map +1 -1
  56. package/types/c8y-ngx-components-time-context.d.ts +2 -0
  57. package/types/c8y-ngx-components-time-context.d.ts.map +1 -1
  58. package/types/c8y-ngx-components-widgets-implementations-scada.d.ts.map +1 -1
  59. package/types/c8y-ngx-components.d.ts +10 -1
  60. package/types/c8y-ngx-components.d.ts.map +1 -1
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, SecurityContext, ViewChild, Input, Component, EventEmitter, Output, DestroyRef } from '@angular/core';
3
3
  import { gettext } from '@c8y/ngx-components/gettext';
4
+ import { isEqual, cloneDeep } from 'lodash-es';
4
5
  import { from, merge, interval, BehaviorSubject, of, lastValueFrom, defer, forkJoin } from 'rxjs';
5
6
  import { mergeMap, map, tap, throttleTime, buffer, switchMap } from 'rxjs/operators';
6
7
  import * as i1$1 from '@c8y/ngx-components';
@@ -2402,13 +2403,16 @@ class ChartEventsService {
2402
2403
  pageSize: 1000,
2403
2404
  ...params
2404
2405
  };
2405
- return this.eventService.list(fetchOptions).then(result => {
2406
+ return this.eventService
2407
+ .list(fetchOptions)
2408
+ .then(result => {
2406
2409
  result.data.forEach(iEvent => {
2407
2410
  iEvent['color'] = event.color;
2408
2411
  iEvent['selectedDatapoint'] = event.selectedDatapoint;
2409
2412
  });
2410
2413
  return result.data;
2411
- });
2414
+ })
2415
+ .catch(() => []);
2412
2416
  });
2413
2417
  const result = await Promise.all(promises);
2414
2418
  return result.flat();
@@ -2456,13 +2460,16 @@ class ChartAlarmsService {
2456
2460
  pageSize: 1000,
2457
2461
  ...params
2458
2462
  };
2459
- return this.alarmService.list(fetchOptions).then(result => {
2463
+ return this.alarmService
2464
+ .list(fetchOptions)
2465
+ .then(result => {
2460
2466
  result.data.forEach(iAlarm => {
2461
2467
  iAlarm['color'] = alarm.color;
2462
2468
  iAlarm['selectedDatapoint'] = alarm.selectedDatapoint;
2463
2469
  });
2464
2470
  return result.data;
2465
- });
2471
+ })
2472
+ .catch(() => []);
2466
2473
  });
2467
2474
  const result = await Promise.all(promises);
2468
2475
  return result.flat();
@@ -2700,12 +2707,24 @@ class ChartsComponent {
2700
2707
  */
2701
2708
  this.duplicateAggregationsDetected = new EventEmitter();
2702
2709
  this.CHART_VIEW_CONTEXT = CHART_VIEW_CONTEXT;
2710
+ /**
2711
+ * Aggregation params are serialized verbatim into the query string, so a missing
2712
+ * `aggregationFunction` would reach the platform as the literal string 'undefined' and get the
2713
+ * whole request rejected. Every site that sends one falls back to 'avg', matching the default
2714
+ * the chart renders with (see `EchartsOptionsService.getSingleSeries`).
2715
+ */
2703
2716
  this.AGGREGATION_INTERVAL_MAP = {
2704
2717
  [aggregationType.MINUTELY]: '1m',
2705
2718
  [aggregationType.HOURLY]: '60m',
2706
2719
  [aggregationType.DAILY]: '1d'
2707
2720
  };
2708
2721
  this.configChangedSubject = new BehaviorSubject(null);
2722
+ /**
2723
+ * Deep copy of the config the last reload ran with; content-identical rebuilds are skipped.
2724
+ * A copy, not a reference: the chart mutates datapoints in place (e.g. backfills `unit`), and a
2725
+ * stored reference would mutate along with the config and always compare as unchanged.
2726
+ */
2727
+ this.lastConfig = null;
2709
2728
  /** Series names hidden by the user via per-function legend toggles; re-applied after each setOption. */
2710
2729
  this.userHiddenSeriesNames = new Set();
2711
2730
  /** DpIds whose per-fn series were stripped to a single series on the last render. */
@@ -2814,6 +2833,8 @@ class ChartsComponent {
2814
2833
  }
2815
2834
  const wasFromZoom = this.isChangeFromZoom;
2816
2835
  this.isChangeFromZoom = false;
2836
+ const configContentChanged = !isEqual(this.config, this.lastConfig);
2837
+ this.lastConfig = cloneDeep(this.config);
2817
2838
  if (wasFromZoom) {
2818
2839
  const currentRange = this.getTimeRange();
2819
2840
  const isWithinLoadedRange = this.loadedTimeRange &&
@@ -2848,6 +2869,12 @@ class ChartsComponent {
2848
2869
  }
2849
2870
  }
2850
2871
  else {
2872
+ // Parent forms rebuild the config object on every valueChanges emission;
2873
+ // a content-identical rebuild must not restart the fetch pipeline.
2874
+ if (!configContentChanged) {
2875
+ this.mediator.isSliderZoomUpdate.set(false);
2876
+ return;
2877
+ }
2851
2878
  // Only reset initialTimeRange if the change is NOT from a slider zoom on another widget
2852
2879
  if (!this.mediator.isSliderZoomUpdate()) {
2853
2880
  this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);
@@ -3499,7 +3526,7 @@ class ChartsComponent {
3499
3526
  aggregationInterval: this.AGGREGATION_INTERVAL_MAP[this.config.aggregation]
3500
3527
  })
3501
3528
  })).pipe(map(res => {
3502
- const values = res.data.values;
3529
+ const values = res.data.values || {};
3503
3530
  if (res.data.truncated && this.config.dateFrom) {
3504
3531
  values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
3505
3532
  }
@@ -3531,7 +3558,7 @@ class ChartsComponent {
3531
3558
  return {};
3532
3559
  if (this.config.showAdvancedChartOptions) {
3533
3560
  return {
3534
- aggregationFunction: dp.renderType ?? 'avg',
3561
+ aggregationFunction: dp.renderType || 'avg',
3535
3562
  aggregationInterval: interval
3536
3563
  };
3537
3564
  }
@@ -3548,11 +3575,11 @@ class ChartsComponent {
3548
3575
  this.config.aggregation &&
3549
3576
  this.config.showAdvancedChartOptions &&
3550
3577
  dp.renderType !== 'area' && {
3551
- aggregationFunction: dp.renderType,
3578
+ aggregationFunction: dp.renderType || 'avg',
3552
3579
  aggregationInterval: this.AGGREGATION_INTERVAL_MAP[this.config.aggregation]
3553
3580
  })
3554
3581
  })).pipe(map(res => {
3555
- const values = res.data.values;
3582
+ const values = res.data.values || {};
3556
3583
  if (res.data.truncated && this.config.dateFrom) {
3557
3584
  values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
3558
3585
  }
@@ -3563,7 +3590,7 @@ class ChartsComponent {
3563
3590
  }
3564
3591
  // If the datapoint already has a unit (e.g. from config), keep it. Otherwise, try to get it from the series response.
3565
3592
  if (!dp.unit) {
3566
- const unitFromSeries = res.data.series[0]?.unit;
3593
+ const unitFromSeries = res.data.series?.[0]?.unit;
3567
3594
  if (unitFromSeries) {
3568
3595
  dp.unit = unitFromSeries;
3569
3596
  }
@@ -3613,7 +3640,7 @@ class ChartsComponent {
3613
3640
  return {};
3614
3641
  if (this.config.showAdvancedChartOptions) {
3615
3642
  return {
3616
- aggregationFunction: aggregatedDatapoint.renderType ?? 'avg',
3643
+ aggregationFunction: aggregatedDatapoint.renderType || 'avg',
3617
3644
  aggregationInterval: interval
3618
3645
  };
3619
3646
  }
@@ -3632,11 +3659,11 @@ class ChartsComponent {
3632
3659
  (this.config.aggregation || customTimeRange) &&
3633
3660
  this.config.showAdvancedChartOptions &&
3634
3661
  aggregatedDatapoint.renderType !== 'area' && {
3635
- aggregationFunction: aggregatedDatapoint.renderType,
3662
+ aggregationFunction: aggregatedDatapoint.renderType || 'avg',
3636
3663
  aggregationInterval: this.AGGREGATION_INTERVAL_MAP[(customTimeRange ? this.getAggregationTypeForTimeRange() : this.config.aggregation)]
3637
3664
  })
3638
3665
  })).pipe(map(res => {
3639
- const values = res.data.values;
3666
+ const values = res.data.values || {};
3640
3667
  if (res.data.truncated && this.config.dateFrom) {
3641
3668
  values[new Date(this.config.dateFrom).toISOString()] = [{ min: null, max: null }];
3642
3669
  }