@c8y/ngx-components 1023.65.2 → 1023.66.3

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 (35) hide show
  1. package/context-dashboard/index.d.ts.map +1 -1
  2. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +4 -0
  3. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  4. package/fesm2022/c8y-ngx-components-global-context.mjs +38 -9
  5. package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
  6. package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs +11 -0
  7. package/fesm2022/c8y-ngx-components-widgets-definitions-kpi.mjs.map +1 -1
  8. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +2 -2
  9. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
  10. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs +2 -2
  11. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-list.mjs.map +1 -1
  12. package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +245 -142
  13. package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs.map +1 -1
  14. package/global-context/index.d.ts +4 -1
  15. package/global-context/index.d.ts.map +1 -1
  16. package/index.d.ts +2 -0
  17. package/index.d.ts.map +1 -1
  18. package/locales/de.po +6 -0
  19. package/locales/es.po +6 -0
  20. package/locales/fr.po +6 -0
  21. package/locales/ja_JP.po +6 -0
  22. package/locales/ko.po +6 -0
  23. package/locales/locales.pot +6 -0
  24. package/locales/nl.po +6 -0
  25. package/locales/pl.po +6 -0
  26. package/locales/pt_BR.po +6 -0
  27. package/locales/zh_CN.po +6 -0
  28. package/locales/zh_TW.po +6 -0
  29. package/package.json +1 -1
  30. package/widgets/definitions/kpi/index.d.ts +1 -0
  31. package/widgets/definitions/kpi/index.d.ts.map +1 -1
  32. package/widgets/implementations/alarms/index.d.ts +2 -0
  33. package/widgets/implementations/alarms/index.d.ts.map +1 -1
  34. package/widgets/implementations/kpi/index.d.ts +75 -52
  35. package/widgets/implementations/kpi/index.d.ts.map +1 -1
@@ -10849,6 +10849,8 @@ const PRESET_NAME = {
10849
10849
  HISTORY_ONLY: 'historyOnly',
10850
10850
  ALARM_LIST_CONFIG: 'alarmListConfig',
10851
10851
  ALARM_LIST_LEGACY: 'alarmListLegacy',
10852
+ KPI: 'kpi',
10853
+ KPI_CONFIG: 'kpiConfig',
10852
10854
  DATA_POINTS_LIST: 'dataPointsList',
10853
10855
  DATA_POINTS_LIST_CONFIG: 'dataPointsListConfig'
10854
10856
  };
@@ -10947,6 +10949,18 @@ const CONTROL_PRESETS = {
10947
10949
  CONTEXT_FEATURE.AUTO_REFRESH
10948
10950
  ]
10949
10951
  },
10952
+ /** For KPI widget in view mode (live/history, no aggregation) */
10953
+ [PRESET_NAME.KPI]: {
10954
+ dashboard: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
10955
+ config: [CONTEXT_FEATURE.AUTO_REFRESH],
10956
+ view_and_config: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH]
10957
+ },
10958
+ /** For KPI widget in config mode (full time controls, no aggregation) */
10959
+ [PRESET_NAME.KPI_CONFIG]: {
10960
+ dashboard: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
10961
+ config: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH],
10962
+ view_and_config: [CONTEXT_FEATURE.HISTORY_TIME, CONTEXT_FEATURE.AUTO_REFRESH]
10963
+ },
10950
10964
  /** For data points list (supports both live and history modes) */
