@c8y/ngx-components 1024.0.0 → 1024.1.6

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 (34) hide show
  1. package/fesm2022/c8y-ngx-components-datapoint-explorer-devicemanagement.mjs +0 -1
  2. package/fesm2022/c8y-ngx-components-datapoint-explorer-devicemanagement.mjs.map +1 -1
  3. package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs +4 -6
  4. package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs.map +1 -1
  5. package/fesm2022/c8y-ngx-components-repository-configuration.mjs +493 -417
  6. package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
  7. package/fesm2022/c8y-ngx-components-repository-shared.mjs +69 -10
  8. package/fesm2022/c8y-ngx-components-repository-shared.mjs.map +1 -1
  9. package/fesm2022/c8y-ngx-components-widgets-implementations-quick-links.mjs +53 -24
  10. package/fesm2022/c8y-ngx-components-widgets-implementations-quick-links.mjs.map +1 -1
  11. package/fesm2022/c8y-ngx-components.mjs +51 -24
  12. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  13. package/locales/de.po +42 -39
  14. package/locales/es.po +32 -29
  15. package/locales/fr.po +24 -21
  16. package/locales/ja_JP.po +47 -44
  17. package/locales/ko.po +30 -27
  18. package/locales/locales.pot +3 -0
  19. package/locales/nl.po +27 -24
  20. package/locales/pl.po +42 -39
  21. package/locales/pt_BR.po +29 -26
  22. package/locales/zh_CN.po +28 -25
  23. package/locales/zh_TW.po +38 -35
  24. package/package.json +1 -1
  25. package/types/c8y-ngx-components-datapoint-explorer-devicemanagement.d.ts.map +1 -1
  26. package/types/c8y-ngx-components-operations-bulk-single-operations-list.d.ts.map +1 -1
  27. package/types/c8y-ngx-components-repository-configuration.d.ts +30 -11
  28. package/types/c8y-ngx-components-repository-configuration.d.ts.map +1 -1
  29. package/types/c8y-ngx-components-repository-shared.d.ts +26 -2
  30. package/types/c8y-ngx-components-repository-shared.d.ts.map +1 -1
  31. package/types/c8y-ngx-components-widgets-implementations-quick-links.d.ts +18 -5
  32. package/types/c8y-ngx-components-widgets-implementations-quick-links.d.ts.map +1 -1
  33. package/types/c8y-ngx-components.d.ts +16 -5
  34. package/types/c8y-ngx-components.d.ts.map +1 -1
@@ -25276,16 +25276,49 @@ const TEXT_MIME_TYPES = new Set([
25276
25276
  'application/x-sh',
25277
25277
  'application/x-shellscript'
25278
25278
  ]);
