@c8y/ngx-components 1022.16.2 → 1022.26.1

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 (130) hide show
  1. package/asset-properties/asset-properties.model.d.ts +117 -0
  2. package/asset-properties/asset-properties.model.d.ts.map +1 -0
  3. package/asset-properties/asset-properties.service.d.ts +72 -0
  4. package/asset-properties/asset-properties.service.d.ts.map +1 -0
  5. package/asset-properties/asset-property-list/asset-property-action.directive.d.ts +11 -0
  6. package/asset-properties/asset-property-list/asset-property-action.directive.d.ts.map +1 -0
  7. package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts +11 -0
  8. package/asset-properties/asset-property-list/asset-property-icon.pipe.d.ts.map +1 -0
  9. package/asset-properties/asset-property-list/asset-property-list.component.d.ts +195 -0
  10. package/asset-properties/asset-property-list/asset-property-list.component.d.ts.map +1 -0
  11. package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts +17 -0
  12. package/asset-properties/asset-property-list/asset-property-value.pipe.d.ts.map +1 -0
  13. package/asset-properties/asset-property-list/tree-data-source.d.ts +19 -0
  14. package/asset-properties/asset-property-list/tree-data-source.d.ts.map +1 -0
  15. package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts +75 -0
  16. package/asset-properties/asset-property-selector-drawer/asset-property-selector-drawer.component.d.ts.map +1 -0
  17. package/asset-properties/c8y-ngx-components-asset-properties.d.ts.map +1 -0
  18. package/asset-properties/index.d.ts +6 -0
  19. package/asset-properties/index.d.ts.map +1 -0
  20. package/core/asset-property/asset-property.model.d.ts +0 -8
  21. package/core/asset-property/asset-property.model.d.ts.map +1 -1
  22. package/core/authentication/new-password.component.d.ts +3 -2
  23. package/core/authentication/new-password.component.d.ts.map +1 -1
  24. package/core/modal/modal.service.d.ts +1 -0
  25. package/core/modal/modal.service.d.ts.map +1 -1
  26. package/core/user/user-edit-modal.component.d.ts +1 -0
  27. package/core/user/user-edit-modal.component.d.ts.map +1 -1
  28. package/core/user/user-edit.component.d.ts +4 -1
  29. package/core/user/user-edit.component.d.ts.map +1 -1
  30. package/datapoint-explorer/datapoint-explorer.module.d.ts +2 -0
  31. package/datapoint-explorer/datapoint-explorer.module.d.ts.map +1 -1
  32. package/datapoint-explorer/devicemanagement/c8y-ngx-components-datapoint-explorer-devicemanagement.d.ts.map +1 -0
  33. package/datapoint-explorer/devicemanagement/index.d.ts +2 -0
  34. package/datapoint-explorer/devicemanagement/index.d.ts.map +1 -0
  35. package/datapoint-explorer/view/datapoint-explorer.component.d.ts +8 -3
  36. package/datapoint-explorer/view/datapoint-explorer.component.d.ts.map +1 -1
  37. package/datapoint-explorer/view/datapoint-explorer.model.d.ts +8 -0
  38. package/datapoint-explorer/view/datapoint-explorer.model.d.ts.map +1 -0
  39. package/datapoint-explorer/view/index.d.ts +1 -0
  40. package/datapoint-explorer/view/index.d.ts.map +1 -1
  41. package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts +8 -2
  42. package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts.map +1 -1
  43. package/echart/charts.component.d.ts +1 -1
  44. package/echart/charts.component.d.ts.map +1 -1
  45. package/echart/index.d.ts +1 -0
  46. package/echart/index.d.ts.map +1 -1
  47. package/echart/models/datapoints-graph-widget.model.d.ts +13 -0
  48. package/echart/models/datapoints-graph-widget.model.d.ts.map +1 -1
  49. package/echart/services/chart-helpers.service.d.ts +23 -0
  50. package/echart/services/chart-helpers.service.d.ts.map +1 -0
  51. package/echart/services/chart-realtime.service.d.ts +2 -0
  52. package/echart/services/chart-realtime.service.d.ts.map +1 -1
  53. package/echart/services/echarts-options.service.d.ts +5 -5
  54. package/echart/services/echarts-options.service.d.ts.map +1 -1
  55. package/fesm2022/c8y-ngx-components-alarms.mjs +2 -2
  56. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  57. package/fesm2022/c8y-ngx-components-asset-properties.mjs +1573 -0
  58. package/fesm2022/c8y-ngx-components-asset-properties.mjs.map +1 -0
  59. package/fesm2022/c8y-ngx-components-datapoint-explorer-devicemanagement.mjs +38 -0
  60. package/fesm2022/c8y-ngx-components-datapoint-explorer-devicemanagement.mjs.map +1 -0
  61. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +157 -141
  62. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  63. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +1 -1
  64. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs.map +1 -1
  65. package/fesm2022/c8y-ngx-components-device-list.mjs +2 -2
  66. package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
  67. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs +32 -18
  68. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs.map +1 -1
  69. package/fesm2022/c8y-ngx-components-echart-models.mjs +14 -1
  70. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
  71. package/fesm2022/c8y-ngx-components-echart.mjs +141 -46
  72. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  73. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +3 -3
  74. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
  75. package/fesm2022/c8y-ngx-components-time-context.mjs +12 -5
  76. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
  77. package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +2 -2
  78. package/fesm2022/c8y-ngx-components-trusted-certificates.mjs.map +1 -1
  79. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +6 -0
  80. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs.map +1 -1
  81. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +14 -6
  82. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  83. package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +51 -10
  84. package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs.map +1 -1
  85. package/fesm2022/c8y-ngx-components.mjs +1152 -1128
  86. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  87. package/locales/de.po +61 -46
  88. package/locales/es.po +44 -27
  89. package/locales/fr.po +72 -55
  90. package/locales/ja_JP.po +106 -88
  91. package/locales/ko.po +43 -27
  92. package/locales/locales.pot +49 -27
  93. package/locales/nl.po +44 -27
  94. package/locales/pl.po +44 -27
  95. package/locales/pt_BR.po +44 -27
  96. package/locales/zh_CN.po +44 -27
  97. package/locales/zh_TW.po +44 -27
  98. package/package.json +1 -1
  99. package/time-context/index.d.ts +1 -0
  100. package/time-context/index.d.ts.map +1 -1
  101. package/time-context/time-context.component.d.ts +6 -3
  102. package/time-context/time-context.component.d.ts.map +1 -1
  103. package/time-context/time-context.model.d.ts +10 -0
  104. package/time-context/time-context.model.d.ts.map +1 -0
  105. package/time-context/time-context.service.d.ts +2 -6
  106. package/time-context/time-context.service.d.ts.map +1 -1
  107. package/widgets/definitions/html-widget/html-widget-config.factory.d.ts.map +1 -1
  108. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts +2 -0
  109. package/widgets/implementations/datapoints-graph/datapoints-graph-config/datapoints-graph-widget-config.component.d.ts.map +1 -1
  110. package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts +17 -0
  111. package/widgets/implementations/html-widget/html-widget-properties-selector/html-widget-properties-selector.component.d.ts.map +1 -0
  112. package/widgets/implementations/html-widget/html-widget.model.d.ts +2 -2
  113. package/widgets/implementations/html-widget/html-widget.model.d.ts.map +1 -1
  114. package/widgets/implementations/html-widget/index.d.ts +1 -0
  115. package/widgets/implementations/html-widget/index.d.ts.map +1 -1
  116. package/device-parameters/c8y-ngx-components-device-parameters.d.ts.map +0 -1
  117. package/device-parameters/device-parameter-details.component.d.ts +0 -22
  118. package/device-parameters/device-parameter-details.component.d.ts.map +0 -1
  119. package/device-parameters/device-parameter-value.component.d.ts +0 -12
  120. package/device-parameters/device-parameter-value.component.d.ts.map +0 -1
  121. package/device-parameters/device-parameters-list.component.d.ts +0 -23
  122. package/device-parameters/device-parameters-list.component.d.ts.map +0 -1
  123. package/device-parameters/device-parameters-tab.guard.d.ts +0 -11
  124. package/device-parameters/device-parameters-tab.guard.d.ts.map +0 -1
  125. package/device-parameters/index.d.ts +0 -7
  126. package/device-parameters/index.d.ts.map +0 -1
  127. package/device-parameters/parameter-type-cell-renderer.components.d.ts +0 -8
  128. package/device-parameters/parameter-type-cell-renderer.components.d.ts.map +0 -1
  129. package/fesm2022/c8y-ngx-components-device-parameters.mjs +0 -215
  130. package/fesm2022/c8y-ngx-components-device-parameters.mjs.map +0 -1
