@nova-ui/dashboards 19.0.3 → 19.0.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.
@@ -7022,8 +7022,10 @@ class PaginatorFeatureAddonService {
7022
7022
  total: 0,
7023
7023
  };
7024
7024
  this.paginatorState = this.defaultPaginatorState;
7025
+ this.reinit$ = new Subject();
7025
7026
  }
7026
7027
  initPaginator(widget) {
7028
+ this.reinit$.next();
7027
7029
  this.widget = widget;
7028
7030
  this.setPaginatorState();
7029
7031
  this.listenPaginatorChanges();
@@ -7067,7 +7069,7 @@ class PaginatorFeatureAddonService {
7067
7069
  }
7068
7070
  // page and total are dynamically set
7069
7071
  this.widget.dataSource.outputsSubject
7070
- .pipe(takeUntil(this.widget.onDestroy$))
7072
+ .pipe(takeUntil(merge(this.reinit$, this.widget.onDestroy$)))
7071
7073
  .subscribe((data) => {
7072
7074
  this.updatePaginatorState({
7073
7075
  total: data.paginator?.total ?? 0,
@@ -7087,7 +7089,7 @@ class PaginatorFeatureAddonService {
7087
7089
  listenPaginatorChanges() {
7088
7090
  this.widget.eventBus
7089
7091
  .getStream(SET_NEXT_PAGE)
7090
- .pipe(takeUntil(this.widget.onDestroy$))
7092
+ .pipe(takeUntil(merge(this.reinit$, this.widget.onDestroy$)))
7091
7093
  .subscribe(({ payload }) => {
7092
7094
  if (!payload) {
7093
7095
  return;
@@ -7127,8 +7129,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
7127
7129
  class SearchFeatureAddonService {
7128
7130
  constructor() {
7129
7131
  this.searchDebounceTime = 500;
7132
+ this.reinit$ = new Subject();
7130
7133
  }
7131
7134
  initWidget(widget) {
7135
+ this.reinit$.next();
7132
7136
  this.widget = widget;
7133
7137
  this.initSearch();
7134
7138
  }
@@ -7137,7 +7141,7 @@ class SearchFeatureAddonService {
7137
7141
  const dsFeaturesChange = this.widget.dataSource?.features?.featuresChanged;
7138
7142
  if (dsFeaturesChange) {
7139
7143
  dsFeaturesChange
7140
- .pipe(takeUntil(this.widget.onDestroy$))
7144
+ .pipe(takeUntil(merge(this.reinit$, this.widget.onDestroy$)))
7141
7145
  .subscribe(() => {
7142
7146
  this.defineSearch();
7143
7147
  });
@@ -7181,7 +7185,7 @@ class SearchFeatureAddonService {
7181
7185
  }
7182
7186
  watchSearchTerm() {
7183
7187
  this.widget.searchTerm$
7184
- .pipe(debounceTime(this.searchDebounceTime), takeUntil(this.widget.onDestroy$))
7188
+ .pipe(debounceTime(this.searchDebounceTime), takeUntil(merge(this.reinit$, this.widget.onDestroy$)))
7185
7189
  .subscribe(() => {
7186
7190
  this.widget.pizzagnaService.setProperty({
7187
7191
  pizzagnaKey: PizzagnaLayer.Configuration,
@@ -7433,8 +7437,12 @@ class TableWidgetComponent {
7433
7437
  // Since removing "hasVirtualScroll" from configuration would cause breaking changes, it is used as primary source of truth
7434
7438
  const newHasVirtualScroll = get(changes, "configuration.currentValue.hasVirtualScroll", true);
7435
7439
  const scrollType = get(changes, "configuration.currentValue.scrollType", ScrollType.virtual);
7436
- this.scrollType = newHasVirtualScroll ? ScrollType.virtual : scrollType;
7437
- this.initPrefetchAddon();
7440
+ const newScrollType = newHasVirtualScroll ? ScrollType.virtual : scrollType;
7441
+ const scrollTypeActuallyChanged = newScrollType !== this.scrollType;
7442
+ this.scrollType = newScrollType;
7443
+ if (scrollTypeActuallyChanged) {
7444
+ this.initPrefetchAddon();
7445
+ }
7438
7446
  if (this.scrollTypeChanged(changes.configuration)) {
7439
7447
  this.dataSource.applyFilters();
7440
7448
  }
@@ -7822,9 +7830,11 @@ class TableWidgetComponent {
7822
7830
  }
7823
7831
  }
7824
7832
  resolveSearch(changes) {
7825
- if (!isEqual(changes.configuration.currentValue
7826
- ?.searchConfiguration, changes.configuration.previousValue
7827
- ?.searchConfiguration)) {
7833
+ const prev = omit(changes.configuration.previousValue
7834
+ ?.searchConfiguration, "searchTerm");
7835
+ const curr = omit(changes.configuration.currentValue
7836
+ ?.searchConfiguration, "searchTerm");
7837
+ if (!isEqual(curr, prev)) {
7828
7838
  this.searchAddon.initWidget(this);
7829
7839
  }
7830
7840
  }
@@ -8152,7 +8162,13 @@ var TimeseriesWidgetProjectType;
8152
8162
  // THE SOFTWARE.
8153
8163
  function metricsSeriesMeasurementsMinMax(series, axisUnits) {
8154
8164
  if (axisUnits === "percent") {
8155
- return { min: 0, max: 100 };
8165
+ const percentMetrics = series.filter((metric) => metric.metricUnits === "percent" && metric.data?.length);
8166
+ const percentMax = percentMetrics.length > 0
8167
+ ? percentMetrics
8168
+ .flatMap((m) => m.data ?? [])
8169
+ .reduce((acc, measurement) => Math.max(acc, measurement.y), 0)
8170
+ : 0;
8171
+ return { min: 0, max: Math.max(100, percentMax) };
8156
8172
  }
8157
8173
  // skips percent measurements as they are displayed on the left y-axis and would affect right y-axis domain
8158
8174
  const nonPercentMetrics = series.filter((metric) => metric.metricUnits !== "percent" && metric.data?.length);
@@ -8339,7 +8355,13 @@ class TimeseriesScalesService {
8339
8355
  }
8340
8356
  if (scaleConfig.properties?.axisUnits === "percent" &&
8341
8357
  scale.setFixDomainValues) {
8342
- scale.setFixDomainValues([0, 25, 50, 75, 100]);
8358
+ const domainMax = scaleConfig.properties?.domain?.max ?? 100;
8359
+ const upperBound = Math.max(100, Math.ceil(domainMax / 25) * 25);
8360
+ const points = [];
8361
+ for (let i = 0; i <= upperBound; i += 25) {
8362
+ points.push(i);
8363
+ }
8364
+ scale.setFixDomainValues(points);
8343
8365
  }
8344
8366
  if (scaleConfig.properties?.axisUnits !== "percent" &&
8345
8367
  scaleConfig.properties?.domain &&