@masterteam/dashboard-builder 0.0.122 → 0.0.123

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.
@@ -17788,7 +17788,7 @@ class ActionService {
17788
17788
  // "Dialog header"), not from the chart that opened it.
17789
17789
  const header = resolveDashboardDialogHeader(dialogConfig);
17790
17790
  // Dynamically import DashboardDialogComponent to avoid circular dependency
17791
- import('./masterteam-dashboard-builder-dashboard-dialog.component-B-PGAYTE.mjs').then(({ DashboardDialogComponent }) => {
17791
+ import('./masterteam-dashboard-builder-dashboard-dialog.component-B1B-3AzS.mjs').then(({ DashboardDialogComponent }) => {
17792
17792
  // Open dialog using ModalService
17793
17793
  this.modalService.openModal(DashboardDialogComponent, 'dialog', {
17794
17794
  header: header.title,
@@ -27012,9 +27012,9 @@ class DashboardItem {
27012
27012
  return merged;
27013
27013
  }
27014
27014
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
27015
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardItem, isStandalone: true, selector: "mt-dashboard-item", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartTypeId: { classPropertyName: "chartTypeId", publicName: "chartTypeId", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, useCachedDataOnly: { classPropertyName: "useCachedDataOnly", publicName: "useCachedDataOnly", isSignal: true, isRequired: false, transformFunction: null }, pageName: { classPropertyName: "pageName", publicName: "pageName", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, isDialog: { classPropertyName: "isDialog", publicName: "isDialog", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, reportId: { classPropertyName: "reportId", publicName: "reportId", isSignal: true, isRequired: false, transformFunction: null }, ignoreQueryFilter: { classPropertyName: "ignoreQueryFilter", publicName: "ignoreQueryFilter", isSignal: true, isRequired: false, transformFunction: null }, builderMode: { classPropertyName: "builderMode", publicName: "builderMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionTriggered: "actionTriggered", configureRequested: "configureRequested", titleEdited: "titleEdited" }, ngImport: i0, template: "@if (isLoading()) {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n} @else if (hasError()) {\r\n <div\r\n class=\"db-item-state db-item-state--error flex flex-col items-center justify-center h-full p-4 text-center\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n data-dashboard-ux-state=\"data-error\"\r\n >\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"text-4xl text-red-500 mb-2\"\r\n ></mt-icon>\r\n <p class=\"text-red-500 font-medium\">\r\n {{ t(\"guided.dataError\") }}\r\n </p>\r\n <p class=\"text-xs text-muted-color max-w-md leading-snug mt-1\">\r\n {{ errorMessage() || t(\"guided.dataErrorHint\") }}\r\n </p>\r\n <mt-button\r\n class=\"mt-2\"\r\n [label]=\"t('guided.retry')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n icon=\"arrow.refresh-cw-01\"\r\n (onClick)=\"refresh()\"\r\n data-dashboard-action=\"retry\"\r\n />\r\n </div>\r\n} @else if (needsConfiguration()) {\r\n <div\r\n class=\"db-item-state db-item-state--unconfigured flex h-full flex-col items-center justify-center gap-3 p-6 text-center bg-surface-50 rounded-md border border-dashed border-surface-300 relative\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [attr.data-dashboard-ux-state]=\"guidanceUxState()\"\r\n data-dashboard-primary-action=\"configure-datasource\"\r\n >\r\n <mt-icon\r\n [icon]=\"guidanceIcon()\"\r\n class=\"text-4xl text-primary-500\"\r\n ></mt-icon>\r\n\r\n <div class=\"flex flex-col items-center gap-1\">\r\n <h3 class=\"text-base font-semibold text-surface-700\">\r\n {{ guidanceTitle() }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color max-w-md leading-relaxed\">\r\n {{ guidanceHint() }}\r\n </p>\r\n </div>\r\n\r\n <mt-button\r\n [label]=\"guidancePrimaryLabel()\"\r\n [icon]=\"guidancePrimaryIcon()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n (onClick)=\"onConfigureRequested()\"\r\n data-dashboard-action=\"configure-datasource\"\r\n [attr.aria-label]=\"guidancePrimaryLabel()\"\r\n />\r\n\r\n @if (guidanceSecondaryLabel()) {\r\n <mt-button\r\n [label]=\"guidanceSecondaryLabel()\"\r\n [icon]=\"guidanceSecondaryIcon()\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n (onClick)=\"onSecondaryRequested()\"\r\n [attr.aria-label]=\"guidanceSecondaryLabel()\"\r\n />\r\n }\r\n </div>\r\n} @else {\r\n @switch (componentName()) {\r\n <!-- Chart Types -->\r\n @case (\"chart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Map Chart -->\r\n @case (\"map\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Background Text -->\r\n @case (\"BackgroundTextChart\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Chart Custom With Card Info -->\r\n @case (\"chartCustomWithCardInfo\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List of Charts -->\r\n @case (\"listOfcharts\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List of Cards Statistic -->\r\n @case (\"listOfCardsStatistic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Cards Statistic (single) -->\r\n @case (\"cardsStatistic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Header -->\r\n @case (\"header\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Footer (same as header) -->\r\n @case (\"footer\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Label (same as header) -->\r\n @case (\"label\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- List of Level Cards -->\r\n @case (\"listOfLevelCards\") {\r\n <mt-properties-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-properties-card>\r\n }\r\n\r\n @case (\"entitiesPreview\") {\r\n <mt-properties-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-properties-card>\r\n }\r\n\r\n <!-- Table. The table card renders the data grid, so it loads on demand\r\n (@defer) and the grid stays out of every host bundle that only imports\r\n the dashboard-builder main entry. -->\r\n @case (\"table\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Phase Gate Table -->\r\n @case (\"phaseGateTable\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Topbar -->\r\n @case (\"topbar\") {\r\n <mt-topbar-card\r\n [dashboardId]=\"dashboardId()\"\r\n [defaultBreadcrumbLabel]=\"pageName()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n ></mt-topbar-card>\r\n }\r\n\r\n <!-- Timeline -->\r\n @case (\"timeline\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Timeline Project Dependencies -->\r\n @case (\"timelineProjectDependencies\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Last History Level Card (TableView shape) -->\r\n @case (\"lastHistoryLevelCard\") {\r\n <mt-last-history-level-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-last-history-level-card>\r\n }\r\n\r\n <!-- Entity Preview -->\r\n @case (\"entityPreview\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Entity Preview With Formula -->\r\n @case (\"entityPreviewWithFormula\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Performance Card (BarV2Chart formula -> entity preview style) -->\r\n @case (\"performanceCard\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Performance Gauge Card (S+) -->\r\n @case (\"performanceGaugeCard\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Cluster Stacked Chart -->\r\n @case (\"clusterStackedChart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List Component S+ Card -->\r\n @case (\"listComponentSplusCard\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Splitter Chart -->\r\n @case (\"splitterChart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Repeater (same as header) -->\r\n @case (\"repeater\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Level Cards With Static -->\r\n @case (\"levelCardsWithStatic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Phase Gate Stepper Card -->\r\n @case (\"phaseGateStepperCard\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Dialog: rendered inside DashboardDialogComponent as a Table view.\r\n Header hidden \u2014 the dialog header already names it. -->\r\n @case (\"dialog\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n [hideHeader]=\"true\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Default: try chart -->\r\n @default {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n }\r\n}\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: ChartCardComponent, selector: "mt-chart-card", inputs: ["dashboardId", "reportId", "inGroup", "isConfigMode", "titleEditable"], outputs: ["onAction", "onConfigure", "onTitleChange"] }, { kind: "component", type: ListStatisticCardComponent, selector: "mt-list-statistic-card", inputs: ["dashboardId"], outputs: ["onAction"] }, { kind: "component", type: HeaderCardComponent, selector: "mt-header-card", inputs: ["dashboardId", "titleEditable"], outputs: ["onAction", "titleChange"] }, { kind: "component", type: TopbarCardComponent, selector: "mt-topbar-card", inputs: ["dashboardId", "defaultBreadcrumbLabel", "titleEditable"], outputs: ["titleChange"] }, { kind: "component", type: SkeletonCardComponent, selector: "mt-skeleton-card", inputs: ["dashboardId"] }, { kind: "component", type: PropertiesCardComponent, selector: "mt-properties-card, mt-entities-preview-card", inputs: ["dashboardId", "inGroup"], outputs: ["onAction"] }, { kind: "component", type: EntityPreviewCardComponent, selector: "mt-entity-preview-card", inputs: ["dashboardId"] }, { kind: "component", type: LastHistoryLevelCardComponent, selector: "mt-last-history-level-card", inputs: ["dashboardId", "reportId", "inGroup"], outputs: ["onAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [import('./masterteam-dashboard-builder-table-card.component-C6Lt4LcU.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-C6Lt4LcU.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-C6Lt4LcU.mjs').then(m => m.TableCardComponent)]] });
27015
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardItem, isStandalone: true, selector: "mt-dashboard-item", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartTypeId: { classPropertyName: "chartTypeId", publicName: "chartTypeId", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, useCachedDataOnly: { classPropertyName: "useCachedDataOnly", publicName: "useCachedDataOnly", isSignal: true, isRequired: false, transformFunction: null }, pageName: { classPropertyName: "pageName", publicName: "pageName", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, isDialog: { classPropertyName: "isDialog", publicName: "isDialog", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, reportId: { classPropertyName: "reportId", publicName: "reportId", isSignal: true, isRequired: false, transformFunction: null }, ignoreQueryFilter: { classPropertyName: "ignoreQueryFilter", publicName: "ignoreQueryFilter", isSignal: true, isRequired: false, transformFunction: null }, builderMode: { classPropertyName: "builderMode", publicName: "builderMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionTriggered: "actionTriggered", configureRequested: "configureRequested", titleEdited: "titleEdited" }, ngImport: i0, template: "@if (isLoading()) {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n} @else if (hasError()) {\r\n <div\r\n class=\"db-item-state db-item-state--error flex flex-col items-center justify-center h-full p-4 text-center\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n data-dashboard-ux-state=\"data-error\"\r\n >\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"text-4xl text-red-500 mb-2\"\r\n ></mt-icon>\r\n <p class=\"text-red-500 font-medium\">\r\n {{ t(\"guided.dataError\") }}\r\n </p>\r\n <p class=\"text-xs text-muted-color max-w-md leading-snug mt-1\">\r\n {{ errorMessage() || t(\"guided.dataErrorHint\") }}\r\n </p>\r\n <mt-button\r\n class=\"mt-2\"\r\n [label]=\"t('guided.retry')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n icon=\"arrow.refresh-cw-01\"\r\n (onClick)=\"refresh()\"\r\n data-dashboard-action=\"retry\"\r\n />\r\n </div>\r\n} @else if (needsConfiguration()) {\r\n <div\r\n class=\"db-item-state db-item-state--unconfigured flex h-full flex-col items-center justify-center gap-3 p-6 text-center bg-surface-50 rounded-md border border-dashed border-surface-300 relative\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [attr.data-dashboard-ux-state]=\"guidanceUxState()\"\r\n data-dashboard-primary-action=\"configure-datasource\"\r\n >\r\n <mt-icon\r\n [icon]=\"guidanceIcon()\"\r\n class=\"text-4xl text-primary-500\"\r\n ></mt-icon>\r\n\r\n <div class=\"flex flex-col items-center gap-1\">\r\n <h3 class=\"text-base font-semibold text-surface-700\">\r\n {{ guidanceTitle() }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color max-w-md leading-relaxed\">\r\n {{ guidanceHint() }}\r\n </p>\r\n </div>\r\n\r\n <mt-button\r\n [label]=\"guidancePrimaryLabel()\"\r\n [icon]=\"guidancePrimaryIcon()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n (onClick)=\"onConfigureRequested()\"\r\n data-dashboard-action=\"configure-datasource\"\r\n [attr.aria-label]=\"guidancePrimaryLabel()\"\r\n />\r\n\r\n @if (guidanceSecondaryLabel()) {\r\n <mt-button\r\n [label]=\"guidanceSecondaryLabel()\"\r\n [icon]=\"guidanceSecondaryIcon()\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n (onClick)=\"onSecondaryRequested()\"\r\n [attr.aria-label]=\"guidanceSecondaryLabel()\"\r\n />\r\n }\r\n </div>\r\n} @else {\r\n @switch (componentName()) {\r\n <!-- Chart Types -->\r\n @case (\"chart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Map Chart -->\r\n @case (\"map\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Background Text -->\r\n @case (\"BackgroundTextChart\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Chart Custom With Card Info -->\r\n @case (\"chartCustomWithCardInfo\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List of Charts -->\r\n @case (\"listOfcharts\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List of Cards Statistic -->\r\n @case (\"listOfCardsStatistic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Cards Statistic (single) -->\r\n @case (\"cardsStatistic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Header -->\r\n @case (\"header\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Footer (same as header) -->\r\n @case (\"footer\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Label (same as header) -->\r\n @case (\"label\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- List of Level Cards -->\r\n @case (\"listOfLevelCards\") {\r\n <mt-properties-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-properties-card>\r\n }\r\n\r\n @case (\"entitiesPreview\") {\r\n <mt-properties-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-properties-card>\r\n }\r\n\r\n <!-- Table. The table card renders the data grid, so it loads on demand\r\n (@defer) and the grid stays out of every host bundle that only imports\r\n the dashboard-builder main entry. -->\r\n @case (\"table\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Phase Gate Table -->\r\n @case (\"phaseGateTable\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Topbar -->\r\n @case (\"topbar\") {\r\n <mt-topbar-card\r\n [dashboardId]=\"dashboardId()\"\r\n [defaultBreadcrumbLabel]=\"pageName()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n ></mt-topbar-card>\r\n }\r\n\r\n <!-- Timeline -->\r\n @case (\"timeline\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Timeline Project Dependencies -->\r\n @case (\"timelineProjectDependencies\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Last History Level Card (TableView shape) -->\r\n @case (\"lastHistoryLevelCard\") {\r\n <mt-last-history-level-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-last-history-level-card>\r\n }\r\n\r\n <!-- Entity Preview -->\r\n @case (\"entityPreview\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Entity Preview With Formula -->\r\n @case (\"entityPreviewWithFormula\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Performance Card (BarV2Chart formula -> entity preview style) -->\r\n @case (\"performanceCard\") {\r\n <mt-entity-preview-card [dashboardId]=\"dashboardId()\">\r\n </mt-entity-preview-card>\r\n }\r\n\r\n <!-- Performance Gauge Card (S+) -->\r\n @case (\"performanceGaugeCard\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Cluster Stacked Chart -->\r\n @case (\"clusterStackedChart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- List Component S+ Card -->\r\n @case (\"listComponentSplusCard\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Splitter Chart -->\r\n @case (\"splitterChart\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Repeater (same as header) -->\r\n @case (\"repeater\") {\r\n <mt-header-card\r\n [dashboardId]=\"dashboardId()\"\r\n [titleEditable]=\"false\"\r\n (titleChange)=\"onTitleChange($event)\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-header-card>\r\n }\r\n\r\n <!-- Level Cards With Static -->\r\n @case (\"levelCardsWithStatic\") {\r\n <mt-list-statistic-card\r\n [dashboardId]=\"dashboardId()\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-list-statistic-card>\r\n }\r\n\r\n <!-- Phase Gate Stepper Card -->\r\n @case (\"phaseGateStepperCard\") {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n\r\n <!-- Dialog: rendered inside DashboardDialogComponent as a Table view.\r\n Header hidden \u2014 the dialog header already names it. -->\r\n @case (\"dialog\") {\r\n @defer (on immediate) {\r\n <mt-table-card\r\n [dashboardId]=\"dashboardId()\"\r\n [inGroup]=\"inGroup()\"\r\n [hideHeader]=\"true\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n >\r\n </mt-table-card>\r\n } @placeholder {\r\n <mt-skeleton-card [dashboardId]=\"dashboardId()\"></mt-skeleton-card>\r\n }\r\n }\r\n\r\n <!-- Default: try chart -->\r\n @default {\r\n <mt-chart-card\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [inGroup]=\"inGroup()\"\r\n [titleEditable]=\"false\"\r\n (onAction)=\"doActions($event.data, $event.type)\"\r\n (onConfigure)=\"onConfigureRequested()\"\r\n (onTitleChange)=\"onTitleChange($event)\"\r\n >\r\n </mt-chart-card>\r\n }\r\n }\r\n}\r\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: ChartCardComponent, selector: "mt-chart-card", inputs: ["dashboardId", "reportId", "inGroup", "isConfigMode", "titleEditable"], outputs: ["onAction", "onConfigure", "onTitleChange"] }, { kind: "component", type: ListStatisticCardComponent, selector: "mt-list-statistic-card", inputs: ["dashboardId"], outputs: ["onAction"] }, { kind: "component", type: HeaderCardComponent, selector: "mt-header-card", inputs: ["dashboardId", "titleEditable"], outputs: ["onAction", "titleChange"] }, { kind: "component", type: TopbarCardComponent, selector: "mt-topbar-card", inputs: ["dashboardId", "defaultBreadcrumbLabel", "titleEditable"], outputs: ["titleChange"] }, { kind: "component", type: SkeletonCardComponent, selector: "mt-skeleton-card", inputs: ["dashboardId"] }, { kind: "component", type: PropertiesCardComponent, selector: "mt-properties-card, mt-entities-preview-card", inputs: ["dashboardId", "inGroup"], outputs: ["onAction"] }, { kind: "component", type: EntityPreviewCardComponent, selector: "mt-entity-preview-card", inputs: ["dashboardId"] }, { kind: "component", type: LastHistoryLevelCardComponent, selector: "mt-last-history-level-card", inputs: ["dashboardId", "reportId", "inGroup"], outputs: ["onAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [import('./masterteam-dashboard-builder-table-card.component-DhQqLNuw.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-DhQqLNuw.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-DhQqLNuw.mjs').then(m => m.TableCardComponent)]] });
27016
27016
  }
27017
- i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, resolveDeferredDeps: () => [import('./masterteam-dashboard-builder-table-card.component-C6Lt4LcU.mjs').then(m => m.TableCardComponent)], resolveMetadata: TableCardComponent => ({ decorators: [{
27017
+ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, resolveDeferredDeps: () => [import('./masterteam-dashboard-builder-table-card.component-DhQqLNuw.mjs').then(m => m.TableCardComponent)], resolveMetadata: TableCardComponent => ({ decorators: [{
27018
27018
  type: Component,
27019
27019
  args: [{ selector: 'mt-dashboard-item', standalone: true, imports: [
27020
27020
  CommonModule,
@@ -48956,7 +48956,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
48956
48956
  * A static import here would put the whole grid in every host bundle that imports
48957
48957
  * `@masterteam/dashboard-builder`.
48958
48958
  */
48959
- const loadTableCard = () => import('./masterteam-dashboard-builder-table-card.component-C6Lt4LcU.mjs').then((m) => m.TableCardComponent);
48959
+ const loadTableCard = () => import('./masterteam-dashboard-builder-table-card.component-DhQqLNuw.mjs').then((m) => m.TableCardComponent);
48960
48960
 
48961
48961
  /**
48962
48962
  * Dashboard Item Components Index
@@ -49120,6 +49120,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
49120
49120
  ], 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 [formControl]=\"searchControl\"\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 @if (assist()?.typeIds().has(widget.id)) {\r\n <ng-container\r\n *ngComponentOutlet=\"\r\n assist()!.paletteTile;\r\n inputs: { widget, label: t('widget.' + widget.id) };\r\n injector: tileInjector\r\n \"\r\n />\r\n } @else {\r\n <button\r\n type=\"button\"\r\n class=\"flex min-h-24 w-full text-start flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-surface-0 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 [attr.title]=\"t('widget.' + widget.id)\"\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 >{{ t(\"widget.\" + widget.id) }}</span\r\n >\r\n </button>\r\n }\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" }]
49121
49121
  }], propDecorators: { assist: [{ type: i0.Input, args: [{ isSignal: true, alias: "assist", required: false }] }], product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: false }] }] } });
49122
49122
 
49123
+ /** Item keys the undo history and the unsaved-changes check ignore. */
49124
+ const HISTORY_IGNORED_ITEM_KEYS = new Set([
49125
+ 'id',
49126
+ 'chartComponentId',
49127
+ 'loading',
49128
+ 'quickManage',
49129
+ ]);
49123
49130
  /**
49124
49131
  * Dashboard Builder Component
49125
49132
  *
@@ -49266,8 +49273,17 @@ class DashboardBuilder {
49266
49273
  previewDocument = signal(null, ...(ngDevMode ? [{ debugName: "previewDocument" }] : /* istanbul ignore next */ []));
49267
49274
  isReadonly = computed(() => this.readonly() || this.preview(), ...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
49268
49275
  pendingWidgetType = signal(null, ...(ngDevMode ? [{ debugName: "pendingWidgetType" }] : /* istanbul ignore next */ []));
49269
- /** Whether the most recent action can be reverted (drives the Undo button). */
49276
+ /** Whether an unsaved action can be reverted (drives the Undo button). */
49270
49277
  canUndo = signal(false, ...(ngDevMode ? [{ debugName: "canUndo" }] : /* istanbul ignore next */ []));
49278
+ /** Whether an undone action can be re-applied (drives the Redo button). */
49279
+ canRedo = signal(false, ...(ngDevMode ? [{ debugName: "canRedo" }] : /* istanbul ignore next */ []));
49280
+ /**
49281
+ * The document differs from the last load or explicit Save. Drives every
49282
+ * "leave with unsaved changes" guard. Not `canUndo`: after undoing some of
49283
+ * several edits there is still unsaved work, and after undoing all of them
49284
+ * there is none.
49285
+ */
49286
+ hasUnsavedChanges = signal(false, ...(ngDevMode ? [{ debugName: "hasUnsavedChanges" }] : /* istanbul ignore next */ []));
49271
49287
  /** Reference to widget palette drawer */
49272
49288
  widgetPaletteRef = null;
49273
49289
  /** Reference to chart settings drawer */
@@ -49382,9 +49398,12 @@ class DashboardBuilder {
49382
49398
  * to tell that a drag/resize actually moved something (issue #1192).
49383
49399
  */
49384
49400
  lastItemGeometry = new Map();
49385
- // Undo history (issue #1192): deep-cloned whole-document snapshots.
49401
+ // Undo / redo history (issue #1192): deep-cloned whole-document snapshots.
49386
49402
  undoStack = [];
49403
+ redoStack = [];
49387
49404
  HISTORY_LIMIT = 30;
49405
+ /** Signature of the document as last loaded or explicitly saved. */
49406
+ savedSignature = null;
49388
49407
  /** Set by "Save and leave": leave once that explicit save commits. */
49389
49408
  leaveAfterSave = false;
49390
49409
  committedSnapshot = null;
@@ -49821,6 +49840,8 @@ class DashboardBuilder {
49821
49840
  this.resetHistory();
49822
49841
  this.committedSnapshot = cloneDeep$1(this.buildDashboardDataSnapshot());
49823
49842
  this.committedSignature = this.historySignature(this.committedSnapshot);
49843
+ this.savedSignature = this.committedSignature;
49844
+ this.syncHistoryState();
49824
49845
  }
49825
49846
  /**
49826
49847
  * Persist the page-level filters through the dashboard (report) endpoint —
@@ -49890,7 +49911,7 @@ class DashboardBuilder {
49890
49911
  persist: !this.standalone() && this.effectivePageId() != null,
49891
49912
  showPublish: !this.standalone(),
49892
49913
  allowDuplicate: !this.standalone() && this.effectivePageId() != null,
49893
- unsavedChanges: this.canUndo(),
49914
+ unsavedChanges: this.unsavedChangesNow(),
49894
49915
  },
49895
49916
  });
49896
49917
  ref.onClose.subscribe((result) => {
@@ -50044,17 +50065,23 @@ class DashboardBuilder {
50044
50065
  // ============================================
50045
50066
  /**
50046
50067
  * Edits — a Style Apply included — live in the document until the top Save
50047
- * writes them. `canUndo` is true exactly while there are such edits (an
50048
- * explicit save clears it), so leaving then asks first (#1883).
50068
+ * writes them, so leaving with any of them asks first (#1883). The check is
50069
+ * "differs from the last save" (`hasUnsavedChanges`), never `canUndo`: an
50070
+ * undo of one of several edits leaves unsaved work behind.
50049
50071
  */
50050
50072
  onBeforeUnload(event) {
50051
- if (!this.canUndo() || this.readonly())
50073
+ if (!this.unsavedChangesNow() || this.readonly())
50052
50074
  return;
50053
50075
  event.preventDefault();
50054
50076
  event.returnValue = '';
50055
50077
  }
50078
+ /** Unsaved changes, counting an edit still inside the history debounce. */
50079
+ unsavedChangesNow() {
50080
+ this.flushPendingHistory();
50081
+ return this.hasUnsavedChanges();
50082
+ }
50056
50083
  onBackClick() {
50057
- if (!this.canUndo() || this.readonly()) {
50084
+ if (!this.unsavedChangesNow() || this.readonly()) {
50058
50085
  this.onBack.emit();
50059
50086
  return;
50060
50087
  }
@@ -50096,19 +50123,29 @@ class DashboardBuilder {
50096
50123
  this.pasteSelectedCharts();
50097
50124
  }
50098
50125
  }
50099
- if ((event.ctrlKey || event.metaKey) &&
50100
- event.key.toLowerCase() === 'z' &&
50101
- !event.shiftKey) {
50102
- // Don't hijack native undo while the user is typing in a field/editor.
50103
- const target = event.target;
50104
- const tag = target?.tagName?.toLowerCase();
50105
- const isEditable = tag === 'input' ||
50106
- tag === 'textarea' ||
50107
- target?.isContentEditable === true;
50108
- if (!isEditable && this.canUndo()) {
50109
- event.preventDefault();
50110
- this.undo();
50111
- }
50126
+ if (!(event.ctrlKey || event.metaKey))
50127
+ return;
50128
+ const key = event.key.toLowerCase();
50129
+ const isUndo = key === 'z' && !event.shiftKey;
50130
+ // Redo: Ctrl+Y (Windows) or Ctrl/Cmd+Shift+Z (macOS and most editors).
50131
+ const isRedo = key === 'y' || (key === 'z' && event.shiftKey);
50132
+ if (!isUndo && !isRedo)
50133
+ return;
50134
+ // Don't hijack native undo / redo while the user is typing in a field.
50135
+ const target = event.target;
50136
+ const tag = target?.tagName?.toLowerCase();
50137
+ const isEditable = tag === 'input' ||
50138
+ tag === 'textarea' ||
50139
+ target?.isContentEditable === true;
50140
+ if (isEditable)
50141
+ return;
50142
+ if (isUndo && this.canUndo()) {
50143
+ event.preventDefault();
50144
+ this.undo();
50145
+ }
50146
+ else if (isRedo && this.canRedo()) {
50147
+ event.preventDefault();
50148
+ this.redo();
50112
50149
  }
50113
50150
  }
50114
50151
  onSelect(chart, event) {
@@ -51869,24 +51906,39 @@ class DashboardBuilder {
51869
51906
  // link-id patch a save writes back is never recorded as its own undo step.
51870
51907
  const signature = this.historySignature(current);
51871
51908
  // First observed document (initial / standalone load) is the baseline —
51872
- // there is nothing before it to undo to.
51909
+ // there is nothing before it to undo to, and it is what "saved" means.
51873
51910
  if (this.committedSignature === null) {
51874
51911
  this.committedSnapshot = cloneDeep$1(current);
51875
51912
  this.committedSignature = signature;
51913
+ this.savedSignature = signature;
51914
+ this.syncHistoryState();
51876
51915
  return;
51877
51916
  }
51878
51917
  // No real change (e.g. the echo of an undo restore) — nothing to record.
51879
51918
  if (signature === this.committedSignature)
51880
51919
  return;
51881
51920
  if (this.committedSnapshot) {
51882
- this.undoStack.push(this.committedSnapshot);
51883
- if (this.undoStack.length > this.HISTORY_LIMIT) {
51884
- this.undoStack.shift();
51885
- }
51886
- this.canUndo.set(true);
51921
+ this.pushUndo(this.committedSnapshot);
51887
51922
  }
51923
+ // A new edit branches the history: what was undone can no longer be redone.
51924
+ this.redoStack.length = 0;
51888
51925
  this.committedSnapshot = cloneDeep$1(current);
51889
51926
  this.committedSignature = signature;
51927
+ this.syncHistoryState();
51928
+ }
51929
+ pushUndo(snapshot) {
51930
+ this.undoStack.push(snapshot);
51931
+ if (this.undoStack.length > this.HISTORY_LIMIT) {
51932
+ this.undoStack.shift();
51933
+ }
51934
+ }
51935
+ /** Mirror the stacks and the saved baseline into the toolbar signals. */
51936
+ syncHistoryState() {
51937
+ this.canUndo.set(this.undoStack.length > 0);
51938
+ this.canRedo.set(this.redoStack.length > 0);
51939
+ this.hasUnsavedChanges.set(this.committedSignature !== null &&
51940
+ this.savedSignature !== null &&
51941
+ this.committedSignature !== this.savedSignature);
51890
51942
  }
51891
51943
  /** Commit a still-pending capture immediately (used right before an undo). */
51892
51944
  flushPendingHistory() {
@@ -51902,12 +51954,15 @@ class DashboardBuilder {
51902
51954
  }
51903
51955
  this.historyDebounce = null;
51904
51956
  this.undoStack.length = 0;
51957
+ this.redoStack.length = 0;
51905
51958
  this.committedSnapshot = null;
51906
51959
  this.committedSignature = null;
51907
- this.canUndo.set(false);
51960
+ this.savedSignature = null;
51961
+ this.syncHistoryState();
51908
51962
  }
51909
51963
  /**
51910
- * Revert the most recent UNSAVED action (issue #1192).
51964
+ * Revert the most recent UNSAVED action (issue #1192), one step per call, up
51965
+ * to HISTORY_LIMIT steps back.
51911
51966
  *
51912
51967
  * Undo is a pre-save operation: it restores the previous local state and
51913
51968
  * never writes to the backend. Pressing Save is the commit point — a
@@ -51928,17 +51983,37 @@ class DashboardBuilder {
51928
51983
  if (!this.undoStack.length)
51929
51984
  return;
51930
51985
  const previous = this.undoStack.pop();
51931
- this.applyHistorySnapshot(previous);
51986
+ if (this.committedSnapshot)
51987
+ this.redoStack.push(this.committedSnapshot);
51988
+ this.restoreHistoryStep(previous);
51989
+ }
51990
+ /**
51991
+ * Re-apply the most recently undone action. A new edit after an undo clears
51992
+ * what can be redone (captureHistory). Same ghost-link rule as undo: an item
51993
+ * the redo drops is unlinked; an item it brings back is linked again by the
51994
+ * next save.
51995
+ */
51996
+ redo() {
51997
+ if (this.isReadonly())
51998
+ return;
51999
+ // A pending edit is a new branch: recording it clears the redo stack.
52000
+ this.flushPendingHistory();
52001
+ if (!this.redoStack.length)
52002
+ return;
52003
+ const next = this.redoStack.pop();
52004
+ if (this.committedSnapshot)
52005
+ this.pushUndo(this.committedSnapshot);
52006
+ this.restoreHistoryStep(next);
52007
+ }
52008
+ restoreHistoryStep(snapshot) {
52009
+ this.applyHistorySnapshot(snapshot);
51932
52010
  // Rebaseline to the ACTUAL restored document (applyDashboardData normalizes
51933
52011
  // filters) so the history-capture effect treats this restore as a no-op
51934
52012
  // rather than a fresh undoable change.
51935
52013
  const restored = this.buildDashboardDataSnapshot();
51936
52014
  this.committedSnapshot = cloneDeep$1(restored);
51937
52015
  this.committedSignature = this.historySignature(restored);
51938
- // Single-level undo: once the last action is reverted, disable the button
51939
- // until the user makes another change (captureHistory re-enables it).
51940
- this.undoStack.length = 0;
51941
- this.canUndo.set(false);
52016
+ this.syncHistoryState();
51942
52017
  }
51943
52018
  applyHistorySnapshot(snapshot) {
51944
52019
  const beforeItems = [...this.charts(), ...this.dialogs()];
@@ -51990,12 +52065,17 @@ class DashboardBuilder {
51990
52065
  filters: data.filters ?? [],
51991
52066
  });
51992
52067
  }
51993
- /** Shallow copy of an item without the `id` / `chartComponentId` link keys. */
52068
+ /**
52069
+ * Shallow copy of an item without the `id` / `chartComponentId` link keys and
52070
+ * the runtime-only flags (`loading`, `quickManage`), which are never saved.
52071
+ * `reRenderItem` sets `loading` on every restored chart, so leaving it in
52072
+ * made a fully undone document look different from the saved one.
52073
+ */
51994
52074
  stripLinkIds(item) {
51995
52075
  const source = (item ?? {});
51996
52076
  const out = {};
51997
52077
  for (const key of Object.keys(source)) {
51998
- if (key !== 'id' && key !== 'chartComponentId')
52078
+ if (!HISTORY_IGNORED_ITEM_KEYS.has(key))
51999
52079
  out[key] = source[key];
52000
52080
  }
52001
52081
  return out;
@@ -52007,7 +52087,7 @@ class DashboardBuilder {
52007
52087
  });
52008
52088
  // Tell the action service and the actions drawer what is open here.
52009
52089
  effect(() => {
52010
- this.dashboardService.unsavedBuilderChanges.set(this.canUndo() && !this.readonly());
52090
+ this.dashboardService.unsavedBuilderChanges.set(this.hasUnsavedChanges() && !this.readonly());
52011
52091
  this.dashboardService.currentPageId.set(this.effectivePageId());
52012
52092
  });
52013
52093
  // Apply standalone data when provided
@@ -52166,7 +52246,7 @@ class DashboardBuilder {
52166
52246
  return current;
52167
52247
  }
52168
52248
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
52169
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardBuilder, isStandalone: true, selector: "mt-dashboard-builder", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, newPage: { classPropertyName: "newPage", publicName: "newPage", isSignal: true, isRequired: false, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, services: { classPropertyName: "services", publicName: "services", isSignal: true, isRequired: false, transformFunction: null }, product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogsResolver: { classPropertyName: "levelLogsResolver", publicName: "levelLogsResolver", isSignal: true, isRequired: false, transformFunction: null }, itemMarks: { classPropertyName: "itemMarks", publicName: "itemMarks", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardData: "dashboardDataChange", pageChange: "pageChange", chartsChange: "chartsChange", widgetAssist: "widgetAssist", itemAssist: "itemAssist", itemMarks: "itemMarksChange", onSave: "onSave", pageCreated: "pageCreated", onBack: "onBack", onAddChart: "onAddChart", onEditChart: "onEditChart" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "window:keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["contextMenu"], descendants: true, isSignal: true }, { propertyName: "gridsterContainer", first: true, predicate: ["gridsterContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBackClick()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (preview()) {\r\n <!--\r\n Preview renders the reader's own component with the unsaved\r\n document, so it looks exactly like the published page. The editing\r\n grid is unmounted meanwhile: both would share the per-widget store\r\n entries (same dashboardId), and a widget clears its entry on destroy.\r\n -->\r\n <mt-dashboard-viewer\r\n class=\"db-builder-preview block\"\r\n [isPage]=\"false\"\r\n [pageId]=\"effectivePageId()\"\r\n [dashboardData]=\"previewDocument()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [lookups]=\"lookups()\"\r\n [statuses]=\"statuses()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogsResolver]=\"levelLogsResolver()\"\r\n />\r\n } @else {\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n [class]=\"itemMarkClass(chart)\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n @if (itemMarkLabel(chart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(chart)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName ===\r\n \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig\r\n ?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(selectedChild)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"\r\n requestLayoutTitleEdit(chart, $event)\r\n \"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div\r\n class=\"relative h-full min-h-0\"\r\n [class]=\"itemMarkClass(childChart)\"\r\n [attr.data-chart-id]=\"\r\n childChart.config?.serviceConfig?.dashboardId\r\n \"\r\n >\r\n @if (itemMarkLabel(childChart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n }\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\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: "ngmodule", type: GridsterModule }, { kind: "component", type: i2$4.GridsterComponent, selector: "gridster", inputs: ["options"] }, { kind: "component", type: i2$4.GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { 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", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "ngmodule", type: ContextMenuModule }, { kind: "component", type: i3$1.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "useCachedDataOnly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "reportId", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { 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: ItemCardMenuComponent, selector: "mt-item-card-menu", inputs: ["assistLabel", "assistIcon", "allowDuplicate", "hasLinkedDialog", "canLinkDialog"], outputs: ["action"] }, { kind: "component", type: DashboardViewer, selector: "mt-dashboard-viewer", inputs: ["isPage", "pageTitle", "backButton", "pageId", "dashboardData", "chartsData", "dialogsData", "filtersData", "extraFilters", "lookups", "statuses", "levelsSchema", "levelLogsResolver", "showFilters", "showFilterTrigger", "ignoreQueryFilter"], outputs: ["pageLoaded", "onBack", "chartClick"] }, { kind: "pipe", type: FilterByGroupPipe, name: "filterByGroup" }], encapsulation: i0.ViewEncapsulation.None });
52249
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardBuilder, isStandalone: true, selector: "mt-dashboard-builder", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, newPage: { classPropertyName: "newPage", publicName: "newPage", isSignal: true, isRequired: false, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, services: { classPropertyName: "services", publicName: "services", isSignal: true, isRequired: false, transformFunction: null }, product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogsResolver: { classPropertyName: "levelLogsResolver", publicName: "levelLogsResolver", isSignal: true, isRequired: false, transformFunction: null }, itemMarks: { classPropertyName: "itemMarks", publicName: "itemMarks", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardData: "dashboardDataChange", pageChange: "pageChange", chartsChange: "chartsChange", widgetAssist: "widgetAssist", itemAssist: "itemAssist", itemMarks: "itemMarksChange", onSave: "onSave", pageCreated: "pageCreated", onBack: "onBack", onAddChart: "onAddChart", onEditChart: "onEditChart" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "window:keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["contextMenu"], descendants: true, isSignal: true }, { propertyName: "gridsterContainer", first: true, predicate: ["gridsterContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-right\"\r\n [tooltip]=\"t('redo')\"\r\n (onClick)=\"redo()\"\r\n [disabled]=\"!canRedo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBackClick()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (preview()) {\r\n <!--\r\n Preview renders the reader's own component with the unsaved\r\n document, so it looks exactly like the published page. The editing\r\n grid is unmounted meanwhile: both would share the per-widget store\r\n entries (same dashboardId), and a widget clears its entry on destroy.\r\n -->\r\n <mt-dashboard-viewer\r\n class=\"db-builder-preview block\"\r\n [isPage]=\"false\"\r\n [pageId]=\"effectivePageId()\"\r\n [dashboardData]=\"previewDocument()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [lookups]=\"lookups()\"\r\n [statuses]=\"statuses()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogsResolver]=\"levelLogsResolver()\"\r\n />\r\n } @else {\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n [class]=\"itemMarkClass(chart)\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n @if (itemMarkLabel(chart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(chart)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName ===\r\n \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig\r\n ?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(selectedChild)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"\r\n requestLayoutTitleEdit(chart, $event)\r\n \"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div\r\n class=\"relative h-full min-h-0\"\r\n [class]=\"itemMarkClass(childChart)\"\r\n [attr.data-chart-id]=\"\r\n childChart.config?.serviceConfig?.dashboardId\r\n \"\r\n >\r\n @if (itemMarkLabel(childChart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n }\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\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: "ngmodule", type: GridsterModule }, { kind: "component", type: i2$4.GridsterComponent, selector: "gridster", inputs: ["options"] }, { kind: "component", type: i2$4.GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { 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", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "ngmodule", type: ContextMenuModule }, { kind: "component", type: i3$1.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "useCachedDataOnly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "reportId", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { 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: ItemCardMenuComponent, selector: "mt-item-card-menu", inputs: ["assistLabel", "assistIcon", "allowDuplicate", "hasLinkedDialog", "canLinkDialog"], outputs: ["action"] }, { kind: "component", type: DashboardViewer, selector: "mt-dashboard-viewer", inputs: ["isPage", "pageTitle", "backButton", "pageId", "dashboardData", "chartsData", "dialogsData", "filtersData", "extraFilters", "lookups", "statuses", "levelsSchema", "levelLogsResolver", "showFilters", "showFilterTrigger", "ignoreQueryFilter"], outputs: ["pageLoaded", "onBack", "chartClick"] }, { kind: "pipe", type: FilterByGroupPipe, name: "filterByGroup" }], encapsulation: i0.ViewEncapsulation.None });
52170
52250
  }
52171
52251
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardBuilder, decorators: [{
52172
52252
  type: Component,
@@ -52182,7 +52262,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
52182
52262
  CardContentComponent,
52183
52263
  ItemCardMenuComponent,
52184
52264
  DashboardViewer,
52185
- ], encapsulation: ViewEncapsulation.None, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBackClick()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (preview()) {\r\n <!--\r\n Preview renders the reader's own component with the unsaved\r\n document, so it looks exactly like the published page. The editing\r\n grid is unmounted meanwhile: both would share the per-widget store\r\n entries (same dashboardId), and a widget clears its entry on destroy.\r\n -->\r\n <mt-dashboard-viewer\r\n class=\"db-builder-preview block\"\r\n [isPage]=\"false\"\r\n [pageId]=\"effectivePageId()\"\r\n [dashboardData]=\"previewDocument()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [lookups]=\"lookups()\"\r\n [statuses]=\"statuses()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogsResolver]=\"levelLogsResolver()\"\r\n />\r\n } @else {\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n [class]=\"itemMarkClass(chart)\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n @if (itemMarkLabel(chart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(chart)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName ===\r\n \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig\r\n ?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(selectedChild)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"\r\n requestLayoutTitleEdit(chart, $event)\r\n \"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div\r\n class=\"relative h-full min-h-0\"\r\n [class]=\"itemMarkClass(childChart)\"\r\n [attr.data-chart-id]=\"\r\n childChart.config?.serviceConfig?.dashboardId\r\n \"\r\n >\r\n @if (itemMarkLabel(childChart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n }\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"] }]
52265
+ ], encapsulation: ViewEncapsulation.None, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-right\"\r\n [tooltip]=\"t('redo')\"\r\n (onClick)=\"redo()\"\r\n [disabled]=\"!canRedo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBackClick()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (preview()) {\r\n <!--\r\n Preview renders the reader's own component with the unsaved\r\n document, so it looks exactly like the published page. The editing\r\n grid is unmounted meanwhile: both would share the per-widget store\r\n entries (same dashboardId), and a widget clears its entry on destroy.\r\n -->\r\n <mt-dashboard-viewer\r\n class=\"db-builder-preview block\"\r\n [isPage]=\"false\"\r\n [pageId]=\"effectivePageId()\"\r\n [dashboardData]=\"previewDocument()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [lookups]=\"lookups()\"\r\n [statuses]=\"statuses()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogsResolver]=\"levelLogsResolver()\"\r\n />\r\n } @else {\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n [class]=\"itemMarkClass(chart)\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n @if (itemMarkLabel(chart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(chart)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName ===\r\n \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig\r\n ?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [assistLabel]=\"assistLabelFor(selectedChild)\"\r\n [assistIcon]=\"assist?.itemIcon ?? null\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"\r\n requestLayoutTitleEdit(chart, $event)\r\n \"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div\r\n class=\"relative h-full min-h-0\"\r\n [class]=\"itemMarkClass(childChart)\"\r\n [attr.data-chart-id]=\"\r\n childChart.config?.serviceConfig?.dashboardId\r\n \"\r\n >\r\n @if (itemMarkLabel(childChart); as label) {\r\n <span class=\"sr-only\">{{ label }}</span>\r\n }\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [queryParams]=\"pageQueryParams()\"\r\n [reportId]=\"effectivePageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n }\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"] }]
52186
52266
  }], ctorParameters: () => [], propDecorators: { isPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPage", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], backButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "backButton", required: false }] }], pageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageId", required: false }] }], newPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "newPage", required: false }] }], standalone: [{ type: i0.Input, args: [{ isSignal: true, alias: "standalone", required: false }] }], services: [{ type: i0.Input, args: [{ isSignal: true, alias: "services", required: false }] }], product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: false }] }], dashboardData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardData", required: false }] }, { type: i0.Output, args: ["dashboardDataChange"] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], informativeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "informativeContext", required: false }] }], extraFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraFilters", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], statuses: [{ type: i0.Input, args: [{ isSignal: true, alias: "statuses", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }], levelLogsResolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelLogsResolver", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], chartsChange: [{ type: i0.Output, args: ["chartsChange"] }], widgetAssist: [{ type: i0.Output, args: ["widgetAssist"] }], itemAssist: [{ type: i0.Output, args: ["itemAssist"] }], itemMarks: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemMarks", required: false }] }, { type: i0.Output, args: ["itemMarksChange"] }], onSave: [{ type: i0.Output, args: ["onSave"] }], pageCreated: [{ type: i0.Output, args: ["pageCreated"] }], onBack: [{ type: i0.Output, args: ["onBack"] }], onAddChart: [{ type: i0.Output, args: ["onAddChart"] }], onEditChart: [{ type: i0.Output, args: ["onEditChart"] }], contextMenu: [{ type: i0.ViewChild, args: ['contextMenu', { isSignal: true }] }], gridsterContainer: [{ type: i0.ViewChild, args: ['gridsterContainer', { isSignal: true }] }], onBeforeUnload: [{
52187
52267
  type: HostListener,
52188
52268
  args: ['window:beforeunload', ['$event']]
@@ -55505,4 +55585,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
55505
55585
  */
55506
55586
 
55507
55587
  export { StatisticCardComponent as $, getColorFromConditions as A, CardFilterComponent as B, ClickDispatcher as C, DashboardItemStoreService as D, EntityInfoComponent as E, FilterUtilsService as F, DynamicFiltersComponent as G, CardInfoComponent as H, ChartCardComponent as I, EChartComponent as J, resolveEntityUserPhoto as K, resolveEntityCheckbox as L, dateDisplayRawValue as M, normalizeDashboardCardEntityValue as N, mergePropertyAppearance as O, PropertiesCardComponent as P, EntityPreviewCardComponent as Q, HeaderCardComponent as R, StaticFiltersComponent as S, LastHistoryLevelCardComponent as T, ListStatisticCardComponent as U, MAP_REGIONS as V, DEFAULT_MAP_REGION_KEY as W, resolveMapRegion as X, MapViewComponent as Y, SkeletonCardComponent as Z, resolveStatisticIconPlacement as _, fillColorForPercentageProperty as a, GeneralSettings as a$, loadTableCard as a0, TopbarCardComponent as a1, ChartDataService as a2, observeNearViewport as a3, loadImmediately as a4, DASHBOARD_ITEM_VISIBILITY as a5, BarChartHandler as a6, resolvePieShape as a7, resolvePieInnerRadius as a8, PieChartHandler as a9, handleFiltersForCustom as aA, handleFilterForCard as aB, handleFilterForSnapshot as aC, applyBuiltInConditions as aD, DashboardList as aE, MODULE_CLASSIFICATION_LOG as aF, MODULE_CLASSIFICATION_LOG_NAME as aG, isLogClassification as aH, HTTPMethod as aI, copyName as aJ, DashboardBuilderService as aK, DashboardStoreService as aL, isManagePagesDeleteResult as aM, isManagePagesDuplicateResult as aN, ManagePages as aO, ManageBreadcrumb as aP, ManageFilterOnPage as aQ, DynamicFiltersConfig as aR, ChartSettingsDrawer as aS, DisplaySettings as aT, DefaultControlUi as aU, PieControlUi as aV, BarControlUi as aW, StackBarControlUi as aX, ManageItem as aY, CHART_TYPES as aZ, ManageItemService as a_, StackBarChartHandler as aa, axisFormatters as ab, groupDatesByYearAndMonth as ac, GaugeChartHandler as ad, TableViewHandler as ae, OverviewCardHandler as af, TimelineHandler as ag, LineChartHandler as ah, SnapshotHandler as ai, ComparisonChartHandler as aj, SplitterChartHandler as ak, LevelCardHandler as al, MapChartHandler as am, RingGaugeChartHandler as an, SPlusChartHandler as ao, PhaseGateStepperHandler as ap, formatCurrency as aq, getCurrencySuffix as ar, formatPercentage as as, formatNumber as at, formatDate as au, createAxisFormatter as av, createTooltipFormatter as aw, formatAxisLabel as ax, formatWordsUnderBar as ay, formatXAxis as az, resolveLegendColorOverride as b, hasBlockingIssues as b$, DataSourceSettings as b0, ActionsSettings as b1, ChartViewer as b2, StyleStudioDrawer as b3, StyleSettingsRenderer as b4, expandResetPatches as b5, StyleField as b6, SegmentedField as b7, ColorListField as b8, ArrayBuilderField as b9, normalizeBeforeSave as bA, normalizeBeforeRequest as bB, CONFIG_DOMAINS as bC, domainsForCapability as bD, findDomain as bE, POPOVER_TABS as bF, POPOVER_TAB_SPECS as bG, titleToUi as bH, applyTitleToPersisted as bI, datasourceToUi as bJ, fieldsToUi as bK, filtersToUi as bL, styleToUi as bM, applyStyleToPersisted as bN, layoutToUi as bO, applyLayoutToPersisted as bP, labelLegendFormatToUi as bQ, applyLabelLegendFormatToPersisted as bR, behaviorToUi as bS, applyBehaviorToPersisted as bT, applyFilterChipsToPersisted as bU, persistedToUi as bV, buildAssembly as bW, STYLE_PRESETS as bX, presetsForCapability as bY, findPreset as bZ, validate as b_, KeyValueMapField as ba, LegendOrderField as bb, ItemCardMenuComponent as bc, ChartFilterDrawer as bd, ItemContextToolbarComponent as be, ItemConfigPopoverComponent as bf, GuidedConfigDialogComponent as bg, FilterChipsBarComponent as bh, FilterBuilderComponent as bi, DatasourcePanelComponent as bj, SchemaControlRendererComponent as bk, FilterByGroupPipe as bl, GetChartActionsPipe as bm, CHART_CAPABILITIES as bn, getCapabilityById as bo, resolveCapability as bp, toBackendChartType as bq, normalizeChartTypeForRequest as br, normalizeFilterOperation as bs, normalizeAggregateFunction as bt, normalizeFilters as bu, selectorFromLegacy as bv, moduleIdFromSelector as bw, toBackendSourceLink as bx, toFormSourceLink as by, normalizeOnLoad as bz, CardContentComponent as c, groupIssuesByDomain as c0, parseAdvancedJson as c1, deepMerge$1 as c2, formatForEditor as c3, CUSTOM_COLOR_OPTION as c4, readByPath$1 as c5, setByPath as c6, applyControlPatchToPersisted as c7, applyControlPatchesToPersisted as c8, getControlSchema as c9, listControlSchemaIds as ca, listControlSchemas as cb, getFallbackControlSchema as cc, flattenSchema as cd, resolveDisplayFields as ce, buildDisplayFieldPredicate as cf, bindingKey as cg, getBinding as ch, listBindings as ci, listBindingsForChart as cj, readBoundValue as ck, ITEM_GUIDANCE_REGISTRY as cl, describeGuidance as cm, ItemGuidanceService as cn, DASHBOARD_BUILDER_ASSIST as co, WIDGET_PALETTE_TILE_HOST as cp, dashboardLevelOptions as cq, firstFreePosition as cr, dynamicReorder as d, DashboardItem as e, formatValue as f, getLegendOverrideOrder as g, hasDoubleClickAction as h, resolveDashboardDialogHeader as i, DashboardDialogHeader as j, cloneDeep$1 as k, DashboardBuilder as l, DashboardViewer as m, normalizePhaseGatePropertyIdentity as n, orderLegendItems as o, switchAllKeysSmall as p, getNestedData as q, resolvePhaseGateResponseKey as r, switchAllKeysToLower as s, dynamicTextReplace as t, generalConfiguration as u, getLocalizedTitle as v, sortChartData as w, addCommasToNumber as x, sortDataTableView as y, isMobilePlatform$1 as z };
55508
- //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-r4HI2aa1.mjs.map
55588
+ //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-DK1hsUEt.mjs.map