10951
10965
  [PRESET_NAME.DATA_POINTS_LIST]: {
10952
10966
  dashboard: [
@@ -11124,8 +11138,14 @@ class ConfigModeControls {
11124
11138
  const context = mode === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD
11125
11139
  ? this.getGlobalContextState(mode)
11126
11140
  : { ...cfg, isGlobalContextReady: true };
11141
+ const diff = this.globalContextUtils.getChangedFields(cfg, context);
11127
11142
  this.lastEmittedContext.set(context);
11128
- this.configChange.emit({ context, diff: context });
11143
+ // isGlobalContextReady is a transient runtime flag, not a substantive config change.
11144
+ // Don't trigger an emission solely because it was added.
11145
+ const { isGlobalContextReady: _, ...substantiveDiff } = diff;
11146
+ if (Object.keys(substantiveDiff).length > 0) {
11147
+ this.configChange.emit({ context, diff });
11148
+ }
11129
11149
  }
11130
11150
  emitForDisplayMode(mode) {
11131
11151
  if (mode === GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD) {
@@ -11268,6 +11288,7 @@ class ContextControlsComponent {
11268
11288
  this.displayMode = input(GLOBAL_CONTEXT_DISPLAY_MODE.DASHBOARD, ...(ngDevMode ? [{ debugName: "displayMode" }] : []));
11269
11289
  this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
11270
11290
  this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
11291
+ this.emitRefresh = input(true, ...(ngDevMode ? [{ debugName: "emitRefresh" }] : []));
11271
11292
  this.configChange = output();
11272
11293
  this.refresh = output();
11273
11294
  this.lastEmittedState = signal({}, ...(ngDevMode ? [{ debugName: "lastEmittedState" }] : []));
@@ -11308,6 +11329,11 @@ class ContextControlsComponent {
11308
11329
  this.syncConfigToForm();
11309
11330
  this.subscribeToFormChanges();
11310
11331
  }
11332
+ onAutoRefresh() {
11333
+ if (this.emitRefresh()) {
11334
+ this.onRefresh();
11335
+ }
11336
+ }
11311
11337
  onRefresh() {
11312
11338
  const { dateTimeContext } = this.config();
11313
11339
  if (!dateTimeContext) {
@@ -11371,7 +11397,7 @@ class ContextControlsComponent {
11371
11397
  return [from, to];
11372
11398
  }
11373
11399
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: ContextControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11374
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: ContextControlsComponent, isStandalone: true, selector: "c8y-context-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, ngImport: i0, template: `
11400
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: ContextControlsComponent, isStandalone: true, selector: "c8y-context-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, emitRefresh: { classPropertyName: "emitRefresh", publicName: "emitRefresh", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, ngImport: i0, template: `
11375
11401
  <form
11376
11402
  class="d-flex gap-16 p-l-16 p-r-16 p-b-8 inner-scroll h-auto min-width-0 widget-controls"
11377
11403
  [formGroup]="form"
@@ -11391,7 +11417,7 @@ class ContextControlsComponent {
11391
11417
  formControlName="isAutoRefreshEnabled"
11392
11418
  [autoRefreshSeconds]="autoRefreshSeconds()"
11393
11419
  [isLoading]="isLoading()"
11394
- (refresh)="onRefresh()"
11420
+ (refresh)="onAutoRefresh()"
11395
11421
  >
11396
11422
  </c8y-auto-refresh-control>
11397
11423
  }
@@ -11461,7 +11487,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
11461
11487
  formControlName="isAutoRefreshEnabled"
11462
11488
  [autoRefreshSeconds]="autoRefreshSeconds()"
11463
11489
  [isLoading]="isLoading()"
11464
- (refresh)="onRefresh()"
11490
+ (refresh)="onAutoRefresh()"
11465
11491
  >
11466
11492
  </c8y-auto-refresh-control>
11467
11493
  }
@@ -11497,7 +11523,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
11497
11523
  </form>
11498
11524
  `
11499
11525
  }]
11500
- }], ctorParameters: () => [], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
11526
+ }], ctorParameters: () => [], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], emitRefresh: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitRefresh", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
11501
11527
 
11502
11528
  // Map preset controls to state keys
11503
11529
  const CONTROL_DISPLAY_CONFIG = {
@@ -11814,7 +11840,7 @@ class GlobalContextConnectorComponent {
11814
11840
  (refresh)="onLocalRefresh()"
11815
11841
  ></c8y-context-controls>
11816
11842
  }
11817
- `, isInline: true, dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading"], outputs: ["configChange", "refresh"] }, { kind: "component", type: LinkButtonsComponent, selector: "c8y-link-buttons", inputs: ["dashboardChild", "isLinked", "controls", "config"], outputs: ["toggle"] }] }); }
11843
+ `, isInline: true, dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading", "emitRefresh"], outputs: ["configChange", "refresh"] }, { kind: "component", type: LinkButtonsComponent, selector: "c8y-link-buttons", inputs: ["dashboardChild", "isLinked", "controls", "config"], outputs: ["toggle"] }] }); }
11818
11844
  }
11819
11845
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: GlobalContextConnectorComponent, decorators: [{
11820
11846
  type: Component,
@@ -11852,22 +11878,24 @@ class LocalControlsComponent {
11852
11878
  this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
11853
11879
  this.isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
11854
11880
  this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
11881
+ this.emitRefresh = input(true, ...(ngDevMode ? [{ debugName: "emitRefresh" }] : []));
11855
11882
  this.configChange = output();
11856
11883
  this.refresh = output();
11857
11884
  }
11858
11885
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: LocalControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11859
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.18", type: LocalControlsComponent, isStandalone: true, selector: "c8y-local-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, host: { attributes: { "data-local-controls": "true" }, properties: { "class.disabled": "disabled()" } }, ngImport: i0, template: `
11886
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.18", type: LocalControlsComponent, isStandalone: true, selector: "c8y-local-controls", inputs: { controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, emitRefresh: { classPropertyName: "emitRefresh", publicName: "emitRefresh", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", refresh: "refresh" }, host: { attributes: { "data-local-controls": "true" }, properties: { "class.disabled": "disabled()" } }, ngImport: i0, template: `
11860
11887
  <div [class.disabled-overlay]="disabled()">
11861
11888
  <c8y-context-controls
11862
11889
  [controls]="controls()"
11863
11890
  [displayMode]="displayMode()"
11864
11891
  [config]="config()"
11865
11892
  [isLoading]="isLoading()"
11893
+ [emitRefresh]="emitRefresh()"
11866
11894
  (configChange)="configChange.emit($event)"
11867
11895
  (refresh)="refresh.emit()"
11868
11896
  ></c8y-context-controls>
11869
11897
  </div>
11870
- `, isInline: true, styles: [".disabled-overlay{position:relative;cursor:not-allowed}.disabled-overlay:after{content:\"\";position:absolute;inset:0;z-index:10}\n"], dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading"], outputs: ["configChange", "refresh"] }] }); }
11898
+ `, isInline: true, styles: [".disabled-overlay{position:relative;cursor:not-allowed}.disabled-overlay:after{content:\"\";position:absolute;inset:0;z-index:10}\n"], dependencies: [{ kind: "component", type: ContextControlsComponent, selector: "c8y-context-controls", inputs: ["controls", "displayMode", "config", "isLoading", "emitRefresh"], outputs: ["configChange", "refresh"] }] }); }
11871
11899
  }
11872
11900
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: LocalControlsComponent, decorators: [{
11873
11901
  type: Component,
@@ -11881,12 +11909,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
11881
11909
  [displayMode]="displayMode()"
11882
11910
  [config]="config()"
11883
11911
  [isLoading]="isLoading()"
11912
+ [emitRefresh]="emitRefresh()"
11884
11913
  (configChange)="configChange.emit($event)"
11885
11914
  (refresh)="refresh.emit()"
11886
11915
  ></c8y-context-controls>
11887
11916
  </div>
11888
11917
  `, styles: [".disabled-overlay{position:relative;cursor:not-allowed}.disabled-overlay:after{content:\"\";position:absolute;inset:0;z-index:10}\n"] }]
11889
- }], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
11918
+ }], propDecorators: { controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], emitRefresh: [{ type: i0.Input, args: [{ isSignal: true, alias: "emitRefresh", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }] } });
11890
11919
 
11891
11920
  /** @deprecated Use LocalControlsComponent or GlobalContextConnectorComponent instead */
11892
11921