@c8y/ngx-components 1023.17.16 → 1023.17.19
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/datapoint-explorer/view/index.d.ts +2 -1
- package/datapoint-explorer/view/index.d.ts.map +1 -1
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +7 -2
- package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-global-context.mjs +8 -8
- package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-time-context.mjs +9 -2
- package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +15 -7
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/global-context/index.d.ts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/locales/de.po +20 -20
- package/locales/zh_TW.po +0 -1
- package/package.json +1 -1
- package/time-context/index.d.ts +3 -2
- package/time-context/index.d.ts.map +1 -1
|
@@ -101,6 +101,11 @@ class TimeContextComponent {
|
|
|
101
101
|
constructor(widgetTimeContextDateRangeService) {
|
|
102
102
|
this.widgetTimeContextDateRangeService = widgetTimeContextDateRangeService;
|
|
103
103
|
this.timeContext = {};
|
|
104
|
+
this.timePickerConfig = {
|
|
105
|
+
showMinutes: true,
|
|
106
|
+
showSeconds: false,
|
|
107
|
+
showSpinners: false
|
|
108
|
+
};
|
|
104
109
|
this.datapointExplorerService = inject(DatapointExplorerService);
|
|
105
110
|
this.formBuilder = inject(FormBuilder);
|
|
106
111
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -303,7 +308,7 @@ class TimeContextComponent {
|
|
|
303
308
|
});
|
|
304
309
|
}
|
|
305
310
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TimeContextComponent, deps: [{ token: i1.WidgetTimeContextDateRangeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
306
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", 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: "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: "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: "component", type: i1.AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations"] }, { 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: "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" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i1.DatePipe, name: "c8yDate" }] }); }
|
|
311
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", 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 }, timePickerConfig: { classPropertyName: "timePickerConfig", publicName: "timePickerConfig", 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: "@if (controlsAvailable) {\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n} @else {\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}\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 @if (date) {\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\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-wide dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n @if (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 [config]=\"timePickerConfig\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"\n form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\n \"\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 [config]=\"timePickerConfig\"\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 }\n </ul>\n </div>\n }\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 @if (controlsAvailable ? controlsAvailable.aggregation : true) {\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n }\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: "directive", type: i1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: "component", type: i1.AggregationPickerComponent, selector: "c8y-aggregation-picker", inputs: ["disabledAggregations"] }, { 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: "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" }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i1.DatePipe, name: "c8yDate" }] }); }
|
|
307
312
|
}
|
|
308
313
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TimeContextComponent, decorators: [{
|
|
309
314
|
type: Component,
|
|
@@ -316,13 +321,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
316
321
|
TooltipModule,
|
|
317
322
|
IntervalPickerComponent,
|
|
318
323
|
RealtimeControlComponent
|
|
319
|
-
], template: "
|
|
324
|
+
], template: "@if (controlsAvailable) {\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n} @else {\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}\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 @if (date) {\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\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-wide dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n @if (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 [config]=\"timePickerConfig\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"\n form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\n \"\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 [config]=\"timePickerConfig\"\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 }\n </ul>\n </div>\n }\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 @if (controlsAvailable ? controlsAvailable.aggregation : true) {\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n }\n </div>\n </form>\n</ng-template>\n" }]
|
|
320
325
|
}], ctorParameters: () => [{ type: i1.WidgetTimeContextDateRangeService }], propDecorators: { changedDateContext: [{
|
|
321
326
|
type: Input
|
|
322
327
|
}], controlsAvailable: [{
|
|
323
328
|
type: Input
|
|
324
329
|
}], timeContext: [{
|
|
325
330
|
type: Input
|
|
331
|
+
}], timePickerConfig: [{
|
|
332
|
+
type: Input
|
|
326
333
|
}], dropdown: [{
|
|
327
334
|
type: ViewChild,
|
|
328
335
|
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';\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 WidgetTimeContextDateRangeService\n} from '@c8y/ngx-components';\nimport { RealtimeControlComponent } from '@c8y/ngx-components/global-context';\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// TODO: REMOVE THIS FILE\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 // In realtime mode, ignore updates from parent - the component updates itself via interval\n if (this.changedDateContext.realtime && this.form.value.realtime) {\n return;\n }\n\n // Check if values actually changed (not just object reference)\n const currentFormValues = this.form.value;\n const newDateFrom = this.changedDateContext.dateFrom?.toISOString();\n const newDateTo = this.changedDateContext.dateTo?.toISOString();\n\n const hasActualChanges =\n newDateFrom !== currentFormValues.currentDateContextFromDate ||\n newDateTo !== currentFormValues.currentDateContextToDate ||\n this.changedDateContext.interval !== currentFormValues.currentDateContextInterval ||\n this.changedDateContext.realtime !== currentFormValues.realtime ||\n this.changedDateContext.aggregation !== currentFormValues.aggregation;\n\n if (!hasActualChanges) {\n return;\n }\n\n // Don't emit when update comes from parent (avoid infinite loop)\n this.update(\n {\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 false\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 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 // Update the form value without triggering valueChanges to avoid infinite loop\n if (this.form?.value.realtime) {\n this.form.patchValue({ realtime: false }, { emitEvent: false });\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 // Only reset initialTimeRange for preset intervals, not 'custom'\n // Custom interval is set by user slider interaction, which shouldn't reset the chart\n if (interval !== 'custom') {\n this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);\n }\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 {\n date: [newDateFrom, newDateTo],\n interval: this.form.value.currentDateContextInterval,\n realtime: true,\n aggregation: null\n },\n false\n ); // Don't emit during automatic realtime ticks\n });\n }\n\n private update({ date, interval, realtime, aggregation }, shouldEmit = true): void {\n const { selectedAggregation, disabledAggregations } =\n this.datapointExplorerService.calculateAggregation(date, aggregation);\n this.disabledAggregations = disabledAggregations;\n this.updateFormValues(\n { date, interval, realtime, aggregation: selectedAggregation },\n shouldEmit\n );\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 }, shouldEmit = true): 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 if (shouldEmit) {\n this.context.set(newFormValues);\n }\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,IAAA,CAAA,gBAAgB,GAAmB,MAAM;AA0FnD,IAAA;;AAvFC,IAAA,iBAAiB,CAAC,SAAgC,EAAA;QAChD,OAAO;AACL,YAAA,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,QAAQ,IAAI,IAAI,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AA,CAAA,kBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,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,EACb,uBAAuB,uFACvB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAEhB,IAAI,EAAA,OAAA,EACP;wBACP,UAAU;wBACV,kBAAkB;wBAClB,oBAAoB;wBACpB,gBAAgB;wBAChB,0BAA0B;wBAC1B,aAAa;wBACb,uBAAuB;wBACvB;AACD,qBAAA,EAAA,QAAA,EAAA,87NAAA,EAAA;;sBAGA;;sBAOA;;sBACA;;sBACA,SAAS;uBAAC,mBAAmB;;;AE1DhC;;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 DateAndTimeOptions,\n DateTimeContext,\n DateTimePickerModule,\n WidgetTimeContextDateRangeService\n} from '@c8y/ngx-components';\nimport { RealtimeControlComponent } from '@c8y/ngx-components/global-context';\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// TODO: REMOVE THIS FILE\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 @Input() timePickerConfig: DateAndTimeOptions = {\n showMinutes: true,\n showSeconds: false,\n showSpinners: false\n };\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 // In realtime mode, ignore updates from parent - the component updates itself via interval\n if (this.changedDateContext.realtime && this.form.value.realtime) {\n return;\n }\n\n // Check if values actually changed (not just object reference)\n const currentFormValues = this.form.value;\n const newDateFrom = this.changedDateContext.dateFrom?.toISOString();\n const newDateTo = this.changedDateContext.dateTo?.toISOString();\n\n const hasActualChanges =\n newDateFrom !== currentFormValues.currentDateContextFromDate ||\n newDateTo !== currentFormValues.currentDateContextToDate ||\n this.changedDateContext.interval !== currentFormValues.currentDateContextInterval ||\n this.changedDateContext.realtime !== currentFormValues.realtime ||\n this.changedDateContext.aggregation !== currentFormValues.aggregation;\n\n if (!hasActualChanges) {\n return;\n }\n\n // Don't emit when update comes from parent (avoid infinite loop)\n this.update(\n {\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 false\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 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 // Update the form value without triggering valueChanges to avoid infinite loop\n if (this.form?.value.realtime) {\n this.form.patchValue({ realtime: false }, { emitEvent: false });\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 // Only reset initialTimeRange for preset intervals, not 'custom'\n // Custom interval is set by user slider interaction, which shouldn't reset the chart\n if (interval !== 'custom') {\n this.widgetTimeContextDateRangeService.updateInitialTimeRange(null);\n }\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 {\n date: [newDateFrom, newDateTo],\n interval: this.form.value.currentDateContextInterval,\n realtime: true,\n aggregation: null\n },\n false\n ); // Don't emit during automatic realtime ticks\n });\n }\n\n private update({ date, interval, realtime, aggregation }, shouldEmit = true): void {\n const { selectedAggregation, disabledAggregations } =\n this.datapointExplorerService.calculateAggregation(date, aggregation);\n this.disabledAggregations = disabledAggregations;\n this.updateFormValues(\n { date, interval, realtime, aggregation: selectedAggregation },\n shouldEmit\n );\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 }, shouldEmit = true): 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 if (shouldEmit) {\n this.context.set(newFormValues);\n }\n this.form.patchValue(newFormValues, {\n emitEvent: false\n });\n }\n}\n","@if (controlsAvailable) {\n <ng-container\n [ngTemplateOutlet]=\"dateTimePicker\"\n [ngTemplateOutletContext]=\"{\n date: [form.value.currentDateContextFromDate, form.value.currentDateContextToDate]\n }\"\n ></ng-container>\n} @else {\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}\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 @if (date) {\n <div\n class=\"dropdown flex-grow\"\n #dropdown=\"bs-dropdown\"\n dropdown\n [insideClick]=\"true\"\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-wide dropdown-menu--date-range\"\n *dropdownMenu\n >\n <c8y-interval-picker\n class=\"d-contents\"\n formControlName=\"currentDateContextInterval\"\n ></c8y-interval-picker>\n\n @if (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 [config]=\"timePickerConfig\"\n [placeholder]=\"'From`date`' | translate\"\n [formControl]=\"form.controls.temporaryUserSelectedFromDate\"\n [ngClass]=\"\n form.controls.temporaryUserSelectedFromDate.errors ? 'has-error' : ''\n \"\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 [config]=\"timePickerConfig\"\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 }\n </ul>\n </div>\n }\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 @if (controlsAvailable ? controlsAvailable.aggregation : true) {\n <c8y-aggregation-picker\n formControlName=\"aggregation\"\n [disabledAggregations]=\"disabledAggregations\"\n ></c8y-aggregation-picker>\n }\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,IAAA,CAAA,gBAAgB,GAAmB,MAAM;AA0FnD,IAAA;;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;IACH;AAEA,IAAA,oBAAoB,CAClB,CAAC,QAAQ,EAAE,MAAM,CAAkB,EACnC,oBAA4C,EAAA;AAK5C,QAAA,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,C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A,UAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,uBAAuB,uFACvB,wBAAwB,EAAA,QAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAfhC,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAEhB,IAAI,EAAA,OAAA,EACP;wBACP,UAAU;wBACV,kBAAkB;wBAClB,oBAAoB;wBACpB,gBAAgB;wBAChB,0BAA0B;wBAC1B,aAAa;wBACb,uBAAuB;wBACvB;AACD,qBAAA,EAAA,QAAA,EAAA,kwOAAA,EAAA;;sBAGA;;sBAOA;;sBACA;;sBACA;;sBAKA,SAAS;uBAAC,mBAAmB;;;AEhEhC;;AAEG;;;;"}
|
|
@@ -3273,9 +3273,19 @@ class C8yTranslationCache {
|
|
|
3273
3273
|
: this.getTranslationsForPlugins(lang))
|
|
3274
3274
|
]).pipe(map(([appTranslations, userDefinedTranslations, langsDetails, pluginTranslations]) => {
|
|
3275
3275
|
const translationsFromBranding = (langsDetails && langsDetails[lang]) || {};
|
|
3276
|
+
// if loading translations for a specific plugin, plugin translations have higher priority than app translations
|
|
3277
|
+
if (pluginContextPath) {
|
|
3278
|
+
return {
|
|
3279
|
+
...appTranslations,
|
|
3280
|
+
...pluginTranslations,
|
|
3281
|
+
...translationsFromBranding,
|
|
3282
|
+
...userDefinedTranslations
|
|
3283
|
+
};
|
|
3284
|
+
}
|
|
3285
|
+
// otherwise, app translations should override plugin translations
|
|
3276
3286
|
return {
|
|
3277
|
-
...appTranslations,
|
|
3278
3287
|
...pluginTranslations,
|
|
3288
|
+
...appTranslations,
|
|
3279
3289
|
...translationsFromBranding,
|
|
3280
3290
|
...userDefinedTranslations
|
|
3281
3291
|
};
|
|
@@ -26294,7 +26304,7 @@ class DateTimePickerComponent {
|
|
|
26294
26304
|
}
|
|
26295
26305
|
// Merge date and time, and emit as new form value:
|
|
26296
26306
|
this.date = new Date(dateTime.date);
|
|
26297
|
-
this.date.setHours(this.time.getHours(), this.time.getMinutes());
|
|
26307
|
+
this.date.setHours(this.time.getHours(), this.time.getMinutes(), this.config.showSeconds ? this.time.getSeconds() : 0);
|
|
26298
26308
|
this.form.get('date').setValue(dateTime.date, { emitEvent: false });
|
|
26299
26309
|
this.onChange(this.date.toISOString());
|
|
26300
26310
|
}
|
|
@@ -26306,7 +26316,7 @@ class DateTimePickerComponent {
|
|
|
26306
26316
|
return this.previousValue?.date && value.date === undefined;
|
|
26307
26317
|
}
|
|
26308
26318
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: DateFormatService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26309
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
26319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DateTimePickerComponent, isStandalone: true, selector: "c8y-date-time-picker", inputs: { _minDate: ["minDate", "_minDate"], _maxDate: ["maxDate", "_maxDate"], placeholder: "placeholder", dateInputFormat: "dateInputFormat", adaptivePosition: "adaptivePosition", size: "size", dateType: "dateType", config: "config" }, outputs: { onDateSelected: "onDateSelected" }, providers: [
|
|
26310
26320
|
{
|
|
26311
26321
|
provide: NG_VALUE_ACCESSOR,
|
|
26312
26322
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
@@ -26317,7 +26327,7 @@ class DateTimePickerComponent {
|
|
|
26317
26327
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
26318
26328
|
multi: true
|
|
26319
26329
|
}
|
|
26320
|
-
], viewQueries: [{ propertyName: "datepicker", first: true, predicate: BsDatepickerDirective, descendants: true }], ngImport: i0, template: "<div
|
|
26330
|
+
], viewQueries: [{ propertyName: "datepicker", first: true, predicate: BsDatepickerDirective, descendants: true }], ngImport: i0, template: "<div class=\"datetime-picker\">\n @switch (dateType) {\n @case ('DateAndTime') {\n <div\n class=\"d-contents\"\n [closeDatepicker]=\"datepicker\"\n >\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n data-cy=\"bootstrap-date-input\"\n [placeholder]=\"placeholder || defaultPlaceholder | translate\"\n bsDatepicker\n [outsideClick]=\"false\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n dateInputFormat: dateInputFormat,\n adaptivePosition: adaptivePosition\n }\"\n [formControl]=\"dateControl\"\n (blur)=\"onTouched()\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (onShown)=\"datepickerShown($event)\"\n />\n </div>\n <timepicker\n class=\"form-group {{ size ? 'form-group-' + size : '' }}\"\n [(ngModel)]=\"time\"\n (ngModelChange)=\"onTimeChange($event)\"\n [showSeconds]=\"config.showSeconds\"\n [showSpinners]=\"config.showSpinners\"\n [showMeridian]=\"config.showMeridian\"\n (wheel)=\"handleMouseWheel($event)\"\n ></timepicker>\n </div>\n }\n\n @case ('Date') {\n <div\n class=\"d-contents\"\n [closeDatepicker]=\"datepicker\"\n >\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n [placeholder]=\"placeholder || defaultPlaceholder | translate\"\n bsDatepicker\n [outsideClick]=\"false\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n dateInputFormat: dateInputFormat,\n adaptivePosition: adaptivePosition\n }\"\n [formControl]=\"dateControl\"\n (blur)=\"onTouched()\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (onShown)=\"datepickerShown($event)\"\n />\n </div>\n </div>\n }\n\n @case ('DateRange') {\n <div class=\"d-contents\">\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'Select a date range' | translate }}\"\n [formControl]=\"dateControl\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n adaptivePosition: true,\n rangeInputFormat: dateInputFormat\n }\"\n bsDaterangepicker\n />\n </div>\n </div>\n }\n\n @case ('Time') {\n <div class=\"d-contents\">\n <timepicker\n class=\"form-group {{ size ? 'form-group-' + size : '' }}\"\n [(ngModel)]=\"time\"\n (ngModelChange)=\"onTimeChange($event)\"\n [showSeconds]=\"config.showSeconds\"\n [showSpinners]=\"config.showSpinners\"\n [showMeridian]=\"config.showMeridian\"\n [minutesPlaceholder]=\"'MM`MINUTES`' | translate\"\n [hoursPlaceholder]=\"'HH`HOURS`' | translate\"\n [secondsPlaceholder]=\"'SS`SECONDS`' | translate\"\n (wheel)=\"handleMouseWheel($event)\"\n ></timepicker>\n </div>\n }\n\n @case ('SingleDateRequired') {\n <div class=\"d-contents\">\n <div class=\"form-group {{ size ? 'form-group-' + size : '' }}\">\n <c8y-date-picker (onDateSelected)=\"onDateSelected.emit($event)\"></c8y-date-picker>\n </div>\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: CloseDatePickerDirective, selector: "[closeDatepicker]", inputs: ["closeDatepicker"] }, { kind: "ngmodule", type: BsDatepickerModule }, { kind: "directive", type: i2.BsDatepickerDirective, selector: "[bsDatepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isDisabled", "minDate", "maxDate", "ignoreMinMaxErrors", "minMode", "daysDisabled", "datesDisabled", "datesEnabled", "dateCustomClasses", "dateTooltipTexts", "isOpen", "bsValue", "bsConfig"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDatepicker"] }, { kind: "directive", type: i2.BsDatepickerInputDirective, selector: "input[bsDatepicker]" }, { kind: "directive", type: i2.BsDaterangepickerDirective, selector: "[bsDaterangepicker]", inputs: ["placement", "triggers", "outsideClick", "container", "outsideEsc", "isOpen", "bsValue", "bsConfig", "isDisabled", "minDate", "maxDate", "dateCustomClasses", "daysDisabled", "datesDisabled", "datesEnabled"], outputs: ["onShown", "onHidden", "bsValueChange"], exportAs: ["bsDaterangepicker"] }, { kind: "directive", type: i2.BsDaterangepickerInputDirective, selector: "input[bsDaterangepicker]" }, { kind: "ngmodule", type: FormsModule$1 }, { kind: "directive", type: i1$8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TimepickerModule }, { kind: "component", type: i4$1.TimepickerComponent, selector: "timepicker", inputs: ["hourStep", "minuteStep", "secondsStep", "readonlyInput", "disabled", "mousewheel", "arrowkeys", "showSpinners", "showMeridian", "showMinutes", "showSeconds", "meridians", "min", "max", "hoursPlaceholder", "minutesPlaceholder", "secondsPlaceholder"], outputs: ["isValid", "meridianChange"] }, { kind: "component", type: DatePickerComponent, selector: "c8y-date-picker", inputs: ["placeholder", "dateInputFormat"], outputs: ["onDateSelected"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
|
|
26321
26331
|
}
|
|
26322
26332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
26323
26333
|
type: Component,
|
|
@@ -26333,8 +26343,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
26333
26343
|
multi: true
|
|
26334
26344
|
}
|
|
26335
26345
|
], standalone: true, imports: [
|
|
26336
|
-
NgSwitch,
|
|
26337
|
-
NgSwitchCase,
|
|
26338
26346
|
CloseDatePickerDirective,
|
|
26339
26347
|
BsDatepickerModule,
|
|
26340
26348
|
FormsModule$1,
|
|
@@ -26342,7 +26350,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
26342
26350
|
TimepickerModule,
|
|
26343
26351
|
DatePickerComponent,
|
|
26344
26352
|
C8yTranslatePipe
|
|
26345
|
-
], template: "<div
|
|
26353
|
+
], template: "<div class=\"datetime-picker\">\n @switch (dateType) {\n @case ('DateAndTime') {\n <div\n class=\"d-contents\"\n [closeDatepicker]=\"datepicker\"\n >\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n data-cy=\"bootstrap-date-input\"\n [placeholder]=\"placeholder || defaultPlaceholder | translate\"\n bsDatepicker\n [outsideClick]=\"false\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n dateInputFormat: dateInputFormat,\n adaptivePosition: adaptivePosition\n }\"\n [formControl]=\"dateControl\"\n (blur)=\"onTouched()\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (onShown)=\"datepickerShown($event)\"\n />\n </div>\n <timepicker\n class=\"form-group {{ size ? 'form-group-' + size : '' }}\"\n [(ngModel)]=\"time\"\n (ngModelChange)=\"onTimeChange($event)\"\n [showSeconds]=\"config.showSeconds\"\n [showSpinners]=\"config.showSpinners\"\n [showMeridian]=\"config.showMeridian\"\n (wheel)=\"handleMouseWheel($event)\"\n ></timepicker>\n </div>\n }\n\n @case ('Date') {\n <div\n class=\"d-contents\"\n [closeDatepicker]=\"datepicker\"\n >\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n [placeholder]=\"placeholder || defaultPlaceholder | translate\"\n bsDatepicker\n [outsideClick]=\"false\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n dateInputFormat: dateInputFormat,\n adaptivePosition: adaptivePosition\n }\"\n [formControl]=\"dateControl\"\n (blur)=\"onTouched()\"\n [minDate]=\"minDate\"\n [maxDate]=\"maxDate\"\n (onShown)=\"datepickerShown($event)\"\n />\n </div>\n </div>\n }\n\n @case ('DateRange') {\n <div class=\"d-contents\">\n <div class=\"form-group datepicker {{ size ? 'form-group-' + size : '' }}\">\n <input\n class=\"form-control\"\n placeholder=\"{{ 'Select a date range' | translate }}\"\n [formControl]=\"dateControl\"\n [bsConfig]=\"{\n customTodayClass: 'today',\n adaptivePosition: true,\n rangeInputFormat: dateInputFormat\n }\"\n bsDaterangepicker\n />\n </div>\n </div>\n }\n\n @case ('Time') {\n <div class=\"d-contents\">\n <timepicker\n class=\"form-group {{ size ? 'form-group-' + size : '' }}\"\n [(ngModel)]=\"time\"\n (ngModelChange)=\"onTimeChange($event)\"\n [showSeconds]=\"config.showSeconds\"\n [showSpinners]=\"config.showSpinners\"\n [showMeridian]=\"config.showMeridian\"\n [minutesPlaceholder]=\"'MM`MINUTES`' | translate\"\n [hoursPlaceholder]=\"'HH`HOURS`' | translate\"\n [secondsPlaceholder]=\"'SS`SECONDS`' | translate\"\n (wheel)=\"handleMouseWheel($event)\"\n ></timepicker>\n </div>\n }\n\n @case ('SingleDateRequired') {\n <div class=\"d-contents\">\n <div class=\"form-group {{ size ? 'form-group-' + size : '' }}\">\n <c8y-date-picker (onDateSelected)=\"onDateSelected.emit($event)\"></c8y-date-picker>\n </div>\n </div>\n }\n }\n</div>\n" }]
|
|
26346
26354
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: DateFormatService }], propDecorators: { _minDate: [{
|
|
26347
26355
|
type: Input,
|
|
26348
26356
|
args: ['minDate']
|