25279
- /**
25280
- * Detects binary files by checking the MIME type first, then sampling the first 512 bytes
25281
- * for null bytes (0x00) the same heuristic used by git and most text editors.
25282
- */
25283
- async function isBinaryFile(file) {
25284
- if (file.type.startsWith('text/') || TEXT_MIME_TYPES.has(file.type)) {
25279
+ /** Bytes to sample from the start of a file — matches git's binary-detection window. */
25280
+ const SAMPLE_SIZE = 8192;
25281
+ /** Share of sampled characters that may be non-text before the content is treated as binary. */
25282
+ const NON_TEXT_THRESHOLD = 0.1;
25283
+ /**
25284
+ * Detects binary files by checking the MIME type first, then inspecting the leading bytes:
25285
+ * a null byte (git's heuristic) or a high share of non-text characters marks the file as
25286
+ * binary. The second check catches high-entropy content (e.g. random data) that may contain
25287
+ * no null byte in the sample and would otherwise be mistaken for text.
25288
+ *
25289
+ * @param options.ignoreMimeType Skip the MIME-type fast path and always sample the bytes.
25290
+ * Use when the declared type is untrustworthy (e.g. platform-served binaries labelled
25291
+ * `text/plain`) and the content itself must decide text vs. binary.
25292
+ */
25293
+ async function isBinaryFile(file, options = {}) {
25294
+ if (!options.ignoreMimeType &&
25295
+ (file.type.startsWith('text/') || TEXT_MIME_TYPES.has(file.type))) {
25285
25296
  return false;
25286
25297
  }
25287
- const buffer = await file.slice(0, 512).arrayBuffer();
25288
- return new Uint8Array(buffer).some(byte => byte === 0);
25298
+ const buffer = await file.slice(0, SAMPLE_SIZE).arrayBuffer();
25299
+ const bytes = new Uint8Array(buffer);
25300
+ if (bytes.length === 0) {
25301
+ return false;
25302
+ }
25303
+ // A null byte is a definitive binary marker.
25304
+ if (bytes.some(byte => byte === 0)) {
25305
+ return true;
25306
+ }
25307
+ // Otherwise, decode as UTF-8 and treat content dominated by invalid sequences or control
25308
+ // characters as binary. Valid text (ASCII/UTF-8) decodes cleanly and stays below the threshold.
25309
+ const decoded = new TextDecoder('utf-8').decode(bytes);
25310
+ let nonText = 0;
25311
+ let total = 0;
25312
+ for (const char of decoded) {
25313
+ total++;
25314
+ const code = char.codePointAt(0);
25315
+ const isReplacement = code === 0xfffd; // invalid UTF-8 byte sequence
25316
+ const isControl = code < 0x20 && code !== 0x09 && code !== 0x0a && code !== 0x0d;
25317
+ if (isReplacement || isControl) {
25318
+ nonText++;
25319
+ }
25320
+ }
25321
+ return total > 0 && nonText / total > NON_TEXT_THRESHOLD;
25289
25322
  }
25290
25323
 
25291
25324
  /**
@@ -30656,6 +30689,7 @@ class DashboardChildComponent {
30656
30689
  this._additionalHeaderTemplates.complete();
30657
30690
  this.removeFromGridStack();
30658
30691
  this.removeSelfFromDashboard();
30692
+ this.detachWidgetContent();
30659
30693
  }
30660
30694
  addActions(actions, prepend = false) {
30661
30695
  if (prepend) {
@@ -30757,6 +30791,12 @@ class DashboardChildComponent {
30757
30791
  this.intersected = true;
30758
30792
  }
30759
30793
  }
30794
+ /**
30795
+ * Severs the projected widget content from the card DOM.
30796
+ */
30797
+ detachWidgetContent() {
30798
+ this.element.nativeElement.querySelector('c8y-dynamic-component')?.remove();
30799
+ }
30760
30800
  setGridStackAttributes() {
30761
30801
  const el = this.element.nativeElement;
30762
30802
  el.setAttribute('gs-x', String(this.x ?? 0));
@@ -32606,7 +32646,7 @@ class WidgetsDashboardComponent {
32606
32646
  get nativeElement() {
32607
32647
  return this.elementRef.nativeElement;
32608
32648
  }
32609
- constructor(dynamic, translateService, route, modal, widgetGlobalAutoRefresh, router, elementRef, cdr) {
32649
+ constructor(dynamic, translateService, route, modal, widgetGlobalAutoRefresh, router, elementRef) {
32610
32650
  this.dynamic = dynamic;
32611
32651
  this.translateService = translateService;
32612
32652
  this.route = route;
@@ -32614,7 +32654,6 @@ class WidgetsDashboardComponent {
32614
32654
  this.widgetGlobalAutoRefresh = widgetGlobalAutoRefresh;
32615
32655
  this.router = router;
32616
32656
  this.elementRef = elementRef;
32617
- this.cdr = cdr;
32618
32657
  /**
32619
32658
  * Indicates if device info in config should be overridden with values from context property.
32620
32659
  */
@@ -32831,12 +32870,6 @@ class WidgetsDashboardComponent {
32831
32870
  // exactly those and leaves never-intersected (below-the-fold) cards as they were.
32832
32871
  this.clearedChildren = children.filter(child => child.intersected);
32833
32872
  this.clearedChildren.forEach(child => (child.intersected = false));
32834
- try {
32835
- this.cdr.detectChanges();
32836
- }
32837
- catch {
32838
- // The view may already be detaching during navigation; the content is dropped regardless.
32839
- }
32840
32873
  }
32841
32874
  /**
32842
32875
  * Re-shows the cards blanked by a clear that was followed by a cancelled/failed navigation. The
@@ -32852,12 +32885,6 @@ class WidgetsDashboardComponent {
32852
32885
  child.reobserve();
32853
32886
  });
32854
32887
  this.clearedChildren = [];
32855
- try {
32856
- this.cdr.detectChanges();
32857
- }
32858
- catch {
32859
- // The view may be mid-teardown; restoring is best-effort.
32860
- }
32861
32888
  }
32862
32889
  /**
32863
32890
  * Primary route path, parsed with the Router (not a hand-rolled regex) so query params, auxiliary
@@ -32965,7 +32992,7 @@ class WidgetsDashboardComponent {
32965
32992
  }
32966
32993
  return result;
32967
32994
  }
32968
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: WidgetsDashboardComponent, deps: [{ token: DynamicComponentService }, { token: i1$1.TranslateService }, { token: i1$3.ActivatedRoute }, { token: ModalService }, { token: WidgetGlobalAutoRefreshService }, { token: i1$3.Router }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
32995
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: WidgetsDashboardComponent, deps: [{ token: DynamicComponentService }, { token: i1$1.TranslateService }, { token: i1$3.ActivatedRoute }, { token: ModalService }, { token: WidgetGlobalAutoRefreshService }, { token: i1$3.Router }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
32969
32996
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: WidgetsDashboardComponent, isStandalone: true, selector: "c8y-widgets-dashboard", inputs: { widgets: "widgets", context: "context", contextDashboard: "contextDashboard", _settings: ["settings", "_settings"], isCopyDisabled: "isCopyDisabled", breadcrumb: "breadcrumb", editModeButtons: "editModeButtons", isSaveDisabled: "isSaveDisabled", clearWidgetContentOnLeave: "clearWidgetContentOnLeave" }, outputs: { onAddWidget: "onAddWidget", onEditWidget: "onEditWidget", onDeleteWidget: "onDeleteWidget", onChangeDashboard: "onChangeDashboard", onResize: "onResize", onEditDashboard: "onEditDashboard", onCopyDashboard: "onCopyDashboard", onDeleteDashboard: "onDeleteDashboard", onChangeStart: "onChangeStart", onChangeEnd: "onChangeEnd", onSaveDashboard: "onSaveDashboard", onCancelDashboard: "onCancelDashboard", revertChange: "revertChange" }, host: { styleAttribute: "\n display: block;\n ", classAttribute: "dashboard c8y-grid-dashboard" }, providers: [WidgetsDashboardEventService], viewQueries: [{ propertyName: "dashboardChildren", predicate: DashboardChildComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (!!settings.title) {\n <c8y-title>\n @let dashboardTitle =\n settings.translateDashboardTitle ? (settings.title | translate) : settings.title;\n {{ dashboardTitle }}\n </c8y-title>\n}\n\n@if (!!breadcrumb) {\n <c8y-breadcrumb>\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n </c8y-breadcrumb>\n}\n\n@if (!(editMode$ | async)) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n >\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (editMode$ | async) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n >\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n itemClass=\"d-flex a-i-center gap-8\"\n >\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled && isSaveDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n </c8y-action-bar-item>\n}\n\n@if (onEditDashboard.observers.length) {\n <c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.allowFullscreen) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n >\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.canCopy) {\n <c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n >\n <div class=\"d-flex a-i-center p-r-16\">\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel)\n | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n @if (!isCopyDisabled?.state && copyDisabledPopoverMsg) {\n <button\n class=\"btn-help btn-help--sm hidden-xs flex-no-shrink\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.preventDefault(); $event.stopPropagation()\"\n ></button>\n }\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.canDelete && onDeleteDashboard.observers.length) {\n <c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (!(isLoadingWidgets$ | async)) {\n @if (resolvedWidgets$ | async; as widgetsToDisplay) {\n <!-- empty state -->\n @if (widgetsToDisplay?.length === 0) {\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n >\n @if (onAddWidget.observers.length) {\n <div>\n @if (editMode$ | async) {\n <p translate>Add widgets to this dashboard.</p>\n }\n @if (!(editMode$ | async)) {\n <p translate>Click \"Edit widgets\" to unlock</p>\n }\n <div>\n @if (!settings.isDisabled && (editMode$ | async)) {\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n }\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>.\n </small>\n </p>\n </div>\n }\n </c8y-ui-empty-state>\n }\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n [layout]=\"settings.layout\"\n [rows]=\"settings.rows\"\n [alignViewHeight]=\"settings.alignViewHeight\"\n [float]=\"settings.float\"\n [gap]=\"settings.widgetMargin\"\n #dashboard\n >\n @for (widget of widgetsToDisplay; track widget.id || widget.name || $index) {\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || scaledDefaultWidth\"\n [height]=\"widget._height || scaledDefaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"\n onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\n \"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n @let widgetTitle =\n widget.title | translate: { noTranslateRemoveContext: !settings.translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span data-cy=\"c8y-dashboard-list--device-widget\">\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n @if (onEditWidget.observers.length) {\n <c8y-dashboard-child-action>\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n }\n @if (onDeleteWidget.observers.length) {\n <c8y-dashboard-child-action>\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"\n onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\n \"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n }\n\n @if (child.intersected) {\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n }\n </c8y-dashboard-child>\n }\n </c8y-dashboard>\n }\n} @else {\n <c8y-loading class=\"col-xs-12 text-center\"></c8y-loading>\n}\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "component", type: BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "component", type: ActionBarItemComponent, selector: "c8y-action-bar-item", inputs: ["placement", "priority", "itemClass", "injector", "groupId", "inGroupPriority"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$4.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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i1$8.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "progressLabel", "message"] }, { kind: "component", type: EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "component", type: GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: DashboardComponent, selector: "c8y-dashboard", inputs: ["columns", "layout", "alignViewHeight", "float", "gap", "minH", "minW", "rows"], outputs: ["dashboardChange"] }, { kind: "component", type: DashboardChildComponent, selector: "c8y-dashboard-child", inputs: ["x", "y", "width", "height", "minH", "minW", "data", "margin", "useIntersection", "isFrozen", "canToggleFullscreen", "editMode", "class"], outputs: ["changeStart", "changeEnd", "toggleFullscreen"] }, { kind: "component", type: DashboardChildTitleComponent, selector: "c8y-dashboard-child-title" }, { kind: "component", type: DashboardChildActionComponent, selector: "c8y-dashboard-child-action" }, { kind: "component", type: DynamicComponentComponent, selector: "c8y-dynamic-component", inputs: ["componentId", "config", "mode", "notFoundError", "executeResolvers"], outputs: ["updateWidgetClasses"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
32970
32997
  }
32971
32998
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: WidgetsDashboardComponent, decorators: [{
@@ -32999,7 +33026,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
32999
33026
  C8yTranslatePipe,
33000
33027
  AsyncPipe
33001
33028
  ], template: "@if (!!settings.title) {\n <c8y-title>\n @let dashboardTitle =\n settings.translateDashboardTitle ? (settings.title | translate) : settings.title;\n {{ dashboardTitle }}\n </c8y-title>\n}\n\n@if (!!breadcrumb) {\n <c8y-breadcrumb>\n <c8y-breadcrumb-item\n [icon]=\"breadcrumb.icon\"\n [label]=\"breadcrumb.label\"\n [path]=\"breadcrumb.path\"\n ></c8y-breadcrumb-item>\n </c8y-breadcrumb>\n}\n\n@if (!(editMode$ | async)) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n >\n <button\n class=\"btn btn-link animated fadeIn hidden-xs\"\n title=\"{{ 'Edit widgets' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled\"\n (click)=\"enableEditMode()\"\n data-cy=\"c8y-widget-dashboard--edit-widgets\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"send-backward\"></i>\n <span class=\"m-l-4\">{{ 'Edit widgets' | translate }}</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (editMode$ | async) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n >\n <button\n class=\"btn btn-link animated fadeIn\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"widget-dashboard--Add-widget\"\n >\n <i c8yIcon=\"plus-circle\"></i>\n {{ 'Add widget' | translate }}\n </button>\n </c8y-action-bar-item>\n\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"ACTION_BAR_EDIT_WIDGETS_PRIORITY\"\n itemClass=\"d-flex a-i-center gap-8\"\n >\n <div class=\"input-group input-group-sm animated fadeIn\">\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Undo' | translate\"\n [tooltip]=\"\n editModeButtons.undoButtonDisabled\n ? ''\n : (undoMessage\n | translate: { changeToUndo: editModeButtons.changeToUndoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('undo')\"\n [disabled]=\"editModeButtons.undoButtonDisabled\"\n >\n <i [c8yIcon]=\"'undo'\"></i>\n </button>\n </div>\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default btn-sm btn-icon\"\n [attr.aria-label]=\"'Redo' | translate\"\n [tooltip]=\"\n editModeButtons.redoButtonDisabled\n ? ''\n : (redoMessage\n | translate: { changeToRedo: editModeButtons.changeToRedoName | translate })\n \"\n container=\"body\"\n (click)=\"revertChange.emit('redo')\"\n [disabled]=\"editModeButtons.redoButtonDisabled\"\n >\n <i [c8yIcon]=\"'redo'\"></i>\n </button>\n </div>\n <span></span>\n </div>\n <div class=\"btn-group animated fadeIn\">\n <button\n class=\"btn btn-default btn-sm\"\n title=\"{{ 'Cancel' | translate }}\"\n type=\"button\"\n (click)=\"cancelDashboardSave()\"\n >\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary btn-sm m-l-8\"\n title=\"{{ 'Save' | translate }}\"\n type=\"button\"\n [disabled]=\"editModeButtons.undoButtonDisabled && isSaveDisabled\"\n (click)=\"saveDashboard()\"\n data-cy=\"c8y-widgets-dashboard--save\"\n >\n {{ 'Save' | translate }}\n </button>\n </div>\n </c8y-action-bar-item>\n}\n\n@if (onEditDashboard.observers.length) {\n <c8y-action-bar-item [placement]=\"'right'\">\n <button\n class=\"btn btn-link hidden-xs m-l-0\"\n title=\"{{ 'Dashboard settings' | translate }}\"\n type=\"button\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n (click)=\"onEditDashboard.emit()\"\n data-cy=\"c8y-widgets-dashboard--edit-dashboard\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n <button\n class=\"btn btn-link visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"sorting-slider\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visible-lg-inline\">\n {{ 'Dashboard settings' | translate }}\n </span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.allowFullscreen) {\n <c8y-action-bar-item\n [placement]=\"'right'\"\n [priority]=\"-5000\"\n itemClass=\"pull-right\"\n >\n <button\n class=\"btn btn-link\"\n [attr.aria-label]=\"'Full screen' | translate\"\n tooltip=\"{{ 'Full screen' | translate }}\"\n placement=\"left\"\n container=\"body\"\n type=\"button\"\n [delay]=\"500\"\n (click)=\"toggleFullscreen()\"\n data-cy=\"widgets-dashboard--Full-screen\"\n >\n <i [c8yIcon]=\"(inFullScreen$ | async) ? 'compress' : 'expand'\"></i>\n <span class=\"visible-xs-inline hidden-sm visible-md-inline visibile-lg-inline\">\n {{ 'Full screen' | translate }}\n </span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.canCopy) {\n <c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-2000\"\n >\n <div class=\"d-flex a-i-center p-r-16\">\n <button\n class=\"hidden-xs\"\n title=\"{{\n (isCopyDisabled === true || !isCopyDisabled?.state ? 'Disabled' : copyDashboardLabel)\n | translate\n }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n data-cy=\"widgets-dashboard--copy-dashboard\"\n (click)=\"onCopyDashboard.emit()\"\n [disabled]=\"isCopyDisabled === true || !isCopyDisabled?.state || (editMode$ | async)\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n @if (!isCopyDisabled?.state && copyDisabledPopoverMsg) {\n <button\n class=\"btn-help btn-help--sm hidden-xs flex-no-shrink\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"copyDisabledPopoverMsg | translate\"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n data-cy=\"widgets-dashboard--info-copy-dashboard\"\n (click)=\"$event.preventDefault(); $event.stopPropagation()\"\n ></button>\n }\n </div>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n [ngClass]=\"{ 'btn btn-link': !settings.canDelete }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"clone\"></i>\n <span>{{ copyDashboardLabel | translate }}</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (settings.canDelete && onDeleteDashboard.observers.length) {\n <c8y-action-bar-item\n [placement]=\"'more'\"\n [priority]=\"-3000\"\n >\n <button\n class=\"hidden-xs\"\n title=\"{{ 'Delete dashboard' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n (click)=\"onDeleteDashboard.emit()\"\n [disabled]=\"settings.isDisabled || (editMode$ | async)\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n <button\n class=\"visible-xs m-l-0\"\n tooltip=\"{{ 'Not available on mobile phone' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--delete-dashboard-mobile\"\n [ngClass]=\"{ 'btn btn-link': !settings.canCopy }\"\n [disabled]=\"true\"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Delete dashboard</span>\n </button>\n </c8y-action-bar-item>\n}\n\n@if (!(isLoadingWidgets$ | async)) {\n @if (resolvedWidgets$ | async; as widgetsToDisplay) {\n <!-- empty state -->\n @if (widgetsToDisplay?.length === 0) {\n <c8y-ui-empty-state\n [icon]=\"'c8y-device'\"\n [title]=\"'No widgets to display.' | translate\"\n >\n @if (onAddWidget.observers.length) {\n <div>\n @if (editMode$ | async) {\n <p translate>Add widgets to this dashboard.</p>\n }\n @if (!(editMode$ | async)) {\n <p translate>Click \"Edit widgets\" to unlock</p>\n }\n <div>\n @if (!settings.isDisabled && (editMode$ | async)) {\n <button\n class=\"btn btn-primary m-t-16\"\n title=\"{{ 'Add widget' | translate }}\"\n type=\"button\"\n (click)=\"onAddWidget.emit()\"\n data-cy=\"c8y-widgets-dashboard--add-widget\"\n translate\n >\n Add widget\n </button>\n }\n </div>\n <p c8y-guide-docs>\n <small\n translate\n ngNonBindable\n >\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/working-with-dashboards\">user documentation</a>.\n </small>\n </p>\n </div>\n }\n </c8y-ui-empty-state>\n }\n\n <c8y-dashboard\n [columns]=\"settings.columns\"\n (dashboardChange)=\"onChangeDashboard.emit($event)\"\n [layout]=\"settings.layout\"\n [rows]=\"settings.rows\"\n [alignViewHeight]=\"settings.alignViewHeight\"\n [float]=\"settings.float\"\n [gap]=\"settings.widgetMargin\"\n #dashboard\n >\n @for (widget of widgetsToDisplay; track widget.id || widget.name || $index) {\n <c8y-dashboard-child\n [class]=\"widget.classes\"\n [x]=\"widget._x\"\n [y]=\"widget._y\"\n [width]=\"widget._width || scaledDefaultWidth\"\n [height]=\"widget._height || scaledDefaultHeight\"\n [margin]=\"settings.widgetMargin\"\n [data]=\"widget\"\n [useIntersection]=\"true\"\n [editMode]=\"editMode$ | async\"\n (changeStart)=\"\n onChangeStart.emit({ widget: widget, source: child, dashboard: dashboard })\n \"\n (changeEnd)=\"onChangeEnd.emit({ widget: widget, source: child, dashboard: dashboard })\"\n (toggleFullscreen)=\"toggleFullscreenOnWidget(child)\"\n [canToggleFullscreen]=\"!(inFullScreen$ | async) || widgetInFullscreenMode\"\n #child\n >\n @let widgetTitle =\n widget.title | translate: { noTranslateRemoveContext: !settings.translateWidgetTitle };\n <c8y-dashboard-child-title [attr.title]=\"widgetTitle\">\n <span data-cy=\"c8y-dashboard-list--device-widget\">\n {{ widgetTitle }}\n </span>\n </c8y-dashboard-child-title>\n @if (onEditWidget.observers.length) {\n <c8y-dashboard-child-action>\n <button\n title=\"{{ 'Edit widget' | translate }}\"\n type=\"button\"\n data-cy=\"widgets-dashboard--Edit-widget\"\n (click)=\"onEditWidget.emit({ widget: widget, source: child, dashboard: dashboard })\"\n >\n <i c8yIcon=\"pencil\"></i>\n <span translate>Edit</span>\n </button>\n </c8y-dashboard-child-action>\n }\n @if (onDeleteWidget.observers.length) {\n <c8y-dashboard-child-action>\n <button\n title=\"{{ 'Remove widget' | translate }}\"\n type=\"button\"\n data-cy=\"c8y-widgets-dashboard--remove-widget\"\n (click)=\"\n onDeleteWidget.emit({ widget: widget, source: child, dashboard: dashboard })\n \"\n >\n <i c8yIcon=\"delete\"></i>\n <span translate>Remove</span>\n </button>\n </c8y-dashboard-child-action>\n }\n\n @if (child.intersected) {\n <c8y-dynamic-component\n [componentId]=\"widget.componentId || widget.name\"\n [config]=\"\n widget.templateUrl || widget.widgetComponent\n ? { child: widget, dashboard: contextDashboard, context: context }\n : widget.config\n \"\n (updateWidgetClasses)=\"updateWidgetClasses(widget, $event)\"\n ></c8y-dynamic-component>\n }\n </c8y-dashboard-child>\n }\n </c8y-dashboard>\n }\n} @else {\n <c8y-loading class=\"col-xs-12 text-center\"></c8y-loading>\n}\n" }]
33002
- }], ctorParameters: () => [{ type: DynamicComponentService }, { type: i1$1.TranslateService }, { type: i1$3.ActivatedRoute }, { type: ModalService }, { type: WidgetGlobalAutoRefreshService }, { type: i1$3.Router }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { widgets: [{
33029
+ }], ctorParameters: () => [{ type: DynamicComponentService }, { type: i1$1.TranslateService }, { type: i1$3.ActivatedRoute }, { type: ModalService }, { type: WidgetGlobalAutoRefreshService }, { type: i1$3.Router }, { type: i0.ElementRef }], propDecorators: { widgets: [{
33003
33030
  type: Input
33004
33031
  }], context: [{
33005
33032
  type: Input