@masterteam/dashboard-builder 0.0.68 → 0.0.69

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.
@@ -4,6 +4,7 @@ import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, DatePipe, isPlatformBrowser, DecimalPipe } from '@angular/common';
5
5
  import * as i1 from '@angular/forms';
6
6
  import { FormsModule, NG_VALUE_ACCESSOR, FormBuilder, Validators, ReactiveFormsModule, NG_VALIDATORS, FormRecord, FormControl, FormGroup } from '@angular/forms';
7
+ import { ActivatedRoute, Router } from '@angular/router';
7
8
  import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
8
9
  import * as i2$3 from 'angular-gridster2';
9
10
  import { DirTypes, GridsterModule } from 'angular-gridster2';
@@ -17,7 +18,6 @@ import { Subject, map, of, forkJoin, throwError, Observable, ReplaySubject, EMPT
17
18
  import { HttpClient, HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
18
19
  import { catchError, tap, shareReplay, share, mergeMap, takeUntil, retry, finalize, filter, map as map$1, distinctUntilChanged, switchMap, debounceTime as debounceTime$1 } from 'rxjs/operators';
19
20
  import { REQUEST_CONTEXT } from '@masterteam/components';
20
- import { ActivatedRoute, Router } from '@angular/router';
21
21
  import { TextField } from '@masterteam/components/text-field';
22
22
  import { CheckboxField } from '@masterteam/components/checkbox-field';
23
23
  import { ModalRef } from '@masterteam/components/dialog';
@@ -2325,7 +2325,9 @@ const CHART_CAPABILITIES = [
2325
2325
  id: 'chart-map-chart',
2326
2326
  name: 'Map Chart',
2327
2327
  icon: 'map.globe-01',
2328
- category: 'table',
2328
+ // Grouped under Charts, not Tables: `category` only drives the palette tab
2329
+ // and a map is not something a user looks for under "Tables" (issue #1248).
2330
+ category: 'chart',
2329
2331
  products: ['pplus', 'splus'],
2330
2332
  hasManageItem: true,
2331
2333
  defaultSize: { cols: 18, rows: 8 },
@@ -3527,6 +3529,44 @@ function normalizeBeforeRequest(serviceConfig) {
3527
3529
  return next;
3528
3530
  }
3529
3531
 
3532
+ /**
3533
+ * A boolean's two values are not modelled by the property-items API, so they
3534
+ * are synthesized locally instead of requesting them (issue #1237).
3535
+ */
3536
+ const CHECKBOX_VIEW_TYPES = new Set(['checkbox', 'boolean', 'bool']);
3537
+ /**
3538
+ * View types that definitively have no fixed value list. Requesting
3539
+ * `property-items/{key}` for one can only fail, so we skip the call.
3540
+ *
3541
+ * Deliberately a DENY-list: any view type not named here still goes to the API
3542
+ * exactly as before, so an unfamiliar (or newly added) list-bearing type keeps
3543
+ * working rather than silently losing its Values tab.
3544
+ */
3545
+ const NO_VALUE_LIST_VIEW_TYPES = new Set([
3546
+ 'text',
3547
+ 'longtext',
3548
+ 'title',
3549
+ 'number',
3550
+ 'float',
3551
+ 'decimal',
3552
+ 'currency',
3553
+ 'percentage',
3554
+ 'date',
3555
+ 'datetime',
3556
+ 'time',
3557
+ 'user',
3558
+ 'multiuser',
3559
+ 'attachment',
3560
+ 'location',
3561
+ 'formula',
3562
+ 'calculated',
3563
+ ]);
3564
+ /** Normalize a catalog viewType for comparison ("Request_Status" → "request_status"). */
3565
+ function normalizeViewType(value) {
3566
+ return String(value ?? '')
3567
+ .trim()
3568
+ .toLowerCase();
3569
+ }
3530
3570
  /**
3531
3571
  * Filter Value Field Component
3532
3572
  *
@@ -3535,6 +3575,7 @@ function normalizeBeforeRequest(serviceConfig) {
3535
3575
  */
3536
3576
  class FilterValueField {
3537
3577
  dashboardService = inject(DashboardBuilderService);
3578
+ transloco = inject(TranslocoService);
3538
3579
  popover;
3539
3580
  /** Label for the field */
3540
3581
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
@@ -3674,11 +3715,14 @@ class FilterValueField {
3674
3715
  }
3675
3716
  });
3676
3717
  });
3677
- // Fetch the targeted property's selectable values (lookup/status) and
3678
- // surface them as the "Values" tab. Lazy + cached per key; properties with
3679
- // no fixed value list simply yield no tab.
3718
+ // Resolve the targeted property's selectable values into the "Values" tab.
3719
+ // Lazy + cached per key; properties with no fixed value list yield no tab.
3720
+ // Reads `propertyOptions()` so the view type is re-evaluated once module
3721
+ // metadata arrives (it is usually empty on the first pass).
3680
3722
  effect(() => {
3681
3723
  const key = this.propertyKey();
3724
+ this.propertyOptions();
3725
+ this.extraProperties();
3682
3726
  if (key)
3683
3727
  untracked(() => this.loadPropertyValues(key));
3684
3728
  });
