@c8y/ngx-components 1023.88.4 → 1023.92.0
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/auth-configuration/index.d.ts +19 -1
- package/auth-configuration/index.d.ts.map +1 -1
- package/context-dashboard/index.d.ts +4 -4
- package/context-dashboard/index.d.ts.map +1 -1
- package/echart/index.d.ts +1 -1
- package/echart/models/index.d.ts +1 -1
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs +73 -7
- package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs +21 -7
- package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs +1 -1
- package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +494 -359
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs +1 -2
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-alarm-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs +1 -2
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-all-critical-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-recent-alarms.mjs +1 -2
- package/fesm2022/c8y-ngx-components-widgets-definitions-alarms-recent-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +1 -2
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-list.mjs +0 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs +0 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs +2 -89
- package/fesm2022/c8y-ngx-components-widgets-definitions-event-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs +0 -1
- package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +6 -9
- package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs +4 -4
- package/fesm2022/c8y-ngx-components-widgets-implementations-events.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +2 -2
- package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +39 -16
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts +59 -31
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +29 -6
- package/index.d.ts.map +1 -1
- package/locales/de.po +74 -19
- package/locales/es.po +74 -19
- package/locales/fr.po +74 -19
- package/locales/ja_JP.po +66 -18
- package/locales/ko.po +74 -19
- package/locales/locales.pot +74 -13
- package/locales/nl.po +74 -19
- package/locales/pl.po +74 -19
- package/locales/pt_BR.po +74 -19
- package/locales/zh_CN.po +74 -19
- package/locales/zh_TW.po +74 -19
- package/package.json +1 -1
- package/widgets/definitions/alarms/alarm-list/index.d.ts +0 -1
- package/widgets/definitions/alarms/alarm-list/index.d.ts.map +1 -1
- package/widgets/definitions/alarms/all-critical-alarms/index.d.ts +0 -1
- package/widgets/definitions/alarms/all-critical-alarms/index.d.ts.map +1 -1
- package/widgets/definitions/alarms/recent-alarms/index.d.ts +0 -1
- package/widgets/definitions/alarms/recent-alarms/index.d.ts.map +1 -1
- package/widgets/definitions/datapoints-list/index.d.ts +0 -1
- package/widgets/definitions/datapoints-list/index.d.ts.map +1 -1
- package/widgets/definitions/datapoints-table/index.d.ts +0 -1
- package/widgets/definitions/datapoints-table/index.d.ts.map +1 -1
- package/widgets/definitions/kpi/index.d.ts +0 -1
- package/widgets/definitions/kpi/index.d.ts.map +1 -1
- package/widgets/implementations/alarms/index.d.ts +5 -8
- package/widgets/implementations/alarms/index.d.ts.map +1 -1
- package/widgets/implementations/html-widget/index.d.ts +4 -6
- package/widgets/implementations/html-widget/index.d.ts.map +1 -1
|
@@ -2470,11 +2470,11 @@ class WidgetPreviewComponent {
|
|
|
2470
2470
|
return this.widgetConfig?.mo.c8y_Dashboard.translateWidgetTitle ?? false;
|
|
2471
2471
|
}
|
|
2472
2472
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WidgetPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2473
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: WidgetPreviewComponent, isStandalone: true, selector: "c8y-widget-preview", inputs: { previewClasses: "previewClasses" }, host: { classAttribute: "flex-grow d-flex d-col" }, ngImport: i0, template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n
|
|
2473
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: WidgetPreviewComponent, isStandalone: true, selector: "c8y-widget-preview", inputs: { previewClasses: "previewClasses" }, host: { classAttribute: "flex-grow d-flex d-col" }, ngImport: i0, template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n @let widgetTitle =\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span>\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n </c8y-dashboard>\n</fieldset>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: i2.DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "component", type: i2.DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "gap", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: i2.DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: i2.DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] }); }
|
|
2474
2474
|
}
|
|
2475
2475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: WidgetPreviewComponent, decorators: [{
|
|
2476
2476
|
type: Component,
|
|
2477
|
-
args: [{ selector: 'c8y-widget-preview', host: { class: 'flex-grow d-flex d-col' }, standalone: true, imports: [NgClass, C8yTranslatePipe, CommonModule, CoreModule], template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n
|
|
2477
|
+
args: [{ selector: 'c8y-widget-preview', host: { class: 'flex-grow d-flex d-col' }, standalone: true, imports: [NgClass, C8yTranslatePipe, CommonModule, CoreModule], template: "<fieldset class=\"c8y-fieldset p-l-24 p-r-24 p-t-16 p-b-16 flex-grow d-flex d-col min-height-0\">\n <legend>{{ 'Preview' | translate }}</legend>\n <c8y-dashboard\n class=\"dashboard-preview-slot flex-grow min-height-0\"\n [columns]=\"1\"\n [ngClass]=\"previewClasses\"\n >\n <c8y-dashboard-child\n [isFrozen]=\"true\"\n [width]=\"1\"\n [height]=\"6\"\n >\n @let widgetTitle =\n (widgetConfigService.selected$ | async)?.data?.title\n | translate: { noTranslateRemoveContext: !translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span>\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n\n @if ((widgetConfigService.previewViewState$ | async) === 'noPreview') {\n <div class=\"fit-h d-flex d-col j-c-center a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'visibility-off'\"\n [title]=\"'No preview available.' | translate\"\n [subtitle]=\"'This widget does not provide any preview.' | translate\"\n [horizontal]=\"false\"\n ></c8y-ui-empty-state>\n </div>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'configPreview') {\n <c8y-dynamic-component\n [componentId]=\"(widgetConfigService.selected$ | async)?.id\"\n [config]=\"(widgetConfigService.currentConfig$ | async)?.config\"\n ></c8y-dynamic-component>\n }\n\n @if ((widgetConfigService.previewViewState$ | async) === 'templatePreview') {\n <ng-template [ngTemplateOutlet]=\"widgetConfigService.preview$ | async\"></ng-template>\n }\n </c8y-dashboard-child>\n </c8y-dashboard>\n</fieldset>\n" }]
|
|
2478
2478
|
}], propDecorators: { previewClasses: [{
|
|
2479
2479
|
type: Input
|
|
2480
2480
|
}] } });
|
|
@@ -2491,7 +2491,7 @@ class WidgetService {
|
|
|
2491
2491
|
async getWidgetDefinition(componentId) {
|
|
2492
2492
|
return this.dynamicComponentService.getById(componentId);
|
|
2493
2493
|
}
|
|
2494
|
-
getWidgetDefinitions() {
|
|
2494
|
+
async getWidgetDefinitions(assetMo, dashboardMo) {
|
|
2495
2495
|
const translatedComponents = this.widgets.map(cmp => ({
|
|
2496
2496
|
...cmp,
|
|
2497
2497
|
label: this.translateService.instant(cmp.label)
|
|
@@ -2501,7 +2501,21 @@ class WidgetService {
|
|
|
2501
2501
|
const translatedComponentsWithoutInjector = translatedComponents.map(cmp => omit(cmp, 'injector'));
|
|
2502
2502
|
const filterFn = this.moduleConfig?.widgetFilter ||
|
|
2503
2503
|
(({ data }) => !(data && data.settings && data.settings.noNewWidgets));
|
|
2504
|
-
|
|
2504
|
+
const filtered = cloneDeep(sortBy(translatedComponentsWithoutInjector, 'label').filter(filterFn));
|
|
2505
|
+
const selectableChecks = await Promise.all(filtered.map(async (cmp) => {
|
|
2506
|
+
const isWidgetSelectableFn = cmp.data?.settings?.isWidgetSelectable;
|
|
2507
|
+
if (!isWidgetSelectableFn) {
|
|
2508
|
+
return true;
|
|
2509
|
+
}
|
|
2510
|
+
try {
|
|
2511
|
+
return !!(await isWidgetSelectableFn({ assetMo, dashboardMo }));
|
|
2512
|
+
}
|
|
2513
|
+
catch (e) {
|
|
2514
|
+
console.error(`Error while checking if widget ${cmp.id} is selectable for asset ${assetMo?.id} and dashboard ${dashboardMo?.id}`, e);
|
|
2515
|
+
return false;
|
|
2516
|
+
}
|
|
2517
|
+
}));
|
|
2518
|
+
return filtered.filter((_, i) => selectableChecks[i]);
|
|
2505
2519
|
}
|
|
2506
2520
|
async mapLegacy(widget) {
|
|
2507
2521
|
const cmp = await this.getWidgetDefinition(widget.componentId || widget.name);
|
|
@@ -2587,7 +2601,7 @@ class WidgetConfigComponent {
|
|
|
2587
2601
|
}
|
|
2588
2602
|
}
|
|
2589
2603
|
async ngAfterContentInit() {
|
|
2590
|
-
this.components = this.widgetService.getWidgetDefinitions();
|
|
2604
|
+
this.components = await this.widgetService.getWidgetDefinitions(this.context, this.mo);
|
|
2591
2605
|
if (this.selected) {
|
|
2592
2606
|
this.current = clone(this.selected);
|
|
2593
2607
|
this.select(this.selected, this.isEdit ? 'config' : 'select');
|
|
@@ -4442,7 +4456,7 @@ class GlobalContextSectionComponent {
|
|
|
4442
4456
|
this.widgetConfigService.updateConfig(event.context);
|
|
4443
4457
|
}
|
|
4444
4458
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GlobalContextSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4445
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: GlobalContextSectionComponent, isStandalone: true, selector: "c8y-global-context-section", inputs: { widgetControls: "widgetControls", controls: "controls" }, ngImport: i0, template: "<div>\n @if (useControls) {\n <c8y-config-mode-controls\n [controls]=\"controls\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (configChange)=\"onConfigChange($event)\"\n ></c8y-config-mode-controls>\n } @else if (widgetControls) {\n <c8y-global-context-widget-wrapper\n [widgetControls]=\"widgetControls\"\n [displayMode]=\"'config'\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (globalContextChange)=\"onGlobalContext($event)\"\n ></c8y-global-context-widget-wrapper>\n }\n</div>\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12\">\n @if (widgetConfigService.currentConfig.displayMode === '
|
|
4459
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: GlobalContextSectionComponent, isStandalone: true, selector: "c8y-global-context-section", inputs: { widgetControls: "widgetControls", controls: "controls" }, ngImport: i0, template: "<div>\n @if (useControls) {\n <c8y-config-mode-controls\n [controls]=\"controls\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (configChange)=\"onConfigChange($event)\"\n ></c8y-config-mode-controls>\n } @else if (widgetControls) {\n <c8y-global-context-widget-wrapper\n [widgetControls]=\"widgetControls\"\n [displayMode]=\"'config'\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (globalContextChange)=\"onGlobalContext($event)\"\n ></c8y-global-context-widget-wrapper>\n }\n</div>\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12\">\n @if (widgetConfigService.currentConfig.displayMode === 'dashboard') {\n <span\n [title]=\"'The widget is bound to the global time context.' | translate\"\n translate\n >\n Dashboard\n </span>\n }\n @if (\n widgetConfigService.currentConfig.displayMode === 'view_and_config' ||\n widgetConfigService.currentConfig.displayMode === 'config'\n ) {\n <span\n [title]=\"'The time context can be configured in the widget view mode.' | translate\"\n translate\n >\n Configuration and widget view\n </span>\n }\n </span>\n</c8y-widget-config-feedback>\n", dependencies: [{ kind: "component", type: GlobalContextWidgetWrapperComponent, selector: "c8y-global-context-widget-wrapper", inputs: ["isLoading", "displayMode", "widgetControls", "controlLinks", "dashboardChildForLegacy", "config", "disableRefreshEmits"], outputs: ["globalContextChange"] }, { kind: "component", type: ConfigModeControlsComponent, selector: "c8y-config-mode-controls", inputs: ["controls", "config"], outputs: ["configChange"] }, { kind: "component", type: WidgetConfigFeedbackComponent, selector: "c8y-widget-config-feedback" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
4446
4460
|
}
|
|
4447
4461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: GlobalContextSectionComponent, decorators: [{
|
|
4448
4462
|
type: Component,
|
|
@@ -4452,7 +4466,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
4452
4466
|
AsyncPipe,
|
|
4453
4467
|
WidgetConfigFeedbackComponent,
|
|
4454
4468
|
C8yTranslatePipe
|
|
4455
|
-
], template: "<div>\n @if (useControls) {\n <c8y-config-mode-controls\n [controls]=\"controls\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (configChange)=\"onConfigChange($event)\"\n ></c8y-config-mode-controls>\n } @else if (widgetControls) {\n <c8y-global-context-widget-wrapper\n [widgetControls]=\"widgetControls\"\n [displayMode]=\"'config'\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (globalContextChange)=\"onGlobalContext($event)\"\n ></c8y-global-context-widget-wrapper>\n }\n</div>\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12\">\n @if (widgetConfigService.currentConfig.displayMode === '
|
|
4469
|
+
], template: "<div>\n @if (useControls) {\n <c8y-config-mode-controls\n [controls]=\"controls\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (configChange)=\"onConfigChange($event)\"\n ></c8y-config-mode-controls>\n } @else if (widgetControls) {\n <c8y-global-context-widget-wrapper\n [widgetControls]=\"widgetControls\"\n [displayMode]=\"'config'\"\n [config]=\"widgetConfigService.currentConfig$ | async\"\n (globalContextChange)=\"onGlobalContext($event)\"\n ></c8y-global-context-widget-wrapper>\n }\n</div>\n\n<c8y-widget-config-feedback>\n <span class=\"tag tag--info chip text-12\">\n @if (widgetConfigService.currentConfig.displayMode === 'dashboard') {\n <span\n [title]=\"'The widget is bound to the global time context.' | translate\"\n translate\n >\n Dashboard\n </span>\n }\n @if (\n widgetConfigService.currentConfig.displayMode === 'view_and_config' ||\n widgetConfigService.currentConfig.displayMode === 'config'\n ) {\n <span\n [title]=\"'The time context can be configured in the widget view mode.' | translate\"\n translate\n >\n Configuration and widget view\n </span>\n }\n </span>\n</c8y-widget-config-feedback>\n" }]
|
|
4456
4470
|
}], propDecorators: { widgetControls: [{
|
|
4457
4471
|
type: Input
|
|
4458
4472
|
}], controls: [{
|