@@ -20,12 +20,13 @@ class DatapointExplorerService {
20
20
  this.DEFAULT_INTERVAL = 'days';
21
21
  }
22
22
  // Create generic? Based on packages/ngx-components/core/dashboard/wiget-time-context/widget-time-context.component.html
23
- getDefaultContext() {
23
+ getDefaultContext(overrides) {
24
24
  return {
25
- date: this.getDateTimeContextByInterval(this.DEFAULT_INTERVAL),
25
+ date: this.getDateTimeContextByInterval(overrides?.interval ?? this.DEFAULT_INTERVAL),
26
26
  interval: this.DEFAULT_INTERVAL,
27
27
  realtime: false,
28
- aggregation: aggregationType.MINUTELY
28
+ aggregation: aggregationType.MINUTELY,
29
+ ...overrides
29
30
  };
30
31
  }
31
32
  calculateAggregation([dateFrom, dateTo], requestedAggregation) {
@@ -97,6 +98,7 @@ class TimeContextComponent {
97
98
  #destroyRef;
98
99
  constructor(widgetTimeContextDateRangeService) {
99
100
  this.widgetTimeContextDateRangeService = widgetTimeContextDateRangeService;
101
+ this.timeContext = {};
100
102
  this.datapointExplorerService = inject(DatapointExplorerService);
101
103
  this.formBuilder = inject(FormBuilder);
102
104
  this.#destroyRef = inject(DestroyRef);
@@ -108,7 +110,10 @@ class TimeContextComponent {
108
110
  initialValue: this.form.controls.currentDateContextFromDate.value
109
111
  });
110
112
  this.context = model(this.form.value);
111
- const context = this.datapointExplorerService.getDefaultContext();
113
+ }
114
+ ngOnInit() {
115
+ this.form.patchValue(this.datapointExplorerService.getDefaultContext(this.timeContext));
116
+ const context = this.datapointExplorerService.getDefaultContext(this.timeContext);
112
117
  const { disabledAggregations } = this.datapointExplorerService.calculateAggregation(context.date, context.aggregation);
113
118
  this.disabledAggregations = disabledAggregations;
114
119
  this.subscribeToIntervalChange();
@@ -269,7 +274,7 @@ class TimeContextComponent {
269
274
  });
270
275
  }
271
276
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TimeContextComponent, deps: [{ token: i1.WidgetTimeContextDateRangeService }], target: i0.ɵɵFactoryTarget.Component }); }
272
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: TimeContextComponent, isStandalone: true, selector: "c8y-time-context", inputs: { changedDateContext: { classPropertyName: "changedDateContext", publicName: "changedDateContext", isSignal: false, isRequired: false, transformFunction: null }, controlsAvailable: { classPropertyName: "controlsAvailable", publicName: "controlsAvailable", isSignal: false, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { context: "contextChange" }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: BsDropdownDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.DatePipe, name: "c8yDate" }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1.MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "ngmodule", type: BsDatepickerModule }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: IntervalPickerComponent, selector: "c8y-interval-picker", inputs: ["INTERVALS"] }, { kind: "component", type: RealtimeControlComponent, selector: "c8y-realtime-control" }] }); }
277
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.14", type: TimeContextComponent, isStandalone: true, selector: "c8y-time-context", inputs: { changedDateContext: { classPropertyName: "changedDateContext", publicName: "changedDateContext", isSignal: false, isRequired: false, transformFunction: null }, controlsAvailable: { classPropertyName: "controlsAvailable", publicName: "controlsAvailable", isSignal: false, isRequired: false, transformFunction: null }, timeContext: { classPropertyName: "timeContext", publicName: "timeContext", isSignal: false, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { context: "contextChange" }, viewQueries: [{ propertyName: "dropdown", first: true, predicate: BsDropdownDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} \u2014 {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "component", type: i1.ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.DatePipe, name: "c8yDate" }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1.MessageDirective, selector: "c8y-message", inputs: ["name", "text"] }, { kind: "component", type: i1.MessagesComponent, selector: "c8y-messages", inputs: ["show", "defaults", "helpMessage"] }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1.DateTimePickerComponent, selector: "c8y-date-time-picker", inputs: ["minDate", "maxDate", "placeholder", "dateInputFormat", "adaptivePosition", "size", "dateType", "config"], outputs: ["onDateSelected"] }, { kind: "ngmodule", type: BsDatepickerModule }, { kind: "ngmodule", type: DateTimePickerModule }, { kind: "ngmodule", type: BsDropdownModule }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "component", type: AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i5.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "component", type: IntervalPickerComponent, selector: "c8y-interval-picker", inputs: ["INTERVALS"] }, { kind: "component", type: RealtimeControlComponent, selector: "c8y-realtime-control" }] }); }
273
278
  }
