@c8y/ngx-components 1022.4.15 → 1022.4.17
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.
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +20 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/locales/zh_TW.po +2 -1
- package/package.json +1 -1
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +5 -2
- package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, inject, Output, Input, ChangeDetectionStrategy, Component, Pipe, ViewChild, Directive, signal } from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, inject, Output, Input, ChangeDetectionStrategy, Component, Pipe, ViewChild, Directive, signal, Optional } from '@angular/core';
|
|
3
3
|
import * as i3 from '@angular/forms';
|
|
4
4
|
import { ControlContainer, ReactiveFormsModule, FormControl, Validators } from '@angular/forms';
|
|
5
5
|
import * as i1$1 from '@c8y/ngx-components';
|
|
@@ -1549,7 +1549,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1549
1549
|
}] } });
|
|
1550
1550
|
|
|
1551
1551
|
class DatapointsTableViewWidgetComponent {
|
|
1552
|
-
constructor(alertService, dataFetchingService, datapointsTableConfigService, datapointsTableViewService, formBuilder, translateService, widgetGlobalAutoRefresh) {
|
|
1552
|
+
constructor(alertService, dataFetchingService, datapointsTableConfigService, datapointsTableViewService, formBuilder, translateService, widgetGlobalAutoRefresh, dashboardContextComponent) {
|
|
1553
1553
|
this.alertService = alertService;
|
|
1554
1554
|
this.dataFetchingService = dataFetchingService;
|
|
1555
1555
|
this.datapointsTableConfigService = datapointsTableConfigService;
|
|
@@ -1557,6 +1557,7 @@ class DatapointsTableViewWidgetComponent {
|
|
|
1557
1557
|
this.formBuilder = formBuilder;
|
|
1558
1558
|
this.translateService = translateService;
|
|
1559
1559
|
this.widgetGlobalAutoRefresh = widgetGlobalAutoRefresh;
|
|
1560
|
+
this.dashboardContextComponent = dashboardContextComponent;
|
|
1560
1561
|
/**
|
|
1561
1562
|
* Represents the data points where __active property is set to true.
|
|
1562
1563
|
*/
|
|
@@ -1723,6 +1724,9 @@ class DatapointsTableViewWidgetComponent {
|
|
|
1723
1724
|
async prepareTableData(roundSeconds = true) {
|
|
1724
1725
|
this.isLoading$.next(true);
|
|
1725
1726
|
if (this.isInitialRequest) {
|
|
1727
|
+
if (this.config.datapoints?.length) {
|
|
1728
|
+
this.config.datapoints.forEach(datapoint => this.assignContextFromContextDashboard(datapoint));
|
|
1729
|
+
}
|
|
1726
1730
|
this.activeDatapoints = this.datapointsTableViewService.filterOutInactiveDatapoints(this.config.datapoints);
|
|
1727
1731
|
this.hasMultipleDatapoints = this.datapointsTableViewService.hasMultipleDatapoints(this.activeDatapoints);
|
|
1728
1732
|
this.devicesColumnHeaders = this.datapointsTableViewService.getColumnHeaders(this.activeDatapoints);
|
|
@@ -1833,7 +1837,17 @@ class DatapointsTableViewWidgetComponent {
|
|
|
1833
1837
|
this.exportConfig.dateFrom = this.config.dateFrom;
|
|
1834
1838
|
this.exportConfig.dateTo = this.config.dateTo;
|
|
1835
1839
|
}
|
|
1836
|
-
|
|
1840
|
+
assignContextFromContextDashboard(datapoint) {
|
|
1841
|
+
if (!this.dashboardContextComponent?.isDeviceTypeDashboard) {
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
const context = this.dashboardContextComponent?.context;
|
|
1845
|
+
if (context?.id) {
|
|
1846
|
+
const { name, id } = context;
|
|
1847
|
+
datapoint.__target = { name, id };
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DatapointsTableViewWidgetComponent, deps: [{ token: i1$1.AlertService }, { token: i1.DataFetchingService }, { token: DatapointsTableService }, { token: DatapointsTableViewService }, { token: i3.FormBuilder }, { token: i1$2.TranslateService }, { token: i1$1.WidgetGlobalAutoRefreshService }, { token: i4.ContextDashboardComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1837
1851
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DatapointsTableViewWidgetComponent, isStandalone: true, selector: "c8y-datapoints-table-view", inputs: { config: "config" }, host: { classAttribute: "d-col fit-h" }, ngImport: i0, template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isRefreshDisabled]=\"isRefreshDisabled\"\n [isLoading]=\"isLoading$\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n [widgetInstanceGlobalAutoRefreshContext]=\"config.widgetInstanceGlobalAutoRefreshContext\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [containerClass]=\"containerClass\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading$ | async\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: DatapointsExportSelectorComponent, selector: "c8y-datapoints-export-selector", inputs: ["containerClass", "exportConfig"], outputs: ["isOpen"] }, { kind: "component", type: DatapointsReloadComponent, selector: "c8y-datapoints-reload", inputs: ["isAutoRefreshEnabled", "isRefreshDisabled", "isLoading", "isScrolling", "isExportModalOpen", "refreshInterval", "widgetInstanceGlobalAutoRefreshContext"], outputs: ["onCountdownEnded"] }, { kind: "component", type: DatapointsTableComponent, selector: "c8y-datapoints-table", inputs: ["aggregationType", "datapointsTableItems", "devicesColumnHeaders", "decimalPlaces", "hasMultipleDatapoints", "isLoading", "seriesWithoutPermissionToReadCount"], outputs: ["isScrolling"] }, { kind: "component", type: DateRangePickerComponent, selector: "c8y-date-range-picker", inputs: ["isEmittingDateChange", "showLabel"], outputs: ["updatedDate"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
|
|
1838
1852
|
}
|
|
1839
1853
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DatapointsTableViewWidgetComponent, decorators: [{
|
|
@@ -1846,7 +1860,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1846
1860
|
DateRangePickerComponent,
|
|
1847
1861
|
ReactiveFormsModule
|
|
1848
1862
|
], template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isRefreshDisabled]=\"isRefreshDisabled\"\n [isLoading]=\"isLoading$\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n [widgetInstanceGlobalAutoRefreshContext]=\"config.widgetInstanceGlobalAutoRefreshContext\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [containerClass]=\"containerClass\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading$ | async\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n" }]
|
|
1849
|
-
}], ctorParameters: () => [{ type: i1$1.AlertService }, { type: i1.DataFetchingService }, { type: DatapointsTableService }, { type: DatapointsTableViewService }, { type: i3.FormBuilder }, { type: i1$2.TranslateService }, { type: i1$1.WidgetGlobalAutoRefreshService }
|
|
1863
|
+
}], ctorParameters: () => [{ type: i1$1.AlertService }, { type: i1.DataFetchingService }, { type: DatapointsTableService }, { type: DatapointsTableViewService }, { type: i3.FormBuilder }, { type: i1$2.TranslateService }, { type: i1$1.WidgetGlobalAutoRefreshService }, { type: i4.ContextDashboardComponent, decorators: [{
|
|
1864
|
+
type: Optional
|
|
1865
|
+
}] }], propDecorators: { config: [{
|
|
1850
1866
|
type: Input
|
|
1851
1867
|
}] } });
|
|
1852
1868
|
|