@@ -3722,10 +3766,44 @@ class FilterValueField {
3722
3766
  buildExtraValuePath(propertyKey) {
3723
3767
  return `extraValues.${propertyKey.charAt(0).toLowerCase()}${propertyKey.slice(1)}.rawValue`;
3724
3768
  }
3725
- /** Lazily load a property's value list into the "Values" tab. */
3769
+ /**
3770
+ * Where a property's selectable values come from (issue #1237).
3771
+ *
3772
+ * - `checkbox` — a boolean has exactly two values and the backend does not
3773
+ * model them, so the list is synthesized locally. Asking
3774
+ * `property-items/{key}` for a Checkbox is what surfaced an error in the
3775
+ * picker.
3776
+ * - `none` — text, number, date, user, …: no fixed value list exists,
3777
+ * so no request is made at all (it could only ever fail).
3778
+ * - `remote` — everything else (lookup / status / phase-gate, and any view
3779
+ * type we do not recognise): fetch from the API, exactly as before.
3780
+ */
3781
+ resolvePropertyValueSource(propertyKey) {
3782
+ const viewType = normalizeViewType(this.findPropertyReference(propertyKey)?.viewType);
3783
+ if (!viewType)
3784
+ return 'remote';
3785
+ if (CHECKBOX_VIEW_TYPES.has(viewType))
3786
+ return 'checkbox';
3787
+ return NO_VALUE_LIST_VIEW_TYPES.has(viewType) ? 'none' : 'remote';
3788
+ }
3789
+ /** Lazily resolve a property's value list into the "Values" tab. */
3726
3790
  loadPropertyValues(propertyKey) {
3727
3791
  if (this.fetchedValueKeys.has(propertyKey))
3728
3792
  return;
3793
+ const source = this.resolvePropertyValueSource(propertyKey);
3794
+ if (source === 'none') {
3795
+ this.fetchedValueKeys.add(propertyKey);
3796
+ this.setPropertyValueOptions([]);
3797
+ return;
3798
+ }
3799
+ if (source === 'checkbox') {
3800
+ this.fetchedValueKeys.add(propertyKey);
3801
+ this.setPropertyValueOptions([
3802
+ { label: this.translateOrFallback('yes', 'Yes'), value: 'true' },
3803
+ { label: this.translateOrFallback('no', 'No'), value: 'false' },
3804
+ ]);
3805
+ return;
3806
+ }
3729
3807
  this.fetchedValueKeys.add(propertyKey);
3730
3808
  this.valuesLoading.set(true);
3731
3809
  this.dashboardService.getPropertyItems(propertyKey).subscribe({
@@ -3749,6 +3827,18 @@ class FilterValueField {
3749
3827
  },
3750
3828
  });
3751
3829
  }
3830
+ /** Publish the Values-tab options and re-derive which tabs are visible. */
3831
+ setPropertyValueOptions(values) {
3832
+ this.quickOptions.update((opts) => ({ ...opts, values }));
3833
+ this.valuesLoading.set(false);
3834
+ this.updateVisibleTabs();
3835
+ }
3836
+ /** Translate a `dashboardBuilder.*` key, falling back when it is missing. */
3837
+ translateOrFallback(key, fallback) {
3838
+ const path = `dashboardBuilder.${key}`;
3839
+ const translated = this.transloco.translate(path);
3840
+ return !translated || translated === path ? fallback : translated;
3841
+ }
3752
3842
  updateVisibleTabs() {
3753
3843
  const opts = this.quickOptions();
3754
3844
  // "Values" leads when present — picking a concrete value is the primary
@@ -22364,7 +22454,7 @@ class ActionService {
22364
22454
  dialogConfig?.clientConfig?.title?.['ar'] ||
22365
22455
  '';
22366
22456
  // Dynamically import DashboardDialogComponent to avoid circular dependency
22367
- import('./masterteam-dashboard-builder-dashboard-dialog.component-XUArffz3.mjs').then(({ DashboardDialogComponent }) => {
22457
+ import('./masterteam-dashboard-builder-dashboard-dialog.component-4s23U4uK.mjs').then(({ DashboardDialogComponent }) => {
22368
22458
  // Open dialog using ModalService
22369
22459
  this.modalService.openModal(DashboardDialogComponent, 'dialog', {
22370
22460
  header: title,
@@ -28599,7 +28689,7 @@ class TableCardComponent {
28599
28689
  this.onAction.emit({ type: 'clickOnHeader', data: {} });
28600
28690
  }
28601
28691
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28602
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardComponent, isStandalone: true, selector: "mt-table-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<!--\n One legend definition, two possible hosts. `mt-card-content` only projects\n [topEnd] inside its header block, so when the header is hidden (dialog view)\n the legend has to be rendered in the body instead or it is dropped entirely.\n-->\n<ng-template #legendList>\n <div class=\"flex flex-wrap items-center gap-2\">\n @for (label of labels(); track label.key || $index) {\n <div class=\"flex items-center gap-1 text-xs\">\n <span\n class=\"w-2.5 h-2.5 rounded-full\"\n [style.backgroundColor]=\"getLegendColor(label)\"\n ></span>\n <span>{{ getLegendText(label) }}</span>\n </div>\n }\n </div>\n</ng-template>\n\n<mt-card-content\n [inGroup]=\"inGroup()\"\n [showHeader]=\"!hideHeader()\"\n [title]=\"title()\"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n (headerClick)=\"onHeaderClick()\"\n>\n <!-- Status Labels -->\n <ng-container topEnd>\n @if (hasLegend() && !hideHeader()) {\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n }\n </ng-container>\n\n <ng-container body>\n <div\n class=\"table-wrapper h-full\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n >\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\n so the legend is rendered above the table instead. -->\n @if (hasLegend() && hideHeader()) {\n <div class=\"mb-2 flex shrink-0 justify-end\">\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n </div>\n }\n\n @if (loading()) {\n <div class=\"flex items-center justify-center h-32\">\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\n </div>\n } @else if (hasData()) {\n <div\n class=\"table-scroll-container overflow-auto h-full\"\n (scroll)=\"onTableScroll($event)\"\n >\n <table class=\"w-full border-collapse text-sm\">\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\n <tr>\n <!-- Index column -->\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <th\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\n [style.color]=\"tableStyleConfig()?.thTextColor\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.thBackgroundColor\n \"\n [style.fontWeight]=\"\n tableStyleConfig()?.thFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\n >\n #\n </th>\n }\n\n <!-- Data columns -->\n @for (column of visibleColumns(); track column.key) {\n <th\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\n [style.minWidth]=\"column.width || 'auto'\"\n [style.color]=\"tableStyleConfig()?.thTextColor\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.thBackgroundColor\n \"\n [style.fontWeight]=\"\n tableStyleConfig()?.thFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\n (click)=\"onSort(column)\"\n >\n <div class=\"flex items-center gap-2\">\n <span>{{ column.label }}</span>\n @if (column.isSort) {\n <i\n class=\"text-xs\"\n [class]=\"\n column.isAsc\n ? 'pi pi-sort-amount-up'\n : 'pi pi-sort-amount-down'\n \"\n ></i>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n <!-- Grouped Mode -->\n @if (isGrouped()) {\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\n ></td>\n </tr>\n }\n\n @for (item of visibleGroupedRows(); track item.trackId) {\n @if (item.kind === \"group\") {\n <tr class=\"dashboard-table-row\">\n <td\n [attr.colspan]=\"totalColumns()\"\n class=\"px-3 py-2 font-semibold\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\n \"\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\n >\n <mt-entity-info\n [data]=\"{\n viewType: item.group.prop?.viewType,\n value: item.group.prop?.value,\n }\"\n [displayType]=\"'inTable'\"\n ></mt-entity-info>\n </td>\n </tr>\n } @else {\n <tr\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\n [class.cursor-pointer]=\"isRowClickable()\"\n [class.bg-surface-100]=\"\n tableStyleConfig()?.striped &&\n (item.rowIndex ?? 0) % 2 === 1\n \"\n (click)=\"onRowClick(item.row)\"\n >\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <td\n class=\"px-3 py-2 text-center border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n {{ (item.rowIndex ?? 0) + 1 }}\n </td>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"px-3 py-2 border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n @if (isPhaseGateColumn(column)) {\n @let phaseCell = getPhaseGateCell(item.row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></span>\n <span class=\"font-medium truncate\">\n {{ getPhaseGateCellText(phaseCell) }}\n </span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"\n getPhaseGatePercentage(phaseCell)\n \"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(item.row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </td>\n }\n </tr>\n }\n }\n\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\n ></td>\n </tr>\n }\n } @else {\n <!-- Non-Grouped Mode -->\n @if (flatVirtualTopSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\n ></td>\n </tr>\n }\n\n @for (rowView of visibleTableRows(); track rowView.trackId) {\n <tr\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\n [class.cursor-pointer]=\"isRowClickable()\"\n [class.bg-surface-100]=\"\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\n \"\n (click)=\"onRowClick(rowView.row)\"\n >\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <td\n class=\"px-3 py-2 text-center border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n {{ rowView.rowIndex + 1 }}\n </td>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"px-3 py-2 border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n @if (isPhaseGateColumn(column)) {\n @let phaseCell =\n getPhaseGateCell(rowView.row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></span>\n <span class=\"font-medium truncate\">\n {{ getPhaseGateCellText(phaseCell) }}\n </span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"\n getPhaseGatePercentage(phaseCell)\n \"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(rowView.row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </td>\n }\n </tr>\n }\n\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\n ></td>\n </tr>\n }\n }\n </tbody>\n </table>\n </div>\n } @else {\n <!-- No Data -->\n <div\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\n >\n <i class=\"pi pi-info-circle text-2xl\"></i>\n <span>{{ t(\"noData\") }}</span>\n </div>\n }\n </div>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
28692
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardComponent, isStandalone: true, selector: "mt-table-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<!--\r\n One legend definition, two possible hosts. `mt-card-content` only projects\r\n [topEnd] inside its header block, so when the header is hidden (dialog view)\r\n the legend has to be rendered in the body instead or it is dropped entirely.\r\n-->\r\n<ng-template #legendList>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (hasLegend() && !hideHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\r\n so the legend is rendered above the table instead. -->\r\n @if (hasLegend() && hideHeader()) {\r\n <div class=\"mb-2 flex shrink-0 justify-end\">\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
28603
28693
  }
28604
28694
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, decorators: [{
28605
28695
  type: Component,
@@ -28608,7 +28698,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
28608
28698
  TranslocoDirective,
28609
28699
  CardContentComponent,
28610
28700
  EntityInfoComponent,
28611
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n One legend definition, two possible hosts. `mt-card-content` only projects\n [topEnd] inside its header block, so when the header is hidden (dialog view)\n the legend has to be rendered in the body instead or it is dropped entirely.\n-->\n<ng-template #legendList>\n <div class=\"flex flex-wrap items-center gap-2\">\n @for (label of labels(); track label.key || $index) {\n <div class=\"flex items-center gap-1 text-xs\">\n <span\n class=\"w-2.5 h-2.5 rounded-full\"\n [style.backgroundColor]=\"getLegendColor(label)\"\n ></span>\n <span>{{ getLegendText(label) }}</span>\n </div>\n }\n </div>\n</ng-template>\n\n<mt-card-content\n [inGroup]=\"inGroup()\"\n [showHeader]=\"!hideHeader()\"\n [title]=\"title()\"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n (headerClick)=\"onHeaderClick()\"\n>\n <!-- Status Labels -->\n <ng-container topEnd>\n @if (hasLegend() && !hideHeader()) {\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n }\n </ng-container>\n\n <ng-container body>\n <div\n class=\"table-wrapper h-full\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n >\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\n so the legend is rendered above the table instead. -->\n @if (hasLegend() && hideHeader()) {\n <div class=\"mb-2 flex shrink-0 justify-end\">\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n </div>\n }\n\n @if (loading()) {\n <div class=\"flex items-center justify-center h-32\">\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\n </div>\n } @else if (hasData()) {\n <div\n class=\"table-scroll-container overflow-auto h-full\"\n (scroll)=\"onTableScroll($event)\"\n >\n <table class=\"w-full border-collapse text-sm\">\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\n <tr>\n <!-- Index column -->\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <th\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\n [style.color]=\"tableStyleConfig()?.thTextColor\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.thBackgroundColor\n \"\n [style.fontWeight]=\"\n tableStyleConfig()?.thFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\n >\n #\n </th>\n }\n\n <!-- Data columns -->\n @for (column of visibleColumns(); track column.key) {\n <th\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\n [style.minWidth]=\"column.width || 'auto'\"\n [style.color]=\"tableStyleConfig()?.thTextColor\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.thBackgroundColor\n \"\n [style.fontWeight]=\"\n tableStyleConfig()?.thFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\n (click)=\"onSort(column)\"\n >\n <div class=\"flex items-center gap-2\">\n <span>{{ column.label }}</span>\n @if (column.isSort) {\n <i\n class=\"text-xs\"\n [class]=\"\n column.isAsc\n ? 'pi pi-sort-amount-up'\n : 'pi pi-sort-amount-down'\n \"\n ></i>\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n <!-- Grouped Mode -->\n @if (isGrouped()) {\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\n ></td>\n </tr>\n }\n\n @for (item of visibleGroupedRows(); track item.trackId) {\n @if (item.kind === \"group\") {\n <tr class=\"dashboard-table-row\">\n <td\n [attr.colspan]=\"totalColumns()\"\n class=\"px-3 py-2 font-semibold\"\n [style.backgroundColor]=\"\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\n \"\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\n >\n <mt-entity-info\n [data]=\"{\n viewType: item.group.prop?.viewType,\n value: item.group.prop?.value,\n }\"\n [displayType]=\"'inTable'\"\n ></mt-entity-info>\n </td>\n </tr>\n } @else {\n <tr\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\n [class.cursor-pointer]=\"isRowClickable()\"\n [class.bg-surface-100]=\"\n tableStyleConfig()?.striped &&\n (item.rowIndex ?? 0) % 2 === 1\n \"\n (click)=\"onRowClick(item.row)\"\n >\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <td\n class=\"px-3 py-2 text-center border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n {{ (item.rowIndex ?? 0) + 1 }}\n </td>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"px-3 py-2 border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n @if (isPhaseGateColumn(column)) {\n @let phaseCell = getPhaseGateCell(item.row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></span>\n <span class=\"font-medium truncate\">\n {{ getPhaseGateCellText(phaseCell) }}\n </span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"\n getPhaseGatePercentage(phaseCell)\n \"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(item.row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </td>\n }\n </tr>\n }\n }\n\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\n ></td>\n </tr>\n }\n } @else {\n <!-- Non-Grouped Mode -->\n @if (flatVirtualTopSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\n ></td>\n </tr>\n }\n\n @for (rowView of visibleTableRows(); track rowView.trackId) {\n <tr\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\n [class.cursor-pointer]=\"isRowClickable()\"\n [class.bg-surface-100]=\"\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\n \"\n (click)=\"onRowClick(rowView.row)\"\n >\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\n <td\n class=\"px-3 py-2 text-center border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n {{ rowView.rowIndex + 1 }}\n </td>\n }\n\n @for (column of visibleColumns(); track column.key) {\n <td\n class=\"px-3 py-2 border-b border-surface-100\"\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\n [style.fontWeight]=\"\n tableStyleConfig()?.tdFontBold ? 'bold' : null\n \"\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\n >\n @if (isPhaseGateColumn(column)) {\n @let phaseCell =\n getPhaseGateCell(rowView.row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></span>\n <span class=\"font-medium truncate\">\n {{ getPhaseGateCellText(phaseCell) }}\n </span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"\n getPhaseGatePercentage(phaseCell)\n \"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(rowView.row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </td>\n }\n </tr>\n }\n\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\n <td\n [attr.colspan]=\"totalColumns()\"\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\n ></td>\n </tr>\n }\n }\n </tbody>\n </table>\n </div>\n } @else {\n <!-- No Data -->\n <div\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\n >\n <i class=\"pi pi-info-circle text-2xl\"></i>\n <span>{{ t(\"noData\") }}</span>\n </div>\n }\n </div>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"] }]
28701
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\r\n One legend definition, two possible hosts. `mt-card-content` only projects\r\n [topEnd] inside its header block, so when the header is hidden (dialog view)\r\n the legend has to be rendered in the body instead or it is dropped entirely.\r\n-->\r\n<ng-template #legendList>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (hasLegend() && !hideHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\r\n so the legend is rendered above the table instead. -->\r\n @if (hasLegend() && hideHeader()) {\r\n <div class=\"mb-2 flex shrink-0 justify-end\">\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"] }]
28612
28702
  }], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }] } });
28613
28703
 
28614
28704
  /**
@@ -32302,7 +32392,7 @@ class LegendOrderField {
32302
32392
  });
32303
32393
  }
32304
32394
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, deps: [], target: i0.ɵɵFactoryTarget.Component });
32305
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, colorOverrides: { classPropertyName: "colorOverrides", publicName: "colorOverrides", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", colorChange: "colorChange" }, ngImport: i0, template: "<div\n class=\"db-legend-order flex flex-col gap-2\"\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\n>\n @if (rows().length) {\n <div\n cdkDropList\n class=\"flex flex-col gap-2\"\n [cdkDropListDisabled]=\"!reorderable()\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (item of rows(); track item.key) {\n <div\n cdkDrag\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\n [cdkDragDisabled]=\"!reorderable()\"\n >\n @if (reorderable()) {\n <span\n cdkDragHandle\n class=\"cursor-grab text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\n </span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\n mtTruncateTooltip\n >\n {{ item.name }}\n </span>\n <div\n class=\"w-44 max-w-[55%] shrink-0\"\n role=\"group\"\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\n >\n <mt-color-picker-field\n [ngModel]=\"colorFor(item)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setColor(item, $event)\"\n />\n </div>\n </div>\n }\n </div>\n @if (reorderable()) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"t('resetOrder')\"\n icon=\"arrow.refresh-ccw-01\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"reset()\"\n />\n </div>\n }\n } @else {\n <p class=\"text-xs text-muted-color\">\n {{ t(\"noLegendEntries\") }}\n </p>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32395
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, colorOverrides: { classPropertyName: "colorOverrides", publicName: "colorOverrides", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", colorChange: "colorChange" }, ngImport: i0, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n [cdkDropListDisabled]=\"!reorderable()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n [cdkDragDisabled]=\"!reorderable()\"\r\n >\r\n @if (reorderable()) {\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n <div\r\n class=\"w-44 max-w-[55%] shrink-0\"\r\n role=\"group\"\r\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\r\n >\r\n <mt-color-picker-field\r\n [ngModel]=\"colorFor(item)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"setColor(item, $event)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (reorderable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('resetOrder')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"noLegendEntries\") }}\r\n </p>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32306
32396
  }
32307
32397
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, decorators: [{
32308
32398
  type: Component,
@@ -32315,7 +32405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32315
32405
  ColorPickerField,
32316
32406
  Icon,
32317
32407
  TruncateTooltip,
32318
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"db-legend-order flex flex-col gap-2\"\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\n>\n @if (rows().length) {\n <div\n cdkDropList\n class=\"flex flex-col gap-2\"\n [cdkDropListDisabled]=\"!reorderable()\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (item of rows(); track item.key) {\n <div\n cdkDrag\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\n [cdkDragDisabled]=\"!reorderable()\"\n >\n @if (reorderable()) {\n <span\n cdkDragHandle\n class=\"cursor-grab text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\n </span>\n }\n <span\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\n mtTruncateTooltip\n >\n {{ item.name }}\n </span>\n <div\n class=\"w-44 max-w-[55%] shrink-0\"\n role=\"group\"\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\n >\n <mt-color-picker-field\n [ngModel]=\"colorFor(item)\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"setColor(item, $event)\"\n />\n </div>\n </div>\n }\n </div>\n @if (reorderable()) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"t('resetOrder')\"\n icon=\"arrow.refresh-ccw-01\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"reset()\"\n />\n </div>\n }\n } @else {\n <p class=\"text-xs text-muted-color\">\n {{ t(\"noLegendEntries\") }}\n </p>\n }\n</div>\n" }]
32408
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n [cdkDropListDisabled]=\"!reorderable()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n [cdkDragDisabled]=\"!reorderable()\"\r\n >\r\n @if (reorderable()) {\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n <div\r\n class=\"w-44 max-w-[55%] shrink-0\"\r\n role=\"group\"\r\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\r\n >\r\n <mt-color-picker-field\r\n [ngModel]=\"colorFor(item)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"setColor(item, $event)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (reorderable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('resetOrder')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"noLegendEntries\") }}\r\n </p>\r\n }\r\n</div>\r\n" }]
32319
32409
  }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], colorOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorOverrides", required: false }] }], reorderable: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderable", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], colorChange: [{ type: i0.Output, args: ["colorChange"] }] } });
32320
32410
 
32321
32411
  const SHADOW_PRESET_PATH$1 = 'clientConfig.configAsType.cardStyleConfig.__shadowPreset';
@@ -32665,7 +32755,7 @@ class StyleField {
32665
32755
  this.patch.emit({ path: SHADOW_PRESET_PATH$1, value: key });
32666
32756
  }
32667
32757
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, deps: [], target: i0.ɵɵFactoryTarget.Component });
32668
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\n@switch (f.type) {\n @case (\"text\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"cssDimension\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? '16px'\"\n [formControl]=\"control\"\n />\n }\n @case (\"multilineText\") {\n <mt-textarea-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"number\") {\n <mt-number-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [min]=\"numberMin\"\n [max]=\"numberMax\"\n [formControl]=\"control\"\n />\n }\n @case (\"numberRange\") {\n <mt-slider-field\n [label]=\"f.label\"\n [min]=\"f.min ?? 0\"\n [max]=\"f.max ?? 100\"\n [step]=\"f.step ?? 1\"\n [unit]=\"f.unit ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"boolean\") {\n <mt-toggle-field\n [label]=\"f.label\"\n toggleShape=\"card\"\n [descriptionCard]=\"f.description ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"color\") {\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @case (\"select\") {\n <mt-select-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [filter]=\"useFilter\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"multiselect\") {\n <mt-multi-select-field\n [label]=\"f.label\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n display=\"chip\"\n [formControl]=\"control\"\n />\n }\n @case (\"iconPicker\") {\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @default {\n <!-- Composite + JSON types render their own label header -->\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\n @if (f.description) {\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\n }\n @switch (f.type) {\n @case (\"segmented\") {\n <mt-segmented-field\n [options]=\"options()\"\n [value]=\"currentValue()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"palette\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"colorList\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"arrayBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"f.itemFields ?? []\"\n [itemTitleKey]=\"f.itemTitleKey\"\n [addLabel]=\"addLabel('Add item')\"\n [maxItems]=\"f.maxItems\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"conditionBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"conditionFields()\"\n [addLabel]=\"addLabel('Add rule')\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"keyValueMap\") {\n <mt-key-value-map-field\n [value]=\"readMapOrArray()\"\n [keys]=\"mapKeys()\"\n [valueFields]=\"f.valueFields ?? []\"\n [asArray]=\"f.asArray ?? false\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"legendOrder\") {\n <mt-legend-order-field\n [items]=\"legendItems()\"\n [colorOverrides]=\"readLegendColorOverrides()\"\n (valueChange)=\"emitValue($event)\"\n (colorChange)=\"onLegendColorChange($event)\"\n />\n }\n @case (\"entryColors\") {\n <!-- Colors only: no (valueChange), because there is no order to\n persist for this control's charts. -->\n <mt-legend-order-field\n [items]=\"legendItems()\"\n [colorOverrides]=\"readLegendColorOverrides()\"\n [reorderable]=\"false\"\n (colorChange)=\"onLegendColorChange($event)\"\n />\n }\n @case (\"json\") {\n <mt-textarea-field\n rows=\"8\"\n placeholder=\"{ }\"\n [formControl]=\"jsonControl\"\n />\n @if (jsonError()) {\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\n }\n }\n }\n </div>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SliderField, selector: "mt-slider-field", inputs: ["field", "label", "class", "min", "max", "step", "hideNumber", "unit", "readonly", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: IconField, selector: "mt-icon-field", inputs: ["label", "required"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ColorListField, selector: "mt-color-list-field", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ArrayBuilderField, selector: "mt-array-builder-field", inputs: ["value", "itemFields", "itemTitleKey", "addLabel", "maxItems"], outputs: ["valueChange"] }, { kind: "component", type: KeyValueMapField, selector: "mt-key-value-map-field", inputs: ["value", "keys", "valueFields", "asArray"], outputs: ["valueChange"] }, { kind: "component", type: LegendOrderField, selector: "mt-legend-order-field", inputs: ["items", "colorOverrides", "reorderable"], outputs: ["valueChange", "colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32758
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"entryColors\") {\r\n <!-- Colors only: no (valueChange), because there is no order to\r\n persist for this control's charts. -->\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n [reorderable]=\"false\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SliderField, selector: "mt-slider-field", inputs: ["field", "label", "class", "min", "max", "step", "hideNumber", "unit", "readonly", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: IconField, selector: "mt-icon-field", inputs: ["label", "required"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ColorListField, selector: "mt-color-list-field", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ArrayBuilderField, selector: "mt-array-builder-field", inputs: ["value", "itemFields", "itemTitleKey", "addLabel", "maxItems"], outputs: ["valueChange"] }, { kind: "component", type: KeyValueMapField, selector: "mt-key-value-map-field", inputs: ["value", "keys", "valueFields", "asArray"], outputs: ["valueChange"] }, { kind: "component", type: LegendOrderField, selector: "mt-legend-order-field", inputs: ["items", "colorOverrides", "reorderable"], outputs: ["valueChange", "colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32669
32759
  }
32670
32760
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, decorators: [{
32671
32761
  type: Component,
@@ -32686,7 +32776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32686
32776
  ArrayBuilderField,
32687
32777
  KeyValueMapField,
32688
32778
  LegendOrderField,
32689
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\n@switch (f.type) {\n @case (\"text\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"cssDimension\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? '16px'\"\n [formControl]=\"control\"\n />\n }\n @case (\"multilineText\") {\n <mt-textarea-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"number\") {\n <mt-number-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [min]=\"numberMin\"\n [max]=\"numberMax\"\n [formControl]=\"control\"\n />\n }\n @case (\"numberRange\") {\n <mt-slider-field\n [label]=\"f.label\"\n [min]=\"f.min ?? 0\"\n [max]=\"f.max ?? 100\"\n [step]=\"f.step ?? 1\"\n [unit]=\"f.unit ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"boolean\") {\n <mt-toggle-field\n [label]=\"f.label\"\n toggleShape=\"card\"\n [descriptionCard]=\"f.description ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"color\") {\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @case (\"select\") {\n <mt-select-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [filter]=\"useFilter\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"multiselect\") {\n <mt-multi-select-field\n [label]=\"f.label\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n display=\"chip\"\n [formControl]=\"control\"\n />\n }\n @case (\"iconPicker\") {\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @default {\n <!-- Composite + JSON types render their own label header -->\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\n @if (f.description) {\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\n }\n @switch (f.type) {\n @case (\"segmented\") {\n <mt-segmented-field\n [options]=\"options()\"\n [value]=\"currentValue()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"palette\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"colorList\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"arrayBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"f.itemFields ?? []\"\n [itemTitleKey]=\"f.itemTitleKey\"\n [addLabel]=\"addLabel('Add item')\"\n [maxItems]=\"f.maxItems\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"conditionBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"conditionFields()\"\n [addLabel]=\"addLabel('Add rule')\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"keyValueMap\") {\n <mt-key-value-map-field\n [value]=\"readMapOrArray()\"\n [keys]=\"mapKeys()\"\n [valueFields]=\"f.valueFields ?? []\"\n [asArray]=\"f.asArray ?? false\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"legendOrder\") {\n <mt-legend-order-field\n [items]=\"legendItems()\"\n [colorOverrides]=\"readLegendColorOverrides()\"\n (valueChange)=\"emitValue($event)\"\n (colorChange)=\"onLegendColorChange($event)\"\n />\n }\n @case (\"entryColors\") {\n <!-- Colors only: no (valueChange), because there is no order to\n persist for this control's charts. -->\n <mt-legend-order-field\n [items]=\"legendItems()\"\n [colorOverrides]=\"readLegendColorOverrides()\"\n [reorderable]=\"false\"\n (colorChange)=\"onLegendColorChange($event)\"\n />\n }\n @case (\"json\") {\n <mt-textarea-field\n rows=\"8\"\n placeholder=\"{ }\"\n [formControl]=\"jsonControl\"\n />\n @if (jsonError()) {\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\n }\n }\n }\n </div>\n }\n}\n" }]
32779
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"entryColors\") {\r\n <!-- Colors only: no (valueChange), because there is no order to\r\n persist for this control's charts. -->\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n [reorderable]=\"false\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n" }]
32690
32780
  }], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], persisted: [{ type: i0.Input, args: [{ isSignal: true, alias: "persisted", required: true }] }], capability: [{ type: i0.Input, args: [{ isSignal: true, alias: "capability", required: false }] }], legendItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItems", required: false }] }], patch: [{ type: i0.Output, args: ["patch"] }] } });
32691
32781
 
32692
32782
  /**
@@ -41870,18 +41960,26 @@ class WidgetPaletteComponent {
41870
41960
  return t.products.includes(prod);
41871
41961
  });
41872
41962
  }, ...(ngDevMode ? [{ debugName: "filteredChartTypes" }] : /* istanbul ignore next */ []));
41873
- /** Widgets for active category */
41963
+ /**
41964
+ * Widgets shown in the grid.
41965
+ *
41966
+ * A search spans EVERY category; only an empty search falls back to the
41967
+ * active tab. Scoping the search to the active tab meant that a user who
41968
+ * opened the palette — which lands on **Layout**, a tab holding just Header
41969
+ * and Topbar — and typed a widget name into the prominent search box got
41970
+ * "No results" for a widget that exists one tab over (issue #1248: "i cant
41971
+ * find the map chart to use it").
41972
+ */
41874
41973
  widgets = computed(() => {
41875
- const search = this.searchTerm().toLowerCase();
41876
- const category = this.activeTab();
41877
- let filtered = this.filteredChartTypes().filter((t) => t.category === category);
41878
- // Filter by hideInList
41879
- filtered = filtered.filter((t) => !t.hideInList);
41974
+ const search = this.searchTerm().trim().toLowerCase();
41975
+ const available = this.filteredChartTypes().filter((t) => !t.hideInList);
41880
41976
  if (search) {
41881
- filtered = filtered.filter((w) => w.name.toLowerCase().includes(search));
41977
+ return available.filter((w) => w.name.toLowerCase().includes(search));
41882
41978
  }
41883
- return filtered;
41979
+ return available.filter((t) => t.category === this.activeTab());
41884
41980
  }, ...(ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []));
41981
+ /** True while a search is narrowing across categories (tabs do not apply). */
41982
+ isSearching = computed(() => this.searchTerm().trim().length > 0, ...(ngDevMode ? [{ debugName: "isSearching" }] : /* istanbul ignore next */ []));
41885
41983
  /** Count of widgets per category (for badge display) */
41886
41984
  categoryCount = computed(() => {
41887
41985
  const types = this.filteredChartTypes().filter((t) => !t.hideInList);
@@ -41918,11 +42016,11 @@ class WidgetPaletteComponent {
41918
42016
  this.ref?.close(null);
41919
42017
  }
41920
42018
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WidgetPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
41921
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WidgetPaletteComponent, isStandalone: true, selector: "mt-widget-palette", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs -->\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
42019
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WidgetPaletteComponent, isStandalone: true, selector: "mt-widget-palette", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs \u2014 a search spans every category, so the tabs do not\r\n apply while one is active. -->\r\n @if (!isSearching()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
41922
42020
  }
41923
42021
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WidgetPaletteComponent, decorators: [{
41924
42022
  type: Component,
41925
- args: [{ selector: 'mt-widget-palette', standalone: true, imports: [TranslocoDirective, Button, TextField, Tabs, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs -->\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n" }]
42023
+ args: [{ selector: 'mt-widget-palette', standalone: true, imports: [TranslocoDirective, Button, TextField, Tabs, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs \u2014 a search spans every category, so the tabs do not\r\n apply while one is active. -->\r\n @if (!isSearching()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n" }]
41926
42024
  }], propDecorators: { product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: false }] }] } });
41927
42025
 
41928
42026
  /**
@@ -41944,6 +42042,7 @@ class DashboardBuilder {
41944
42042
  transloco = inject(TranslocoService);
41945
42043
  modalService = inject(ModalService);
41946
42044
  confirmationService = inject(ConfirmationService);
42045
+ route = inject(ActivatedRoute, { optional: true });
41947
42046
  // ============================================
41948
42047
  // Inputs
41949
42048
  // ============================================
@@ -42092,6 +42191,12 @@ class DashboardBuilder {
42092
42191
  lastExtraFiltersSignature = null;
42093
42192
  lastLoadedPageKey = null;
42094
42193
  lastStandaloneDashboardSignature = null;
42194
+ /**
42195
+ * Last geometry published per chart id, keyed by `serviceConfig.dashboardId`.
42196
+ * Gridster mutates the bound chart object in place, so this is the only way
42197
+ * to tell that a drag/resize actually moved something (issue #1192).
42198
+ */
42199
+ lastItemGeometry = new Map();
42095
42200
  // Undo history (issue #1192): deep-cloned whole-document snapshots.
42096
42201
  undoStack = [];
42097
42202
  HISTORY_LIMIT = 30;
@@ -42140,6 +42245,14 @@ class DashboardBuilder {
42140
42245
  // Lifecycle
42141
42246
  // ============================================
42142
42247
  ngOnInit() {
42248
+ // Publish our route so `ActionService.navigateToPage` can resolve a sibling
42249
+ // dashboard. Only the viewer used to do this, so inside the BUILDER the
42250
+ // service fell back to ActionService's own (ROOT) route and navigation
42251
+ // landed on the app root instead of the target dashboard (issues #1140 /
42252
+ // #1193 — the dialog case, where the item cannot see a routed injector).
42253
+ if (this.route) {
42254
+ this.dashboardService.setActivatedRoute(this.route);
42255
+ }
42143
42256
  this.setupEventListeners();
42144
42257
  // Warm the modules tree once when the dashboard opens. It is not
42145
42258
  // workspace-filtered, so every later "open datasource" hits this cache
@@ -42147,6 +42260,9 @@ class DashboardBuilder {
42147
42260
  this.prefetchModulesTree();
42148
42261
  }
42149
42262
  ngOnDestroy() {
42263
+ if (this.route && this.dashboardService.activatedRoute() === this.route) {
42264
+ this.dashboardService.setActivatedRoute(null);
42265
+ }
42150
42266
  this.subscription.unsubscribe();
42151
42267
  this.removeEventListeners();
42152
42268
  this.stopAutoScroll();
@@ -42201,6 +42317,7 @@ class DashboardBuilder {
42201
42317
  };
42202
42318
  // A fresh document loaded — start its edit history from scratch.
42203
42319
  this.resetHistory();
42320
+ this.resetItemGeometryTracking();
42204
42321
  this.pageConfig.set(normalizedReport);
42205
42322
  // Handle chartLinks format from new API
42206
42323
  if (report.chartLinks && report.chartLinks.length > 0) {
@@ -42275,12 +42392,23 @@ class DashboardBuilder {
42275
42392
  // ============================================
42276
42393
  // Save
42277
42394
  // ============================================
42395
+ /**
42396
+ * Persist the dashboard.
42397
+ *
42398
+ * An EXPLICIT save (the toolbar button — `silent` unset) is the commit point
42399
+ * for the undo history: once it succeeds the accumulated history is dropped
42400
+ * and Undo is disabled until the user edits again. Undo is a pre-save
42401
+ * operation, so it must never be able to reach across a deliberate save
42402
+ * (issue #1192). Internal auto-saves pass `silent: true` and deliberately
42403
+ * keep the history so an add/remove stays revertible.
42404
+ */
42278
42405
  saveDash(options = {}) {
42279
42406
  if (this.saving())
42280
42407
  return;
42281
42408
  if (this.standalone()) {
42282
42409
  this.emitDashboardDataChange();
42283
42410
  if (!options.silent) {
42411
+ this.commitSavedState();
42284
42412
  this.onSave.emit();
42285
42413
  }
42286
42414
  return;
@@ -42339,6 +42467,7 @@ class DashboardBuilder {
42339
42467
  if (linkRequests.length === 0) {
42340
42468
  this.saving.set(false);
42341
42469
  if (!options.silent) {
42470
+ this.commitSavedState();
42342
42471
  this.onSave.emit();
42343
42472
  }
42344
42473
  return;
@@ -42385,11 +42514,25 @@ class DashboardBuilder {
42385
42514
  }));
42386
42515
  this.dashboardService.setDialogItems(this.dialogs());
42387
42516
  if (!options.silent) {
42517
+ this.commitSavedState();
42388
42518
  this.onSave.emit();
42389
42519
  }
42390
42520
  },
42391
42521
  });
42392
42522
  }
42523
+ /**
42524
+ * Mark the current document as the saved baseline: drop the undo history so
42525
+ * Undo is disabled until the next edit (issue #1192 — undo is a *pre-save*
42526
+ * operation and must not reach back across a deliberate save).
42527
+ *
42528
+ * Runs after the link-id patch so the new baseline is captured from the
42529
+ * document the backend actually holds.
42530
+ */
42531
+ commitSavedState() {
42532
+ this.resetHistory();
42533
+ this.committedSnapshot = cloneDeep$1(this.buildDashboardDataSnapshot());
42534
+ this.committedSignature = this.historySignature(this.committedSnapshot);
42535
+ }
42393
42536
  /**
42394
42537
  * Persist the page-level filters through the dashboard (report) endpoint —
42395
42538
  * the canonical carrier of `dashboardConfig.filters`. In API-backed mode
@@ -42477,33 +42620,43 @@ class DashboardBuilder {
42477
42620
  onItemResize(item, itemComponent) {
42478
42621
  this.onItemChange(item, itemComponent);
42479
42622
  }
42623
+ /**
42624
+ * Gridster drag/resize committed (issue #1192).
42625
+ *
42626
+ * The template binds `[item]="chart"`, so Gridster owns and MUTATES the very
42627
+ * object that lives inside the `charts` signal. By the time this callback
42628
+ * runs, `chart.x/y/cols/rows` already hold the new geometry — which is why
42629
+ * the previous "did anything change?" guard compared the chart against
42630
+ * itself, always matched, and returned the array untouched. The signal never
42631
+ * notified, so neither the undo-history effect nor the standalone
42632
+ * `dashboardData` emit ever saw a move or a resize.
42633
+ *
42634
+ * We therefore track the last geometry we published per chart and compare
42635
+ * against THAT. When it differs we publish a new array reference (same item
42636
+ * objects, so Gridster's own `[item]` binding is left alone) purely to wake
42637
+ * the signal's consumers.
42638
+ */
42480
42639
  onItemChange(item, _itemComponent) {
42481
- this.charts.update((currentCharts) => {
42482
- const dashboardId = item.config?.serviceConfig?.dashboardId;
42483
- if (!dashboardId)
42484
- return currentCharts;
42485
- const chartToUpdate = currentCharts.find((c) => c.config?.serviceConfig?.dashboardId === dashboardId);
42486
- if (!chartToUpdate)
42487
- return currentCharts;
42488
- if (chartToUpdate.x === item.x &&
42489
- chartToUpdate.y === item.y &&
42490
- chartToUpdate.cols === item.cols &&
42491
- chartToUpdate.rows === item.rows) {
42492
- return currentCharts;
42493
- }
42494
- return currentCharts.map((chart) => {
42495
- if (chart.config?.serviceConfig?.dashboardId === dashboardId) {
42496
- return {
42497
- ...chart,
42498
- x: item.x,
42499
- y: item.y,
42500
- cols: item.cols,
42501
- rows: item.rows,
42502
- };
42503
- }
42504
- return chart;
42505
- });
42506
- });
42640
+ const dashboardId = item.config?.serviceConfig?.dashboardId;
42641
+ if (!dashboardId)
42642
+ return;
42643
+ const geometry = this.geometrySignature(item);
42644
+ if (this.lastItemGeometry.get(dashboardId) === geometry)
42645
+ return;
42646
+ this.lastItemGeometry.set(dashboardId, geometry);
42647
+ this.charts.update((currentCharts) => [...currentCharts]);
42648
+ }
42649
+ geometrySignature(item) {
42650
+ return `${item.x ?? 0}:${item.y ?? 0}:${item.cols ?? 1}:${item.rows ?? 1}`;
42651
+ }
42652
+ /**
42653
+ * Forget recorded geometries. Required whenever a whole new document replaces
42654
+ * the current one (load / standalone apply / undo restore), otherwise a stale
42655
+ * entry could make a later drag back to those exact coordinates look like a
42656
+ * no-op and get swallowed.
42657
+ */
42658
+ resetItemGeometryTracking() {
42659
+ this.lastItemGeometry.clear();
42507
42660
  }
42508
42661
  onContextMenu(event, item) {
42509
42662
  event.preventDefault();
@@ -44124,12 +44277,17 @@ class DashboardBuilder {
44124
44277
  this.canUndo.set(false);
44125
44278
  }
44126
44279
  /**
44127
- * Revert the most recent action, restoring the dashboard to its previous
44128
- * state, re-pushing the reverted config into every mounted widget, and
44129
- * persisting the reverted document. Persistence matters because most actions
44130
- * auto-save (`saveDash({ silent: true })`), so a local-only revert would be
44131
- * overwritten on the next reload — the undo has to roll the SAVED state back
44132
- * too (issue #1192).
44280
+ * Revert the most recent UNSAVED action (issue #1192).
44281
+ *
44282
+ * Undo is a pre-save operation: it restores the previous local state and
44283
+ * never writes to the backend. Pressing Save is the commit point — a
44284
+ * successful explicit save clears the history, after which Undo is disabled
44285
+ * until the user edits again.
44286
+ *
44287
+ * Ghost-link cleanup is the one exception to "never writes": when the revert
44288
+ * drops an item that a background auto-save had already linked, that link is
44289
+ * removed. Leaving it behind would resurrect the item on the next reload,
44290
+ * which is a bug in its own right rather than part of the undone state.
44133
44291
  */
44134
44292
  undo() {
44135
44293
  if (this.readonly())
@@ -44139,14 +44297,12 @@ class DashboardBuilder {
44139
44297
  this.flushPendingHistory();
44140
44298
  if (!this.undoStack.length)
44141
44299
  return;
44142
- // What is persisted right now, so we can reconcile the server below.
44143
44300
  const beforeItems = [...this.charts(), ...this.dialogs()];
44144
- const beforeFiltersSig = this.serializeFilters(this.filtersConfig());
44145
44301
  const previous = this.undoStack.pop();
44146
44302
  this.applyDashboardData(cloneDeep$1(previous));
44147
44303
  // Rebaseline to the ACTUAL restored document (applyDashboardData normalizes
44148
- // filters) so the history-capture effect treats this restore — and the
44149
- // persistence writes below — as a no-op rather than a fresh undoable change.
44304
+ // filters) so the history-capture effect treats this restore as a no-op
44305
+ // rather than a fresh undoable change.
44150
44306
  const restored = this.buildDashboardDataSnapshot();
44151
44307
  this.committedSnapshot = cloneDeep$1(restored);
44152
44308
  this.committedSignature = this.historySignature(restored);
@@ -44155,59 +44311,42 @@ class DashboardBuilder {
44155
44311
  this.undoStack.length = 0;
44156
44312
  this.canUndo.set(false);
44157
44313
  this.charts().forEach((chart) => this.reRenderItem(chart));
44314
+ // A reverted move/resize changes item geometry, so ask Gridster to lay the
44315
+ // grid out again rather than relying on per-item repositioning alone.
44316
+ this.gridsterContainer()?.updateGrid?.();
44158
44317
  const page = this.pageConfig();
44159
44318
  if (page)
44160
44319
  this.pageChange.emit(page);
44161
44320
  this.chartsChange.emit(this.charts());
44162
- // Standalone mode has no server; its `dashboardData` output already carries
44163
- // the reverted document via the emit effect.
44321
+ // Standalone mode has no backend links to clean up.
44164
44322
  if (this.standalone())
44165
44323
  return;
44166
- this.persistUndo(beforeItems, beforeFiltersSig, restored);
44324
+ this.unlinkItemsRemovedByUndo(beforeItems);
44167
44325
  }
44168
44326
  /**
44169
- * Roll the reverted document back to the server: unlink chart/dialog links
44170
- * the undo removed, re-save the restored charts/dialogs, and — only when they
44171
- * actually changed — rewrite the page filters. Each write is gated on a real
44172
- * diff so a layout/style undo doesn't rewrite filters and vice-versa.
44327
+ * Remove backend links for items the revert dropped.
44328
+ *
44329
+ * `saveDash` only ever upserts, so an already-linked item that is no longer
44330
+ * in the document would otherwise survive as an orphan and reappear on the
44331
+ * next load. This does NOT restore any other saved state — it only prevents
44332
+ * an item the user just undid from coming back.
44173
44333
  */
44174
- persistUndo(beforeItems, beforeFiltersSig, restored) {
44334
+ unlinkItemsRemovedByUndo(beforeItems) {
44175
44335
  const reportId = this.pageId();
44176
44336
  if (!reportId)
44177
44337
  return;
44178
- const currentItems = [...this.charts(), ...this.dialogs()];
44179
- const currentIds = new Set(currentItems
44338
+ const currentIds = new Set([...this.charts(), ...this.dialogs()]
44180
44339
  .map((it) => it.config?.serviceConfig?.dashboardId)
44181
44340
  .filter((v) => v != null));
44182
- // Unlink items that were persisted before but the undo removed.
44183
- const removed = beforeItems.filter((it) => it.chartComponentId != null &&
44184
- !currentIds.has(it.config?.serviceConfig?.dashboardId));
44185
- removed.forEach((it) => this.dashboardService
44341
+ beforeItems
44342
+ .filter((it) => it.chartComponentId != null &&
44343
+ !currentIds.has(it.config?.serviceConfig?.dashboardId))
44344
+ .forEach((it) => this.dashboardService
44186
44345
  .unlinkChart({
44187
44346
  reportId: Number(reportId),
44188
44347
  chartComponentId: it.chartComponentId,
44189
44348
  }, { silent: true })
44190
44349
  .subscribe({ next: () => { }, error: () => { } }));
44191
- // Re-save charts/dialogs when the item set / layout / config changed.
44192
- const itemsChanged = removed.length > 0 ||
44193
- this.serializeItems(currentItems) !== this.serializeItems(beforeItems);
44194
- if (itemsChanged) {
44195
- this.saveDash({ silent: true });
44196
- }
44197
- // Rewrite page filters only when they changed (updateReport is not silent,
44198
- // so gating avoids a spurious toast on every unrelated undo).
44199
- const afterFiltersSig = this.serializeFilters(restored.filters ?? []);
44200
- if (afterFiltersSig !== beforeFiltersSig) {
44201
- this.persistPageFilters();
44202
- }
44203
- }
44204
- /** Serialize page filters for change detection (normalized, order-stable). */
44205
- serializeFilters(filters) {
44206
- return JSON.stringify(this.normalizeFiltersConfig(filters));
44207
- }
44208
- /** Serialize items ignoring link ids so persistence metadata isn't compared. */
44209
- serializeItems(items) {
44210
- return JSON.stringify(items.map((it) => this.stripLinkIds(it)));
44211
44350
  }
44212
44351
  /**
44213
44352
  * Content signature of the whole document with link ids stripped, so a save
@@ -44298,6 +44437,9 @@ class DashboardBuilder {
44298
44437
  applyDashboardData(data) {
44299
44438
  const filters = data.filters ?? data.page?.dashboardConfig?.filters;
44300
44439
  this.applyingDashboardData = true;
44440
+ // The whole item set is being replaced (standalone apply or undo restore),
44441
+ // so previously recorded geometries no longer describe these charts.
44442
+ this.resetItemGeometryTracking();
44301
44443
  this.pageConfig.set(data.page ?? null);
44302
44444
  this.charts.set(data.charts ?? []);
44303
44445
  this.dialogs.set(data.dialogs ?? []);
@@ -44918,6 +45060,12 @@ class DashboardViewer {
44918
45060
  this.closeFiltersPanel();
44919
45061
  this.subscription.unsubscribe();
44920
45062
  this.storeService.updateQueryParams({});
45063
+ // The published route is a root-provided singleton. Leaving ours behind
45064
+ // made a later host (e.g. the builder) resolve `navigateToPage` relative to
45065
+ // a dead viewer route. Only retract it if it is still ours.
45066
+ if (this.route && this.dashboardService.activatedRoute() === this.route) {
45067
+ this.dashboardService.setActivatedRoute(null);
45068
+ }
44921
45069
  }
44922
45070
  setupSubscriptions() {
44923
45071
  // Publish our route so ActionService.navigateToPage can resolve sibling
@@ -45666,7 +45814,7 @@ class DashboardList {
45666
45814
  this.dashboards.reload();
45667
45815
  }
45668
45816
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, deps: [], target: i0.ɵɵFactoryTarget.Component });
45669
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page [title]=\"pageTitle() || t('dashboards')\">\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <div class=\"flex justify-between items-center gap-4\">\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
45817
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page [title]=\"pageTitle() || t('dashboards')\">\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <div class=\"flex justify-between items-center gap-4\">\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
45670
45818
  }
45671
45819
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, decorators: [{
45672
45820
  type: Component,
@@ -48686,4 +48834,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
48686
48834
  */
48687
48835
 
48688
48836
  export { RingGaugeChartHandler as $, StatisticCardComponent as A, TopbarCardComponent as B, CardContentComponent as C, DashboardItemStoreService as D, EChartComponent as E, FilterUtilsService as F, ChartDataService as G, HeaderCardComponent as H, BarChartHandler as I, PieChartHandler as J, StackBarChartHandler as K, LastHistoryLevelCardComponent as L, axisFormatters as M, groupDatesByYearAndMonth as N, GaugeChartHandler as O, PropertiesCardComponent as P, TableViewHandler as Q, OverviewCardHandler as R, StaticFiltersComponent as S, TableCardComponent as T, TimelineHandler as U, LineChartHandler as V, SnapshotHandler as W, ComparisonChartHandler as X, SplitterChartHandler as Y, LevelCardHandler as Z, MapChartHandler as _, DashboardItem as a, normalizeAggregateFunction as a$, SPlusChartHandler as a0, PhaseGateStepperHandler as a1, formatCurrency as a2, getCurrencySuffix as a3, formatPercentage as a4, formatNumber as a5, formatDate as a6, createAxisFormatter as a7, createTooltipFormatter as a8, formatAxisLabel as a9, ChartViewer as aA, StyleStudioDrawer as aB, StyleSettingsRenderer as aC, expandResetPatches as aD, StyleField as aE, SegmentedField as aF, ColorListField as aG, ArrayBuilderField as aH, KeyValueMapField as aI, LegendOrderField as aJ, ItemCardMenuComponent as aK, ChartFilterDrawer as aL, ItemContextToolbarComponent as aM, ItemConfigPopoverComponent as aN, GuidedConfigDialogComponent as aO, FilterChipsBarComponent as aP, FilterBuilderComponent as aQ, DatasourcePanelComponent as aR, SchemaControlRendererComponent as aS, FilterByGroupPipe as aT, GetChartActionsPipe as aU, CHART_CAPABILITIES as aV, getCapabilityById as aW, resolveCapability as aX, toBackendChartType as aY, normalizeChartTypeForRequest as aZ, normalizeFilterOperation as a_, formatWordsUnderBar as aa, formatXAxis as ab, handleFiltersForCustom as ac, handleFilterForCard as ad, handleFilterForSnapshot as ae, DashboardList as af, HTTPMethod as ag, DashboardBuilderService as ah, DashboardStoreService as ai, isManagePagesDeleteResult as aj, ManagePages as ak, ManageBreadcrumb as al, ManageFilterOnPage as am, DynamicFiltersConfig as an, ChartSettingsDrawer as ao, DisplaySettings as ap, DefaultControlUi as aq, PieControlUi as ar, BarControlUi as as, StackBarControlUi as at, ManageItem as au, CHART_TYPES as av, ManageItemService as aw, GeneralSettings as ax, DataSourceSettings as ay, ActionsSettings as az, DashboardBuilder as b, normalizeFilters as b0, selectorFromLegacy as b1, moduleIdFromSelector as b2, toBackendSourceLink as b3, toFormSourceLink as b4, normalizeOnLoad as b5, normalizeBeforeSave as b6, normalizeBeforeRequest as b7, CONFIG_DOMAINS as b8, domainsForCapability as b9, deepMerge$1 as bA, formatForEditor as bB, readByPath$1 as bC, setByPath as bD, applyControlPatchToPersisted as bE, applyControlPatchesToPersisted as bF, getControlSchema as bG, listControlSchemaIds as bH, listControlSchemas as bI, getFallbackControlSchema as bJ, flattenSchema as bK, resolveDisplayFields as bL, buildDisplayFieldPredicate as bM, bindingKey as bN, getBinding as bO, listBindings as bP, listBindingsForChart as bQ, readBoundValue as bR, ITEM_GUIDANCE_REGISTRY as bS, describeGuidance as bT, ItemGuidanceService as bU, findDomain as ba, POPOVER_TABS as bb, POPOVER_TAB_SPECS as bc, titleToUi as bd, applyTitleToPersisted as be, datasourceToUi as bf, fieldsToUi as bg, filtersToUi as bh, styleToUi as bi, applyStyleToPersisted as bj, layoutToUi as bk, applyLayoutToPersisted as bl, labelLegendFormatToUi as bm, applyLabelLegendFormatToPersisted as bn, behaviorToUi as bo, applyBehaviorToPersisted as bp, applyFilterChipsToPersisted as bq, persistedToUi as br, buildAssembly as bs, STYLE_PRESETS as bt, presetsForCapability as bu, findPreset as bv, validate as bw, hasBlockingIssues as bx, groupIssuesByDomain as by, parseAdvancedJson as bz, cloneDeep$1 as c, DashboardViewer as d, switchAllKeysSmall$1 as e, dynamicTextReplace as f, getNestedData as g, dynamicReorder as h, generalConfiguration as i, formatValue as j, getLocalizedTitle as k, sortChartData as l, addCommasToNumber as m, sortDataTableView as n, isMobilePlatform$1 as o, getColorFromConditions as p, CardFilterComponent as q, DynamicFiltersComponent as r, switchAllKeysToLower as s, CardInfoComponent as t, ChartCardComponent as u, EntityInfoComponent as v, normalizeDashboardCardEntityValue as w, EntityPreviewCardComponent as x, ListStatisticCardComponent as y, SkeletonCardComponent as z };
48689
- //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-B2u_ZfFj.mjs.map
48837
+ //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-Dz2al1ZI.mjs.map