274
279
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TimeContextComponent, decorators: [{
275
280
  type: Component,
@@ -287,6 +292,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
287
292
  type: Input
288
293
  }], controlsAvailable: [{
289
294
  type: Input
295
+ }], timeContext: [{
296
+ type: Input
290
297
  }], dropdown: [{
291
298
  type: ViewChild,
292
299
  args: [BsDropdownDirective]
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-time-context.mjs","sources":["../../time-context/time-context.service.ts","../../time-context/time-context.component.ts","../../time-context/time-context.component.html","../../time-context/c8y-ngx-components-time-context.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { aggregationType } from '@c8y/client';\nimport { AGGREGATION_LIMITS, DateTimeContext } from '@c8y/ngx-components';\nimport { Interval, INTERVALS, TimeSpanInMs } from '@c8y/ngx-components/interval-picker';\n\ninterface TimeRangeValidation {\n aggregationType: aggregationType;\n isDisabled: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DatapointExplorerService {\n readonly DEFAULT_INTERVAL: Interval['id'] = 'days';\n\n // Create generic? Based on packages/ngx-components/core/dashboard/wiget-time-context/widget-time-context.component.html\n getDefaultContext() {\n return {\n date: this.getDateTimeContextByInterval(this.DEFAULT_INTERVAL),\n interval: this.DEFAULT_INTERVAL,\n realtime: false,\n aggregation: aggregationType.MINUTELY\n };\n }\n\n calculateAggregation(\n [dateFrom, dateTo]: DateTimeContext,\n requestedAggregation: aggregationType | null\n ): {\n selectedAggregation: aggregationType | null;\n disabledAggregations: Partial<Record<aggregationType, boolean>>;\n } {\n const timeRangeValidations = this.validateTimeRanges([dateFrom, dateTo]);\n const disabledAggregations = this.getDisabledAggregations(timeRangeValidations);\n\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n const isRequestedAggregationValid =\n requestedAggregation === null || !disabledAggregations[requestedAggregation];\n\n const selectedAggregation = isRequestedAggregationValid\n ? requestedAggregation\n : this.determineAggregation(timeRangeInMs);\n\n return {\n selectedAggregation,\n disabledAggregations\n };\n }\n\n getDateTimeContextByInterval(intervalId: Interval['id']): DateTimeContext {\n const interval = INTERVALS.find(({ id }) => id === intervalId);\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - interval.timespanInMs);\n return [dateFrom, dateTo];\n }\n\n private getTimeRangeInMs(dateFrom: Date, dateTo: Date): number {\n return dateTo.valueOf() - dateFrom.valueOf();\n }\n\n private validateTimeRanges([dateFrom, dateTo]: DateTimeContext): TimeRangeValidation[] {\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n return [\n {\n aggregationType: aggregationType.DAILY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.DAY\n },\n {\n aggregationType: aggregationType.HOURLY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.HOUR\n },\n {\n aggregationType: aggregationType.MINUTELY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.MINUTE\n }\n ];\n }\n\n private getDisabledAggregations(\n timeRangeValidations: TimeRangeValidation[]\n ): Partial<Record<aggregationType, boolean>> {\n return timeRangeValidations.reduce(\n (acc, { aggregationType, isDisabled }) => ({\n ...acc,\n [aggregationType]: isDisabled\n }),\n {}\n );\n }\n\n private determineAggregation(timeRangeInMs: number): aggregationType | null {\n if (timeRangeInMs >= AGGREGATION_LIMITS.DAILY_LIMIT) {\n return aggregationType.DAILY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.HOURLY_LIMIT) {\n return aggregationType.HOURLY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.MINUTELY_LIMIT) {\n return aggregationType.MINUTELY;\n }\n return null;\n }\n}\n","import {\n Component,\n DestroyRef,\n inject,\n Input,\n model,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { FormBuilder } from '@angular/forms';\nimport {\n CoreModule,\n DateTimeContext,\n DateTimePickerModule,\n RealtimeControlComponent,\n WidgetTimeContextDateRangeService\n} from '@c8y/ngx-components';\nimport { INTERVAL_TITLES, Interval } from '@c8y/ngx-components/interval-picker';\nimport { AggregationPickerComponent } from '@c8y/ngx-components';\nimport { IntervalPickerComponent } from '@c8y/ngx-components/interval-picker';\nimport { BsDatepickerModule } from 'ngx-bootstrap/datepicker';\nimport { BsDropdownDirective, BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { interval, Subscription } from 'rxjs';\nimport { DatapointExplorerService } from './time-context.service';\n\n@Component({\n selector: 'c8y-time-context',\n templateUrl: './time-context.component.html',\n standalone: true,\n imports: [\n CoreModule,\n BsDatepickerModule,\n DateTimePickerModule,\n BsDropdownModule,\n AggregationPickerComponent,\n TooltipModule,\n IntervalPickerComponent,\n RealtimeControlComponent\n ]\n})\nexport class TimeContextComponent {\n @Input() changedDateContext: {\n dateFrom?: Date;\n dateTo?: Date;\n interval?: Interval['id'];\n realtime?: boolean;\n aggregation?: string;\n };\n @Input() controlsAvailable: any;\n @ViewChild(BsDropdownDirective) dropdown: BsDropdownDirective;\n datapointExplorerService = inject(DatapointExplorerService);\n formBuilder = inject(FormBuilder);\n #destroyRef = inject(DestroyRef);\n\n readonly DATE_FORMAT = 'short';\n readonly INTERVAL_TITLES = INTERVAL_TITLES;\n readonly REALTIME_INTERVAL = 1000;\n form = this.createForm(this.datapointExplorerService.getDefaultContext());\n disabledAggregations;\n\n readonly valuesSignal = toSignal(this.form.controls.currentDateContextFromDate.valueChanges, {\n initialValue: this.form.controls.currentDateContextFromDate.value\n });\n\n context = model(this.form.value);\n\n private realtimeSubscription: Subscription;\n\n constructor(private widgetTimeContextDateRangeService: WidgetTimeContextDateRangeService) {\n const context = this.datapointExplorerService.getDefaultContext();\n const { disabledAggregations } = this.datapointExplorerService.calculateAggregation(\n context.date,\n context.aggregation\n );\n this.disabledAggregations = disabledAggregations;\n\n this.subscribeToIntervalChange();\n this.subscribeToRealtimeChange();\n this.subscribeToAggregationChange();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.changedDateContext && changes.changedDateContext.currentValue) {\n this.update({\n date: [this.changedDateContext.dateFrom, this.changedDateContext.dateTo],\n interval: this.changedDateContext.interval,\n realtime: this.changedDateContext.realtime || false,\n aggregation: this.changedDateContext.aggregation\n });\n if (this.changedDateContext.realtime) {\n this.form.controls.aggregation.disable();\n }\n }\n }\n\n applyDatetimeContext(): void {\n this.update({\n date: [\n new Date(this.form.controls.temporaryUserSelectedFromDate.value),\n new Date(this.form.controls.temporaryUserSelectedToDate.value)\n ],\n interval: 'custom',\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n }\n\n private subscribeToIntervalChange(): void {\n this.form.controls.currentDateContextInterval.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(interval => {\n let date: DateTimeContext;\n this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);\n if (interval === 'custom') {\n date = [\n new Date(this.form.controls.currentDateContextFromDate.value),\n new Date(this.form.controls.currentDateContextToDate.value)\n ];\n } else {\n date = this.datapointExplorerService.getDateTimeContextByInterval(\n interval as Interval['id']\n );\n this.dropdown.isOpen = false;\n }\n this.update({\n date,\n interval,\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n });\n }\n\n private subscribeToRealtimeChange(): void {\n this.form.controls.realtime.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(realtime => {\n this.onRealtimeValueChange(realtime as boolean);\n\n if (realtime) {\n this.startRealtime();\n } else {\n this.stopRealtime();\n }\n });\n }\n\n private subscribeToAggregationChange() {\n this.form.controls.aggregation.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(aggregation => {\n this.update({\n date: [\n new Date(this.form.value.currentDateContextFromDate),\n new Date(this.form.value.currentDateContextToDate)\n ],\n interval: this.form.value.currentDateContextInterval,\n realtime: this.form.value.realtime,\n aggregation\n });\n });\n }\n\n private onRealtimeValueChange(realtime: boolean): void {\n let dateTimeContext: DateTimeContext;\n if (this.form.value.currentDateContextInterval !== 'custom') {\n dateTimeContext = this.datapointExplorerService.getDateTimeContextByInterval(\n this.form.value.currentDateContextInterval as Interval['id']\n );\n } else {\n const currentTimeSpanInMs =\n new Date(this.form.value.currentDateContextToDate).valueOf() -\n new Date(this.form.value.currentDateContextFromDate).valueOf();\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - currentTimeSpanInMs);\n dateTimeContext = [dateFrom, dateTo];\n }\n\n this.update({\n date: dateTimeContext,\n interval: this.form.value.currentDateContextInterval,\n realtime,\n aggregation: null\n });\n }\n\n private startRealtime(): void {\n this.form.controls.temporaryUserSelectedFromDate.disable();\n this.form.controls.temporaryUserSelectedToDate.disable();\n this.form.controls.aggregation.disable();\n\n this.realtimeSubscription = interval(this.REALTIME_INTERVAL)\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => {\n if (!this.form.value.realtime) {\n this.realtimeSubscription.unsubscribe();\n return;\n }\n const newDateFrom = new Date(\n new Date(this.form.value.currentDateContextFromDate).valueOf() + this.REALTIME_INTERVAL\n );\n const newDateTo = new Date(\n new Date(this.form.value.currentDateContextToDate).valueOf() + this.REALTIME_INTERVAL\n );\n this.updateFormValues({\n date: [newDateFrom, newDateTo],\n interval: this.form.value.currentDateContextInterval,\n realtime: true,\n aggregation: null\n });\n });\n }\n\n private stopRealtime(): void {\n this.realtimeSubscription?.unsubscribe();\n this.form?.controls.temporaryUserSelectedFromDate.enable();\n this.form?.controls.temporaryUserSelectedToDate.enable();\n this.form?.controls.aggregation.enable();\n }\n\n private update({ date, interval, realtime, aggregation }): void {\n const { selectedAggregation, disabledAggregations } =\n this.datapointExplorerService.calculateAggregation(date, aggregation);\n this.disabledAggregations = disabledAggregations;\n this.updateFormValues({ date, interval, realtime, aggregation: selectedAggregation });\n }\n\n private createForm(context) {\n return this.formBuilder.group({\n temporaryUserSelectedFromDate: context.date[0].toISOString() as string,\n temporaryUserSelectedToDate: context.date[1].toISOString() as string,\n currentDateContextFromDate: context.date[0].toISOString() as string,\n currentDateContextToDate: context.date[1].toISOString() as string,\n currentDateContextInterval: context.interval || 'custom',\n realtime: context.realtime,\n aggregation: context.aggregation\n });\n }\n\n private updateFormValues({ date, interval, realtime, aggregation }): void {\n const newFormValues = {\n temporaryUserSelectedFromDate: date[0].toISOString() as string,\n temporaryUserSelectedToDate: date[1].toISOString() as string,\n currentDateContextFromDate: date[0].toISOString() as string,\n currentDateContextToDate: date[1].toISOString() as string,\n realtime,\n currentDateContextInterval: interval || 'custom',\n aggregation: aggregation || null\n };\n\n this.context.set(newFormValues);\n this.form.patchValue(newFormValues, {\n emitEvent: false\n });\n }\n}\n","<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAWa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEW,IAAgB,CAAA,gBAAA,GAAmB,MAAM;AAyFnD;;IAtFC,iBAAiB,GAAA;QACf,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAC9D,QAAQ,EAAE,IAAI,CAAC,gBAAgB;AAC/B,YAAA,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,eAAe,CAAC;SAC9B;;AAGH,IAAA,oBAAoB,CAClB,CAAC,QAAQ,EAAE,MAAM,CAAkB,EACnC,oBAA4C,EAAA;AAK5C,QAAA,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,oBAAoB,GAAG,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,CAAC;QAE/E,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC;QAE7D,MAAM,2BAA2B,GAC/B,oBAAoB,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC;QAE9E,MAAM,mBA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A,WAAA,EAAA,IAAA,EAAA,uBAAuB,uFACvB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAEhB,IAAI,EACP,OAAA,EAAA;wBACP,UAAU;wBACV,kBAAkB;wBAClB,oBAAoB;wBACpB,gBAAgB;wBAChB,0BAA0B;wBAC1B,aAAa;wBACb,uBAAuB;wBACvB;AACD,qBAAA,EAAA,QAAA,EAAA,87NAAA,EAAA;sGAGQ,kBAAkB,EAAA,CAAA;sBAA1B;gBAOQ,iBAAiB,EAAA,CAAA;sBAAzB;gBAC+B,QAAQ,EAAA,CAAA;sBAAvC,SAAS;uBAAC,mBAAmB;;;AEnDhC;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-time-context.mjs","sources":["../../time-context/time-context.service.ts","../../time-context/time-context.component.ts","../../time-context/time-context.component.html","../../time-context/c8y-ngx-components-time-context.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { aggregationType } from '@c8y/client';\nimport { AGGREGATION_LIMITS, DateTimeContext } from '@c8y/ngx-components';\nimport { Interval, INTERVALS, TimeSpanInMs } from '@c8y/ngx-components/interval-picker';\nimport { TimeContext } from './time-context.model';\n\ninterface TimeRangeValidation {\n aggregationType: aggregationType;\n isDisabled: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DatapointExplorerService {\n readonly DEFAULT_INTERVAL: Interval['id'] = 'days';\n\n // Create generic? Based on packages/ngx-components/core/dashboard/wiget-time-context/widget-time-context.component.html\n getDefaultContext(overrides?: Partial<TimeContext>): TimeContext {\n return {\n date: this.getDateTimeContextByInterval(overrides?.interval ?? this.DEFAULT_INTERVAL),\n interval: this.DEFAULT_INTERVAL,\n realtime: false,\n aggregation: aggregationType.MINUTELY,\n ...overrides\n };\n }\n\n calculateAggregation(\n [dateFrom, dateTo]: DateTimeContext,\n requestedAggregation: aggregationType | null\n ): {\n selectedAggregation: aggregationType | null;\n disabledAggregations: Partial<Record<aggregationType, boolean>>;\n } {\n const timeRangeValidations = this.validateTimeRanges([dateFrom, dateTo]);\n const disabledAggregations = this.getDisabledAggregations(timeRangeValidations);\n\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n const isRequestedAggregationValid =\n requestedAggregation === null || !disabledAggregations[requestedAggregation];\n\n const selectedAggregation = isRequestedAggregationValid\n ? requestedAggregation\n : this.determineAggregation(timeRangeInMs);\n\n return {\n selectedAggregation,\n disabledAggregations\n };\n }\n\n getDateTimeContextByInterval(intervalId: Interval['id']): DateTimeContext {\n const interval = INTERVALS.find(({ id }) => id === intervalId);\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - interval.timespanInMs);\n return [dateFrom, dateTo];\n }\n\n private getTimeRangeInMs(dateFrom: Date, dateTo: Date): number {\n return dateTo.valueOf() - dateFrom.valueOf();\n }\n\n private validateTimeRanges([dateFrom, dateTo]: DateTimeContext): TimeRangeValidation[] {\n const timeRangeInMs = this.getTimeRangeInMs(dateFrom, dateTo);\n\n return [\n {\n aggregationType: aggregationType.DAILY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.DAY\n },\n {\n aggregationType: aggregationType.HOURLY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.HOUR\n },\n {\n aggregationType: aggregationType.MINUTELY,\n isDisabled: timeRangeInMs <= TimeSpanInMs.MINUTE\n }\n ];\n }\n\n private getDisabledAggregations(\n timeRangeValidations: TimeRangeValidation[]\n ): Partial<Record<aggregationType, boolean>> {\n return timeRangeValidations.reduce(\n (acc, { aggregationType, isDisabled }) => ({\n ...acc,\n [aggregationType]: isDisabled\n }),\n {}\n );\n }\n\n private determineAggregation(timeRangeInMs: number): aggregationType | null {\n if (timeRangeInMs >= AGGREGATION_LIMITS.DAILY_LIMIT) {\n return aggregationType.DAILY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.HOURLY_LIMIT) {\n return aggregationType.HOURLY;\n } else if (timeRangeInMs >= AGGREGATION_LIMITS.MINUTELY_LIMIT) {\n return aggregationType.MINUTELY;\n }\n return null;\n }\n}\n","import {\n Component,\n DestroyRef,\n inject,\n Input,\n model,\n OnInit,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { FormBuilder } from '@angular/forms';\nimport {\n AggregationPickerComponent,\n CoreModule,\n DateTimeContext,\n DateTimePickerModule,\n RealtimeControlComponent,\n WidgetTimeContextDateRangeService\n} from '@c8y/ngx-components';\nimport {\n Interval,\n INTERVAL_TITLES,\n IntervalPickerComponent\n} from '@c8y/ngx-components/interval-picker';\nimport { BsDatepickerModule } from 'ngx-bootstrap/datepicker';\nimport { BsDropdownDirective, BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { interval, Subscription } from 'rxjs';\nimport { TimeContext } from './time-context.model';\nimport { DatapointExplorerService } from './time-context.service';\n\n@Component({\n selector: 'c8y-time-context',\n templateUrl: './time-context.component.html',\n standalone: true,\n imports: [\n CoreModule,\n BsDatepickerModule,\n DateTimePickerModule,\n BsDropdownModule,\n AggregationPickerComponent,\n TooltipModule,\n IntervalPickerComponent,\n RealtimeControlComponent\n ]\n})\nexport class TimeContextComponent implements OnInit {\n @Input() changedDateContext: {\n dateFrom?: Date;\n dateTo?: Date;\n interval?: Interval['id'];\n realtime?: boolean;\n aggregation?: string;\n };\n @Input() controlsAvailable: any;\n @Input() timeContext: Partial<TimeContext> = {};\n @ViewChild(BsDropdownDirective) dropdown: BsDropdownDirective;\n datapointExplorerService = inject(DatapointExplorerService);\n formBuilder = inject(FormBuilder);\n #destroyRef = inject(DestroyRef);\n\n readonly DATE_FORMAT = 'short';\n readonly INTERVAL_TITLES = INTERVAL_TITLES;\n readonly REALTIME_INTERVAL = 1000;\n form = this.createForm(this.datapointExplorerService.getDefaultContext());\n disabledAggregations;\n\n readonly valuesSignal = toSignal(this.form.controls.currentDateContextFromDate.valueChanges, {\n initialValue: this.form.controls.currentDateContextFromDate.value\n });\n\n context = model(this.form.value);\n\n private realtimeSubscription: Subscription;\n\n constructor(private widgetTimeContextDateRangeService: WidgetTimeContextDateRangeService) {}\n\n ngOnInit(): void {\n this.form.patchValue(this.datapointExplorerService.getDefaultContext(this.timeContext));\n const context = this.datapointExplorerService.getDefaultContext(this.timeContext);\n const { disabledAggregations } = this.datapointExplorerService.calculateAggregation(\n context.date,\n context.aggregation\n );\n this.disabledAggregations = disabledAggregations;\n\n this.subscribeToIntervalChange();\n this.subscribeToRealtimeChange();\n this.subscribeToAggregationChange();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.changedDateContext && changes.changedDateContext.currentValue) {\n this.update({\n date: [this.changedDateContext.dateFrom, this.changedDateContext.dateTo],\n interval: this.changedDateContext.interval,\n realtime: this.changedDateContext.realtime || false,\n aggregation: this.changedDateContext.aggregation\n });\n if (this.changedDateContext.realtime) {\n this.form.controls.aggregation.disable();\n }\n }\n }\n\n applyDatetimeContext(): void {\n this.update({\n date: [\n new Date(this.form.controls.temporaryUserSelectedFromDate.value),\n new Date(this.form.controls.temporaryUserSelectedToDate.value)\n ],\n interval: 'custom',\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n }\n\n private subscribeToIntervalChange(): void {\n this.form.controls.currentDateContextInterval.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(interval => {\n let date: DateTimeContext;\n this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);\n if (interval === 'custom') {\n date = [\n new Date(this.form.controls.currentDateContextFromDate.value),\n new Date(this.form.controls.currentDateContextToDate.value)\n ];\n } else {\n date = this.datapointExplorerService.getDateTimeContextByInterval(\n interval as Interval['id']\n );\n this.dropdown.isOpen = false;\n }\n this.update({\n date,\n interval,\n realtime: this.form.value.realtime,\n aggregation: this.form.value.aggregation\n });\n });\n }\n\n private subscribeToRealtimeChange(): void {\n this.form.controls.realtime.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(realtime => {\n this.onRealtimeValueChange(realtime as boolean);\n\n if (realtime) {\n this.startRealtime();\n } else {\n this.stopRealtime();\n }\n });\n }\n\n private subscribeToAggregationChange() {\n this.form.controls.aggregation.valueChanges\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(aggregation => {\n this.update({\n date: [\n new Date(this.form.value.currentDateContextFromDate),\n new Date(this.form.value.currentDateContextToDate)\n ],\n interval: this.form.value.currentDateContextInterval,\n realtime: this.form.value.realtime,\n aggregation\n });\n });\n }\n\n private onRealtimeValueChange(realtime: boolean): void {\n let dateTimeContext: DateTimeContext;\n if (this.form.value.currentDateContextInterval !== 'custom') {\n dateTimeContext = this.datapointExplorerService.getDateTimeContextByInterval(\n this.form.value.currentDateContextInterval as Interval['id']\n );\n } else {\n const currentTimeSpanInMs =\n new Date(this.form.value.currentDateContextToDate).valueOf() -\n new Date(this.form.value.currentDateContextFromDate).valueOf();\n const dateTo = new Date();\n const dateFrom = new Date(dateTo.valueOf() - currentTimeSpanInMs);\n dateTimeContext = [dateFrom, dateTo];\n }\n\n this.update({\n date: dateTimeContext,\n interval: this.form.value.currentDateContextInterval,\n realtime,\n aggregation: null\n });\n }\n\n private startRealtime(): void {\n this.form.controls.temporaryUserSelectedFromDate.disable();\n this.form.controls.temporaryUserSelectedToDate.disable();\n this.form.controls.aggregation.disable();\n\n this.realtimeSubscription = interval(this.REALTIME_INTERVAL)\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => {\n if (!this.form.value.realtime) {\n this.realtimeSubscription.unsubscribe();\n return;\n }\n const newDateFrom = new Date(\n new Date(this.form.value.currentDateContextFromDate).valueOf() + this.REALTIME_INTERVAL\n );\n const newDateTo = new Date(\n new Date(this.form.value.currentDateContextToDate).valueOf() + this.REALTIME_INTERVAL\n );\n this.updateFormValues({\n date: [newDateFrom, newDateTo],\n interval: this.form.value.currentDateContextInterval,\n realtime: true,\n aggregation: null\n });\n });\n }\n\n private stopRealtime(): void {\n this.realtimeSubscription?.unsubscribe();\n this.form?.controls.temporaryUserSelectedFromDate.enable();\n this.form?.controls.temporaryUserSelectedToDate.enable();\n this.form?.controls.aggregation.enable();\n }\n\n private update({ date, interval, realtime, aggregation }): void {\n const { selectedAggregation, disabledAggregations } =\n this.datapointExplorerService.calculateAggregation(date, aggregation);\n this.disabledAggregations = disabledAggregations;\n this.updateFormValues({ date, interval, realtime, aggregation: selectedAggregation });\n }\n\n private createForm(context) {\n return this.formBuilder.group({\n temporaryUserSelectedFromDate: context.date[0].toISOString() as string,\n temporaryUserSelectedToDate: context.date[1].toISOString() as string,\n currentDateContextFromDate: context.date[0].toISOString() as string,\n currentDateContextToDate: context.date[1].toISOString() as string,\n currentDateContextInterval: context.interval || 'custom',\n realtime: context.realtime,\n aggregation: context.aggregation\n });\n }\n\n private updateFormValues({ date, interval, realtime, aggregation }): void {\n const newFormValues = {\n temporaryUserSelectedFromDate: date[0].toISOString() as string,\n temporaryUserSelectedToDate: date[1].toISOString() as string,\n currentDateContextFromDate: date[0].toISOString() as string,\n currentDateContextToDate: date[1].toISOString() as string,\n realtime,\n currentDateContextInterval: interval || 'custom',\n aggregation: aggregation || null\n };\n\n this.context.set(newFormValues);\n this.form.patchValue(newFormValues, {\n emitEvent: false\n });\n }\n}\n","<ng-container *ngIf=\"controlsAvailable; else actionBarTemplate\">\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n</ng-container>\n\n<ng-template #actionBarTemplate>\n <c8y-action-bar-item\n [groupId]=\"'timeContext'\"\n [inGroupPriority]=\"1\"\n [placement]=\"'left'\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n </c8y-action-bar-item>\n</ng-template>\n\n<ng-template\n #dateTimePicker\n let-date=\"date\"\n>\n <form\n class=\"d-flex gap-8 p-l-xs-16 p-r-xs-16 m-t-xs-8 m-b-xs-8\"\n [formGroup]=\"form\"\n >\n <ng-container>\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\n *ngIf=\"date\"\n >\n <button\n class=\"dropdown-toggle form-control l-h-tight d-flex a-i-center\"\n attr.aria-label=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{\n date[1] | c8yDate: DATE_FORMAT\n }}\"\n tooltip=\"{{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\"\n placement=\"top\"\n container=\"body\"\n data-cy=\"widget-time-context--date-picker-dropdown-button\"\n [adaptivePosition]=\"false\"\n [delay]=\"500\"\n dropdownToggle\n >\n <i\n class=\"m-r-4\"\n c8yIcon=\"schedule1\"\n ></i>\n <div class=\"d-col text-left fit-w\">\n <span\n class=\"text-12\"\n data-cy=\"widget-time-context--selected-interval\"\n >\n {{ INTERVAL_TITLES[form.controls.currentDateContextInterval.value] | translate }}\n </span>\n <span\n class=\"text-10 text-muted text-truncate\"\n data-cy=\"widget-time-context--selected-time-range\"\n >\n {{ date[0] | c8yDate: DATE_FORMAT }} — {{ date[1] | c8yDate: DATE_FORMAT }}\n </span>\n </div>\n <span class=\"caret m-r-16 m-l-4\"></span>\n </button>\n\n <ul\n class=\"dropdown-menu dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n <ng-container *ngIf=\"form.controls.currentDateContextInterval.value === 'custom'\">\n <div class=\"p-l-16 p-r-16\">\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'From`date`' | translate\"\n for=\"temporaryUserSelectedFromDate\"\n translate\n >\n From`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedFromDate\"\n [maxDate]=\"form.value.temporaryUserSelectedToDate\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedFromDate.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"'This date is after the latest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n\n <c8y-form-group\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n >\n <label\n [title]=\"'To`date`' | translate\"\n for=\"temporaryUserSelectedToDate\"\n translate\n >\n To`date`\n </label>\n <c8y-date-time-picker\n id=\"temporaryUserSelectedToDate\"\n [minDate]=\"form.value.temporaryUserSelectedFromDate\"\n [placeholder]=\"'To`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedToDate\"\n [ngClass]=\"form.controls.temporaryUserSelectedToDate.errors ? 'has-error' : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"form.controls.temporaryUserSelectedToDate.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"'This date is before the earliest allowed date.' | translate\"\n ></c8y-message>\n <c8y-message\n name=\"invalidDateTime\"\n [text]=\"'This date is invalid.' | translate\"\n ></c8y-message>\n </c8y-messages>\n </c8y-form-group>\n </div>\n\n <div class=\"p-16 d-flex gap-8 separator-top\">\n <button\n class=\"btn btn-default btn-sm flex-grow\"\n title=\"{{ 'Reset' | translate }}\"\n type=\"button\"\n (click)=\"dropdown.isOpen = false\"\n [disabled]=\"form.value.realtime\"\n translate\n >\n Reset\n </button>\n\n <button\n class=\"btn btn-primary btn-sm flex-grow\"\n title=\"{{ 'Apply' | translate }}\"\n type=\"button\"\n (click)=\"applyDatetimeContext(); dropdown.isOpen = false\"\n [disabled]=\"\n (form.pristine && form.untouched) || form.invalid || form.value.realtime\n \"\n translate\n >\n Apply\n </button>\n </div>\n </ng-container>\n </ul>\n </div>\n </ng-container>\n\n <div class=\"input-group w-auto\">\n <c8y-realtime-control\n class=\"form-control p-0 flex-no-grow w-auto\"\n formControlName=\"realtime\"\n ></c8y-realtime-control>\n\n <c8y-aggregation-picker\n *ngIf=\"controlsAvailable ? controlsAvailable.aggregation : true\"\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n </div>\n </form>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAYa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEW,IAAgB,CAAA,gBAAA,GAAmB,MAAM;AA0FnD;;AAvFC,IAAA,iBAAiB,CAAC,SAAgC,EAAA;QAChD,OAAO;AACL,YAAA,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,QAAQ,IAAI,IAAI,CAAC,gBAAgB,CAAC;YACrF,QAAQ,EAAE,IAAI,CAAC,gBAAgB;AAC/B,YAAA,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,eAAe,CAAC,QAAQ;AACrC,YAAA,GAAG;SACJ;;AAGH,IAAA,oBAAoB,CAClB,CAAC,QAAQ,EAAE,MAAM,CAAkB,EACnC,oBAA4C,EAAA;AAK5C,QAAA,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,oBAAoB,GAAG,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,CAAC;QAE/E,MAAM,aAAa,GAAG,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AA,UAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,YAAA,EAAA,OAAA,EAAA,aAAA,EAAA,kBAAA,EAAA,eAAA,EAAA,eAAA,EAAA,qBAAA,EAAA,kBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,EAAA,SAAA,EAAA,UAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,uBAAuB,uFACvB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAEhB,IAAI,EACP,OAAA,EAAA;wBACP,UAAU;wBACV,kBAAkB;wBAClB,oBAAoB;wBACpB,gBAAgB;wBAChB,0BAA0B;wBAC1B,aAAa;wBACb,uBAAuB;wBACvB;AACD,qBAAA,EAAA,QAAA,EAAA,87NAAA,EAAA;sGAGQ,kBAAkB,EAAA,CAAA;sBAA1B;gBAOQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBAC+B,QAAQ,EAAA,CAAA;sBAAvC,SAAS;uBAAC,mBAAmB;;;AEzDhC;;AAEG;;;;"}
@@ -584,12 +584,12 @@ class TrustedCertificateListComponent {
584
584
  result.textClass = 'text-danger';
585
585
  result.tooltipText = gettext('Certificate expires in less than 90 days');
586
586
  }
587
- else if (notAfter < now + oneYear) {
587
+ else if (item.tenantCertificateAuthority && notAfter < now + oneYear) {
588
588
  result.icon = 'warning';
589
589
  result.textClass = 'text-warning';
590
590
  result.tooltipText = gettext('Certificate expires in less than 1 year');
591
591
  }
592
- else if (notAfter < now + oneAndHalfYear) {
592
+ else if (item.tenantCertificateAuthority && notAfter < now + oneAndHalfYear) {
593
593
  result.icon = 'info';
594
594
  result.textClass = 'text-info';
595
595
  result.tooltipText = gettext('Certificate expires in less than 1.5 year');