@masterteam/dashboard-builder 0.0.116 → 0.0.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dashboard-builder.css +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-BDNd7eud.mjs → masterteam-dashboard-builder-dashboard-dialog.component-C3tEnWfy.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-BDNd7eud.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-C3tEnWfy.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-BjNTcvqc.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-CMWrKUhw.mjs} +360 -1750
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-CMWrKUhw.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs +1431 -0
- package/fesm2022/masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +6 -6
- package/types/masterteam-dashboard-builder.d.ts +46 -29
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-BjNTcvqc.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, Injectable, computed, Pipe, input, ViewEncapsulation, ChangeDetectionStrategy, Component, effect, untracked, forwardRef, ViewChild, DestroyRef, output, InjectionToken, ElementRef, NgZone, PLATFORM_ID,
|
|
2
|
+
import { inject, signal, Injectable, computed, Pipe, input, ViewEncapsulation, ChangeDetectionStrategy, Component, effect, untracked, forwardRef, ViewChild, DestroyRef, output, InjectionToken, ElementRef, NgZone, PLATFORM_ID, viewChild, ChangeDetectorRef, model, HostListener, contentChild } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { CommonModule, DatePipe, isPlatformBrowser, DecimalPipe } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
@@ -51,9 +51,6 @@ import { DynamicDrawerConfig, DrawerController } from '@masterteam/components/dy
|
|
|
51
51
|
import { Tooltip as Tooltip$1, TruncateTooltip } from '@masterteam/components/tooltip';
|
|
52
52
|
import { DateField } from '@masterteam/components/date-field';
|
|
53
53
|
import { UserSearchField } from '@masterteam/components/user-search-field';
|
|
54
|
-
import { mtEntityColumn, MtTemplateCell, MtStandardGridComponent } from '@masterteam/data-table';
|
|
55
|
-
import { TableValueResolver, Table } from '@masterteam/components/table';
|
|
56
|
-
import { SecureImagePipe } from '@masterteam/components/upload-field';
|
|
57
54
|
import * as mtIcons from '@masterteam/icons/assets/select-icons.json';
|
|
58
55
|
import { Avatar } from '@masterteam/components/avatar';
|
|
59
56
|
import { EntitiesPreview } from '@masterteam/components/entities';
|
|
@@ -67,6 +64,8 @@ import { createOperatorToken, createTextToken, createPropertyToken, FormulaToolb
|
|
|
67
64
|
import { RadioCards } from '@masterteam/components/radio-cards';
|
|
68
65
|
import { Menu } from '@masterteam/components/menu';
|
|
69
66
|
import { Chip } from '@masterteam/components/chip';
|
|
67
|
+
import { TableValueResolver, Table } from '@masterteam/components/table';
|
|
68
|
+
import { SecureImagePipe } from '@masterteam/components/upload-field';
|
|
70
69
|
import * as i2$4 from 'primeng/button';
|
|
71
70
|
import { ButtonModule } from 'primeng/button';
|
|
72
71
|
import * as i2$5 from 'primeng/inputnumber';
|
|
@@ -14304,7 +14303,7 @@ function switchAllKeysToLower(obj) {
|
|
|
14304
14303
|
/**
|
|
14305
14304
|
* Alias for switchAllKeysToLower (matches old generalFuctions naming)
|
|
14306
14305
|
*/
|
|
14307
|
-
const switchAllKeysSmall
|
|
14306
|
+
const switchAllKeysSmall = switchAllKeysToLower;
|
|
14308
14307
|
/**
|
|
14309
14308
|
* Get nested data from object using dot notation path
|
|
14310
14309
|
*/
|
|
@@ -19361,7 +19360,7 @@ class TimelineHandler {
|
|
|
19361
19360
|
let extraPropSmall;
|
|
19362
19361
|
let groupValue;
|
|
19363
19362
|
if (groupKey) {
|
|
19364
|
-
extraPropSmall = switchAllKeysSmall
|
|
19363
|
+
extraPropSmall = switchAllKeysSmall(value.extraValues);
|
|
19365
19364
|
groupValue = extraPropSmall[groupKey?.toLowerCase()]?.value;
|
|
19366
19365
|
groupValue = groupValue?.name || groupValue;
|
|
19367
19366
|
}
|
|
@@ -25088,7 +25087,7 @@ class ActionService {
|
|
|
25088
25087
|
// "Dialog header"), not from the chart that opened it.
|
|
25089
25088
|
const header = resolveDashboardDialogHeader(dialogConfig);
|
|
25090
25089
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
25091
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
25090
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-C3tEnWfy.mjs').then(({ DashboardDialogComponent }) => {
|
|
25092
25091
|
// Open dialog using ModalService
|
|
25093
25092
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
25094
25093
|
header: header.title,
|
|
@@ -30858,1728 +30857,6 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
30858
30857
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #timelineLegendList>\r\n <div\r\n class=\"dashboard-timeline-legend\"\r\n [attr.data-position]=\"timelineLegendPosition()\"\r\n >\r\n @for (label of timelineLabels(); track $index) {\r\n <span\r\n class=\"dashboard-timeline-legend-item\"\r\n [title]=\"label.label || label.name || label.key\"\r\n >\r\n <span\r\n class=\"dashboard-timeline-legend-marker\"\r\n [class.shape-rect]=\"label.shape === 'rect'\"\r\n [class.shape-roundRect]=\"label.shape === 'roundRect'\"\r\n [class.shape-diamond]=\"label.shape === 'diamond'\"\r\n [class.shape-triangle]=\"label.shape === 'triangle'\"\r\n [style.background]=\"\r\n label.shape === 'triangle' ? null : label.color || '#64748b'\r\n \"\r\n [style.border-bottom-color]=\"\r\n label.shape === 'triangle' ? label.color || '#64748b' : null\r\n \"\r\n ></span>\r\n <span class=\"dashboard-timeline-legend-label\">\r\n {{ label.label || label.name || label.key }}\r\n </span>\r\n </span>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [density]=\"configurationItem()?.clientConfig?.configAsType?.['density']\"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n [title]=\"title()\"\r\n [titleEditable]=\"titleEditable()\"\r\n (titleChange)=\"onTitleChange.emit($event)\"\r\n [isNoTopEnd]=\"!showTopEnd()\"\r\n [isChart]=\"true\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <ng-container topEnd>\r\n @if (showStaticFilters()) {\r\n <mt-static-filters\r\n [config]=\"staticFilterConfig()\"\r\n [dashboardId]=\"dashboardId()\"\r\n >\r\n </mt-static-filters>\r\n }\r\n @if (showDynamicFilters()) {\r\n <mt-dynamic-filters\r\n [fields]=\"dynamicFilterFields()\"\r\n [dashboardId]=\"dashboardId()\"\r\n [reportId]=\"reportId()\"\r\n [showLabels]=\"false\"\r\n >\r\n </mt-dynamic-filters>\r\n }\r\n @if (showFilter()) {\r\n <mt-card-filter [config]=\"filterConfig()\" [dashboardId]=\"dashboardId()\">\r\n </mt-card-filter>\r\n }\r\n @if (cardInfoConfig()?.show && cardInfoConfig()?.value) {\r\n <mt-card-info [cardInfo]=\"cardInfoConfig()\"></mt-card-info>\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"chart-container\"\r\n [class.config-mode]=\"isConfigMode()\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n @if (componentViewMode() === \"splitter\" && hasSplitterData()) {\r\n <div\r\n class=\"splitter-view\"\r\n [class.splitter-vertical]=\"splitterOrientation() === 'vertical'\"\r\n [style.gap.px]=\"splitterGap()\"\r\n >\r\n <div class=\"splitter-side splitter-positive\">\r\n <div class=\"splitter-count\">\r\n {{ dataHandled()?.positive?.groupedValue ?? 0 }}\r\n </div>\r\n <ul class=\"splitter-labels\">\r\n @for (\r\n label of dataHandled()?.positive?.labels || [];\r\n track $index\r\n ) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n </div>\r\n <div class=\"splitter-divider\"></div>\r\n <div class=\"splitter-side splitter-negative\">\r\n <div class=\"splitter-count\">\r\n {{ dataHandled()?.negative?.groupedValue ?? 0 }}\r\n </div>\r\n <ul class=\"splitter-labels\">\r\n @for (\r\n label of dataHandled()?.negative?.labels || [];\r\n track $index\r\n ) {\r\n <li>{{ label }}</li>\r\n }\r\n </ul>\r\n </div>\r\n </div>\r\n } @else if (componentViewMode() === \"timeline\" && hasTimelineData()) {\r\n <div\r\n class=\"dashboard-timeline-view\"\r\n [attr.data-legend-position]=\"timelineLegendPosition()\"\r\n [style.--timeline-header-bg]=\"timelineHeaderBgColor()\"\r\n [style.--timeline-header-color]=\"timelineHeaderTextColor()\"\r\n >\r\n @if (\r\n timelineLegendShow() &&\r\n timelineLabels().length &&\r\n (timelineLegendPosition() === \"top\" ||\r\n timelineLegendPosition() === \"left\")\r\n ) {\r\n <ng-container [ngTemplateOutlet]=\"timelineLegendList\" />\r\n }\r\n\r\n @defer (on viewport) {\r\n <mt-timeline\r\n class=\"dashboard-timeline-renderer\"\r\n [showHeader]=\"false\"\r\n [showZoomToFitControl]=\"false\"\r\n [scrollToToday]=\"true\"\r\n [timelineMode]=\"timelineMode()\"\r\n (timelineModeChange)=\"timelineMode.set($event)\"\r\n [ganttData]=\"timelineResources()\"\r\n [ganttMapping]=\"timelineGanttMapping\"\r\n [columns]=\"timelineColumns()\"\r\n [defaultVisibleColumns]=\"2\"\r\n [columnsPaneMinWidthPx]=\"220\"\r\n [columnsPaneMaxWidthPx]=\"520\"\r\n [enableVirtualScroll]=\"true\"\r\n [virtualScrollThreshold]=\"0\"\r\n [virtualScrollBodyHeightPx]=\"520\"\r\n [showGanttDetailsPopup]=\"true\"\r\n [emptyMessage]=\"t('noChartData')\"\r\n >\r\n <ng-template\r\n mtTimelineColumn=\"title\"\r\n let-item=\"item\"\r\n let-resolved=\"resolved\"\r\n let-canToggle=\"canToggle\"\r\n let-isCollapsed=\"isCollapsed\"\r\n let-toggle=\"toggle\"\r\n >\r\n <div\r\n class=\"dashboard-timeline-title-cell\"\r\n [style.padding-inline-start.px]=\"\r\n $any(resolved).levelDepth * 16\r\n \"\r\n >\r\n @if (canToggle) {\r\n <mt-icon\r\n class=\"dashboard-timeline-title-toggle\"\r\n [icon]=\"timelineCollapseIcon(isCollapsed)\"\r\n (click)=\"$event.stopPropagation(); toggle()\"\r\n ></mt-icon>\r\n } @else {\r\n <span class=\"dashboard-timeline-title-spacer\"></span>\r\n }\r\n\r\n <button\r\n type=\"button\"\r\n class=\"dashboard-timeline-title-action\"\r\n [title]=\"$any(resolved).title\"\r\n (click)=\"onTimelineTitleClick(item, $event)\"\r\n >\r\n {{ $any(resolved).title }}\r\n </button>\r\n </div>\r\n </ng-template>\r\n\r\n @for (column of timelineEntityColumns(); track column.key) {\r\n <ng-template [mtTimelineColumn]=\"column.key\" let-value=\"value\">\r\n <mt-entity-preview\r\n class=\"dashboard-timeline-column-entity\"\r\n [data]=\"timelineColumnEntityData(value)\"\r\n attachmentShape=\"compact\"\r\n ></mt-entity-preview>\r\n </ng-template>\r\n }\r\n\r\n <ng-template mtTimelinePopover let-item=\"item\">\r\n @if (timelinePopoverEntities(item); as entities) {\r\n @if (entities.length) {\r\n <div\r\n class=\"w-[27rem] max-w-[90vw] max-h-[24rem] overflow-auto p-2\"\r\n >\r\n <mt-entities-preview\r\n [entities]=\"entities\"\r\n [stackOnNarrow]=\"false\"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-template>\r\n </mt-timeline>\r\n } @placeholder {\r\n <div class=\"dashboard-timeline-placeholder\" aria-hidden=\"true\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n }\r\n\r\n @if (\r\n timelineLegendShow() &&\r\n timelineLabels().length &&\r\n (timelineLegendPosition() === \"bottom\" ||\r\n timelineLegendPosition() === \"right\")\r\n ) {\r\n <ng-container [ngTemplateOutlet]=\"timelineLegendList\" />\r\n }\r\n </div>\r\n } @else if (\r\n componentViewMode() === \"phaseGateStepper\" && phaseGateRecordCount() > 1\r\n ) {\r\n <div class=\"no-data-container\">\r\n <i class=\"pi pi-info-circle\"></i>\r\n <span>{{\r\n t(\"phaseGateStepperMultipleRecords\", {\r\n count: phaseGateRecordCount(),\r\n })\r\n }}</span>\r\n </div>\r\n } @else if (\r\n componentViewMode() === \"phaseGateStepper\" && hasPhaseGateData()\r\n ) {\r\n <div\r\n class=\"phase-gate-view\"\r\n [class.phase-gate-compact]=\"phaseGateCompact()\"\r\n >\r\n <ol class=\"phase-steps\">\r\n @for (step of phaseGateSteps(); track $index) {\r\n <li\r\n class=\"phase-step\"\r\n [class.is-current]=\"step.isCurrent\"\r\n [class.is-done]=\"step.isCompleted\"\r\n >\r\n <span class=\"phase-step-number\">{{ $index + 1 }}</span>\r\n @if (phaseGateShowLabels()) {\r\n <span class=\"phase-step-name\">{{\r\n step.name || t(\"phase\")\r\n }}</span>\r\n }\r\n </li>\r\n }\r\n </ol>\r\n </div>\r\n } @else if (\r\n componentViewMode() === \"performanceGauge\" &&\r\n dataHandled() &&\r\n !dataHandled()?.noData\r\n ) {\r\n @let gauge = performanceGauge();\r\n <div\r\n class=\"dashboard-performance-gauge\"\r\n [class.is-clickable]=\"hasActions()\"\r\n [style.--dashboard-performance-status-color]=\"gauge.status.color\"\r\n (click)=\"onPerformanceGaugeClick($event)\"\r\n >\r\n <div\r\n class=\"dashboard-performance-gauge__figure\"\r\n [style.width.%]=\"gauge.scalePercent\"\r\n >\r\n <svg\r\n class=\"dashboard-performance-gauge__svg\"\r\n viewBox=\"0 0 100 72\"\r\n role=\"img\"\r\n [attr.aria-label]=\"gauge.label + ' ' + gauge.display\"\r\n >\r\n <path\r\n d=\"M 8 58 A 42 42 0 0 1 92 58\"\r\n fill=\"none\"\r\n stroke=\"#e5e7eb\"\r\n stroke-width=\"6\"\r\n stroke-linecap=\"round\"\r\n pathLength=\"100\"\r\n ></path>\r\n\r\n @for (segment of performanceGaugeSegments(); track segment.key) {\r\n <path\r\n d=\"M 8 58 A 42 42 0 0 1 92 58\"\r\n fill=\"none\"\r\n [attr.stroke]=\"segment.color\"\r\n stroke-width=\"6\"\r\n stroke-linecap=\"round\"\r\n pathLength=\"100\"\r\n [attr.stroke-dasharray]=\"segment.dashArray\"\r\n [attr.stroke-dashoffset]=\"segment.dashOffset\"\r\n [style.opacity]=\"segment.opacity\"\r\n ></path>\r\n <text\r\n [attr.x]=\"segment.labelX\"\r\n [attr.y]=\"segment.labelY\"\r\n text-anchor=\"middle\"\r\n dominant-baseline=\"central\"\r\n font-size=\"5.5\"\r\n font-weight=\"700\"\r\n fill=\"#334155\"\r\n >\r\n {{ segment.label }}\r\n </text>\r\n }\r\n\r\n <circle\r\n [attr.cx]=\"gauge.marker.x\"\r\n [attr.cy]=\"gauge.marker.y\"\r\n r=\"4.5\"\r\n fill=\"#fff\"\r\n [attr.stroke]=\"gauge.status.color\"\r\n stroke-width=\"3\"\r\n ></circle>\r\n </svg>\r\n\r\n <div class=\"dashboard-performance-gauge__center\">\r\n <div class=\"dashboard-performance-gauge__value\">\r\n {{ gauge.display }}\r\n </div>\r\n <div class=\"dashboard-performance-gauge__label\">\r\n {{ gauge.label }}\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div\r\n class=\"dashboard-performance-gauge__status\"\r\n [title]=\"performanceGaugeStatusName()\"\r\n >\r\n <span class=\"dashboard-performance-gauge__status-dot\"></span>\r\n <span class=\"dashboard-performance-gauge__status-text\">\r\n {{ performanceGaugeStatusName() }}\r\n </span>\r\n </div>\r\n </div>\r\n } @else if (componentViewMode() === \"map\" && dataHandled()) {\r\n <mt-map-view\r\n [dashboardId]=\"dashboardId()\"\r\n [configurationItem]=\"configurationItem()\"\r\n [inGroup]=\"inGroup()\"\r\n [groups]=\"mapGroups()\"\r\n [config]=\"mapViewConfig()\"\r\n [showLegend]=\"mapLegendShow()\"\r\n [legendPosition]=\"mapLegendPosition()\"\r\n [legendIcon]=\"mapLegendIcon()\"\r\n (pointClick)=\"onMapPointClick($event)\"\r\n (pointDblClick)=\"onMapPointDblClick($event)\"\r\n />\r\n } @else if (dataHandled() && !dataHandled()?.noData) {\r\n <mt-echart\r\n [dashboardId]=\"dashboardId()\"\r\n [chartConfig]=\"dataHandled()\"\r\n [configurationItem]=\"configurationItem()\"\r\n [inGroup]=\"inGroup()\"\r\n (chartClick)=\"onChartClick($event)\"\r\n (chartDblClick)=\"onChartDblClick($event)\"\r\n >\r\n </mt-echart>\r\n } @else if (dataHandled()?.noData) {\r\n <div class=\"no-data-container\">\r\n <i class=\"pi pi-info-circle\"></i>\r\n <span>{{ t(\"noChartData\") }}</span>\r\n </div>\r\n } @else {\r\n <div class=\"loading-container\">\r\n <div class=\"loading-spinner\"></div>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.chart-container{height:100%;min-height:0}.chart-container.config-mode{min-height:400px}.no-data-container,.needs-config-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:0;color:#999;gap:.5rem;padding:1rem;text-align:center}.no-data-container i,.needs-config-container i{font-size:2rem}.needs-config-container .title{font-weight:600;color:#555;font-size:.95rem}.needs-config-container .hint{font-size:.8rem;max-width:28rem;line-height:1.4}.needs-config-container .configure-btn{margin-top:.5rem;display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .9rem;font-size:.85rem;font-weight:600;color:#fff;background:var(--p-primary-500, #2563eb);border:0;border-radius:.375rem;cursor:pointer;box-shadow:0 1px 2px #0000000d}.needs-config-container .configure-btn:hover{background:var(--p-primary-600, #1d4ed8)}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;min-height:0}.loading-spinner{width:2rem;height:2rem;border:3px solid #f0f0f0;border-top-color:#4caf50;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.splitter-view{display:flex;align-items:stretch;height:100%;gap:.5rem}.splitter-view.splitter-vertical{flex-direction:column}.splitter-view.splitter-vertical .splitter-divider{width:auto;height:1px}.splitter-side{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:1rem;border-radius:.5rem}.splitter-positive{background:#22c55e14}.splitter-negative{background:#ef444414}.splitter-count{font-size:2rem;font-weight:700;margin-bottom:.5rem}.splitter-positive .splitter-count{color:#16a34a}.splitter-negative .splitter-count{color:#dc2626}.splitter-labels{list-style:none;padding:0;margin:0;text-align:center;font-size:.8rem;color:#555}.splitter-labels li{padding:.15rem 0}.splitter-divider{width:1px;background:#00000014}.dashboard-timeline-view{display:flex;flex-direction:column;gap:.625rem;height:100%;min-height:0;overflow:auto}.dashboard-timeline-view[data-legend-position=left],.dashboard-timeline-view[data-legend-position=right]{flex-direction:row;overflow:hidden}.dashboard-timeline-legend{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:.35rem .75rem;flex-shrink:0;min-width:0;max-width:100%}.dashboard-timeline-legend[data-position=left],.dashboard-timeline-legend[data-position=right]{max-width:12rem;max-height:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;overflow:auto}.dashboard-timeline-legend-item{display:inline-flex;align-items:center;gap:.25rem;max-width:12rem;padding:0;border:0;border-radius:0;font-size:.75rem;color:#475569;font-weight:500;line-height:1.2;background:transparent}.dashboard-timeline-legend-marker{display:inline-block;width:.625rem;height:.625rem;flex:0 0 auto;border-radius:999px}.dashboard-timeline-legend-marker.shape-rect{border-radius:0}.dashboard-timeline-legend-marker.shape-roundRect{border-radius:.2rem}.dashboard-timeline-legend-marker.shape-diamond{border-radius:.0625rem;transform:rotate(45deg)}.dashboard-timeline-legend-marker.shape-triangle{width:0;height:0;background:transparent!important;border-radius:0;border-left:.34rem solid transparent;border-right:.34rem solid transparent;border-bottom-width:.6rem;border-bottom-style:solid}.dashboard-timeline-legend-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dashboard-timeline-renderer{display:block;min-height:0;flex:1}.dashboard-timeline-placeholder{display:flex;min-height:260px;flex:1;flex-direction:column;gap:.75rem;padding:1rem}.dashboard-timeline-placeholder div{height:3rem;border-radius:.5rem;background:var(--p-surface-100);animation:dashboard-builder-pulse 1.2s ease-in-out infinite}@keyframes dashboard-builder-pulse{0%,to{opacity:.55}50%{opacity:1}}:host ::ng-deep .dashboard-timeline-renderer>div{margin-top:0}:host ::ng-deep .dashboard-timeline-view mt-timeline-gantt-header .bg-surface-50{background-color:var(--timeline-header-bg, var(--p-surface-50));color:var(--timeline-header-color, inherit)}.dashboard-timeline-column-entity{display:block;min-width:0}.dashboard-timeline-title-cell{display:flex;min-width:0;align-items:center;gap:.5rem;width:100%}.dashboard-timeline-title-toggle{flex:0 0 auto;cursor:pointer;color:#64748b}.dashboard-timeline-title-spacer{display:inline-block;width:1.25rem;flex:0 0 1.25rem}.dashboard-timeline-title-action{min-width:0;flex:1 1 auto;overflow:hidden;border:0;background:transparent;padding:0;color:#334155;cursor:pointer;font-size:.875rem;font-weight:600;text-align:start;text-overflow:ellipsis;white-space:nowrap}.dashboard-timeline-title-action:hover{color:var(--p-primary-600, #2563eb);text-decoration:underline}.phase-gate-view{height:100%;display:flex;align-items:center;justify-content:safe center;padding:1rem;overflow-x:auto}.phase-steps{display:flex;align-items:center;gap:.75rem;list-style:none;margin:0;padding:0}.phase-step{display:flex;align-items:center;gap:.5rem;padding:.4rem .75rem;border-radius:.375rem;background:#0000000a;font-size:.8rem;color:#555;white-space:nowrap}.phase-step-number{width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;font-weight:700;background:#0000000f;color:#666}.phase-step.is-done{background:#22c55e1a;color:#16a34a}.phase-step.is-done .phase-step-number{background:#16a34a;color:#fff}.phase-step.is-current{background:#2563eb1a;color:#2563eb;font-weight:600}.phase-step.is-current .phase-step-number{background:#2563eb;color:#fff}.phase-gate-view.phase-gate-compact .phase-step{padding:.2rem .45rem;font-size:.7rem;gap:.25rem}.phase-gate-view.phase-gate-compact .phase-step-number{width:1.1rem;height:1.1rem;font-size:.7rem}.dashboard-performance-gauge{display:flex;height:100%;min-height:0;width:100%;flex-direction:column;align-items:center;justify-content:center;gap:.875rem;overflow:hidden;padding:.75rem 1rem 1rem;cursor:default}.dashboard-performance-gauge.is-clickable{cursor:pointer}.dashboard-performance-gauge__figure{position:relative;width:min(100%,28rem);min-width:12rem;max-width:100%;transform-origin:center bottom}.dashboard-performance-gauge__svg{display:block;width:100%;height:auto;overflow:visible}.dashboard-performance-gauge__center{position:absolute;left:50%;top:72%;display:flex;max-width:90%;transform:translate(-50%,-50%);flex-direction:column;align-items:center;gap:.125rem;text-align:center;pointer-events:none}.dashboard-performance-gauge__value{font-size:2.75rem;font-weight:800;line-height:1;color:var(--dashboard-performance-status-color, #334155)}.dashboard-performance-gauge__label{max-width:18rem;overflow:hidden;color:#475569;font-size:.95rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.dashboard-performance-gauge__status{display:inline-flex;max-width:min(80%,18rem);align-items:center;justify-content:center;gap:.375rem;border-radius:999px;padding:.25rem .625rem;background:color-mix(in srgb,var(--dashboard-performance-status-color, #64748b) 10%,transparent);color:var(--dashboard-performance-status-color, #475569);font-size:.8125rem;font-weight:700;line-height:1.2}.dashboard-performance-gauge__status-dot{width:.5rem;height:.5rem;flex:0 0 auto;border-radius:999px;background:currentColor}.dashboard-performance-gauge__status-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n"] }]
|
|
30859
30858
|
}], ctorParameters: null, propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], reportId: [{ type: i0.Input, args: [{ isSignal: true, alias: "reportId", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], isConfigMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isConfigMode", required: false }] }], titleEditable: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleEditable", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }], onConfigure: [{ type: i0.Output, args: ["onConfigure"] }], onTitleChange: [{ type: i0.Output, args: ["onTitleChange"] }] } }) });
|
|
30860
30859
|
|
|
30861
|
-
/**
|
|
30862
|
-
* Entity Info Component
|
|
30863
|
-
*
|
|
30864
|
-
* Renders property values based on their viewType.
|
|
30865
|
-
* Matches old app-entity-info behavior with viewType-based rendering.
|
|
30866
|
-
*
|
|
30867
|
-
* Supported viewTypes:
|
|
30868
|
-
* - text, float, title, phasegate → text display
|
|
30869
|
-
* - longtext → rich-text HTML display
|
|
30870
|
-
* - number → formatted number
|
|
30871
|
-
* - date, datetime → date display
|
|
30872
|
-
* - currency → currency display
|
|
30873
|
-
* - time → time display
|
|
30874
|
-
* - lookup, lookupmatrix → lookup display with color indicator
|
|
30875
|
-
* - checkbox → checkbox display
|
|
30876
|
-
* - status, request_status → status display with color
|
|
30877
|
-
* - percentage → percentage with progress bar
|
|
30878
|
-
* - slider → slider/progress display
|
|
30879
|
-
* - user → user avatar display
|
|
30880
|
-
* - lookupmultiselect → multi-select tags
|
|
30881
|
-
* - multiuser → multiple user avatars
|
|
30882
|
-
* - dynamiclist → list of properties
|
|
30883
|
-
* - api → API fetched value
|
|
30884
|
-
* - integrated → integrated value display
|
|
30885
|
-
*/
|
|
30886
|
-
function resolveEntityUserPhoto(value) {
|
|
30887
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
30888
|
-
return '';
|
|
30889
|
-
const user = value;
|
|
30890
|
-
for (const key of ['photoUrl', 'image', 'avatar']) {
|
|
30891
|
-
const candidate = user[key];
|
|
30892
|
-
if (typeof candidate === 'string' && candidate.trim()) {
|
|
30893
|
-
return candidate.trim();
|
|
30894
|
-
}
|
|
30895
|
-
}
|
|
30896
|
-
return '';
|
|
30897
|
-
}
|
|
30898
|
-
/**
|
|
30899
|
-
* The dashboard backend sends a Checkbox value as text (`"True"` / `"False"`),
|
|
30900
|
-
* so `Boolean(value)` read every non-empty string, `"False"` included, as
|
|
30901
|
-
* checked. Parsed the same way as the table card's `toBooleanValue`.
|
|
30902
|
-
*/
|
|
30903
|
-
function resolveEntityCheckbox(value) {
|
|
30904
|
-
if (typeof value === 'boolean')
|
|
30905
|
-
return value;
|
|
30906
|
-
if (typeof value === 'number')
|
|
30907
|
-
return value === 1;
|
|
30908
|
-
if (typeof value === 'string') {
|
|
30909
|
-
const text = value.trim().toLowerCase();
|
|
30910
|
-
return text === 'true' || text === '1' || text === 'yes';
|
|
30911
|
-
}
|
|
30912
|
-
if (value && typeof value === 'object' && 'value' in value) {
|
|
30913
|
-
return resolveEntityCheckbox(value.value);
|
|
30914
|
-
}
|
|
30915
|
-
return false;
|
|
30916
|
-
}
|
|
30917
|
-
class EntityInfoComponent {
|
|
30918
|
-
transloco = inject(TranslocoService);
|
|
30919
|
-
httpContext = new HttpContext().set(REQUEST_CONTEXT, {
|
|
30920
|
-
useBaseUrl: true,
|
|
30921
|
-
});
|
|
30922
|
-
/** Entity data to display */
|
|
30923
|
-
data = input(null, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
30924
|
-
/** Display type: 'entity' shows label, 'inTable' shows value only */
|
|
30925
|
-
displayType = input('entity', ...(ngDevMode ? [{ debugName: "displayType" }] : /* istanbul ignore next */ []));
|
|
30926
|
-
/** Extra configuration */
|
|
30927
|
-
extraInfoData = input({}, ...(ngDevMode ? [{ debugName: "extraInfoData" }] : /* istanbul ignore next */ []));
|
|
30928
|
-
/** Whether to limit words with ellipsis */
|
|
30929
|
-
limitWords = input(false, ...(ngDevMode ? [{ debugName: "limitWords" }] : /* istanbul ignore next */ []));
|
|
30930
|
-
/** Custom CSS class */
|
|
30931
|
-
customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : /* istanbul ignore next */ []));
|
|
30932
|
-
/** Computed viewType in lowercase */
|
|
30933
|
-
viewTypeLower = computed(() => {
|
|
30934
|
-
return this.data()?.viewType?.toLowerCase() || 'text';
|
|
30935
|
-
}, ...(ngDevMode ? [{ debugName: "viewTypeLower" }] : /* istanbul ignore next */ []));
|
|
30936
|
-
// === Text values ===
|
|
30937
|
-
textValue = computed(() => {
|
|
30938
|
-
const value = this.data()?.value;
|
|
30939
|
-
if (value === null || value === undefined)
|
|
30940
|
-
return '';
|
|
30941
|
-
if (typeof value === 'object') {
|
|
30942
|
-
return value.displayName || value.display || value.name || String(value);
|
|
30943
|
-
}
|
|
30944
|
-
return String(value);
|
|
30945
|
-
}, ...(ngDevMode ? [{ debugName: "textValue" }] : /* istanbul ignore next */ []));
|
|
30946
|
-
// === Long text values ===
|
|
30947
|
-
/**
|
|
30948
|
-
* A `LongText` property stores rich-text HTML authored in the editor, so the
|
|
30949
|
-
* cell has to render it as markup — interpolating it printed the raw
|
|
30950
|
-
* `<p>…</p>` source into the table. Angular sanitizes `[innerHTML]`, and this
|
|
30951
|
-
* matches `mt-entity-long-text`, which is what the level-workspace table
|
|
30952
|
-
* renders the same property with.
|
|
30953
|
-
*/
|
|
30954
|
-
longTextHtml = computed(() => this.textValue(), ...(ngDevMode ? [{ debugName: "longTextHtml" }] : /* istanbul ignore next */ []));
|
|
30955
|
-
/** Tag-stripped text for the `title` tooltip — an attribute can't hold markup. */
|
|
30956
|
-
longTextTooltip = computed(() => {
|
|
30957
|
-
const text = TableValueResolver.stripHtml(this.longTextHtml());
|
|
30958
|
-
return typeof text === 'string' ? text : '';
|
|
30959
|
-
}, ...(ngDevMode ? [{ debugName: "longTextTooltip" }] : /* istanbul ignore next */ []));
|
|
30960
|
-
// === Number values ===
|
|
30961
|
-
numericValue = computed(() => {
|
|
30962
|
-
const value = this.data()?.value;
|
|
30963
|
-
if (value === null || value === undefined)
|
|
30964
|
-
return null;
|
|
30965
|
-
const num = parseFloat(value);
|
|
30966
|
-
return isNaN(num) ? null : num;
|
|
30967
|
-
}, ...(ngDevMode ? [{ debugName: "numericValue" }] : /* istanbul ignore next */ []));
|
|
30968
|
-
// === Date values ===
|
|
30969
|
-
dateDisplayValue = computed(() => {
|
|
30970
|
-
const value = this.data()?.value;
|
|
30971
|
-
if (!value)
|
|
30972
|
-
return '';
|
|
30973
|
-
if (typeof value === 'object') {
|
|
30974
|
-
return value.displayValue || value.display || '';
|
|
30975
|
-
}
|
|
30976
|
-
// Try to format as date
|
|
30977
|
-
try {
|
|
30978
|
-
const date = new Date(value);
|
|
30979
|
-
if (!isNaN(date.getTime())) {
|
|
30980
|
-
return date.toLocaleDateString();
|
|
30981
|
-
}
|
|
30982
|
-
}
|
|
30983
|
-
catch {
|
|
30984
|
-
// ignore
|
|
30985
|
-
}
|
|
30986
|
-
return String(value);
|
|
30987
|
-
}, ...(ngDevMode ? [{ debugName: "dateDisplayValue" }] : /* istanbul ignore next */ []));
|
|
30988
|
-
// === Currency values ===
|
|
30989
|
-
currencyDisplayValue = computed(() => {
|
|
30990
|
-
const value = this.data()?.value;
|
|
30991
|
-
if (!value)
|
|
30992
|
-
return '';
|
|
30993
|
-
if (typeof value === 'object') {
|
|
30994
|
-
return value.display || this.formatCurrency(value.value);
|
|
30995
|
-
}
|
|
30996
|
-
return this.formatCurrency(value);
|
|
30997
|
-
}, ...(ngDevMode ? [{ debugName: "currencyDisplayValue" }] : /* istanbul ignore next */ []));
|
|
30998
|
-
// === Time values ===
|
|
30999
|
-
timeDisplayValue = computed(() => {
|
|
31000
|
-
const value = this.data()?.value;
|
|
31001
|
-
if (!value)
|
|
31002
|
-
return '';
|
|
31003
|
-
if (typeof value === 'object') {
|
|
31004
|
-
return value.displayValue || value.display || '';
|
|
31005
|
-
}
|
|
31006
|
-
return String(value);
|
|
31007
|
-
}, ...(ngDevMode ? [{ debugName: "timeDisplayValue" }] : /* istanbul ignore next */ []));
|
|
31008
|
-
// === Lookup values ===
|
|
31009
|
-
lookupName = computed(() => {
|
|
31010
|
-
const value = this.data()?.value;
|
|
31011
|
-
if (!value)
|
|
31012
|
-
return '';
|
|
31013
|
-
if (typeof value === 'object') {
|
|
31014
|
-
return value.name || value.display?.name || value.display || '';
|
|
31015
|
-
}
|
|
31016
|
-
return String(value);
|
|
31017
|
-
}, ...(ngDevMode ? [{ debugName: "lookupName" }] : /* istanbul ignore next */ []));
|
|
31018
|
-
lookupColor = computed(() => {
|
|
31019
|
-
const value = this.data()?.value;
|
|
31020
|
-
if (!value || typeof value !== 'object')
|
|
31021
|
-
return '';
|
|
31022
|
-
return value.details?.color || value.color || '';
|
|
31023
|
-
}, ...(ngDevMode ? [{ debugName: "lookupColor" }] : /* istanbul ignore next */ []));
|
|
31024
|
-
// === Checkbox values ===
|
|
31025
|
-
checkboxValue = computed(() => resolveEntityCheckbox(this.data()?.value), ...(ngDevMode ? [{ debugName: "checkboxValue" }] : /* istanbul ignore next */ []));
|
|
31026
|
-
checkboxLabel = computed(() => this.transloco.translate(this.checkboxValue() ? 'dashboardBuilder.yes' : 'dashboardBuilder.no'), ...(ngDevMode ? [{ debugName: "checkboxLabel" }] : /* istanbul ignore next */ []));
|
|
31027
|
-
// === Status values ===
|
|
31028
|
-
statusName = computed(() => {
|
|
31029
|
-
const value = this.data()?.value;
|
|
31030
|
-
if (!value)
|
|
31031
|
-
return '';
|
|
31032
|
-
if (typeof value === 'object') {
|
|
31033
|
-
const languageCode = document.dir === 'rtl' ? 'ar' : 'en';
|
|
31034
|
-
const display = typeof value.display === 'object'
|
|
31035
|
-
? value.display?.[languageCode] ||
|
|
31036
|
-
value.display?.en ||
|
|
31037
|
-
value.display?.ar ||
|
|
31038
|
-
value.display?.name ||
|
|
31039
|
-
value.display?.displayName ||
|
|
31040
|
-
value.display?.label
|
|
31041
|
-
: value.display;
|
|
31042
|
-
return (value.displayName ||
|
|
31043
|
-
value.name ||
|
|
31044
|
-
display ||
|
|
31045
|
-
value[languageCode] ||
|
|
31046
|
-
value.en ||
|
|
31047
|
-
value.ar ||
|
|
31048
|
-
value.label ||
|
|
31049
|
-
value.key ||
|
|
31050
|
-
'');
|
|
31051
|
-
}
|
|
31052
|
-
return String(value);
|
|
31053
|
-
}, ...(ngDevMode ? [{ debugName: "statusName" }] : /* istanbul ignore next */ []));
|
|
31054
|
-
statusColor = computed(() => {
|
|
31055
|
-
const value = this.data()?.value;
|
|
31056
|
-
if (!value || typeof value !== 'object')
|
|
31057
|
-
return '';
|
|
31058
|
-
return value.details?.color || value.color || '';
|
|
31059
|
-
}, ...(ngDevMode ? [{ debugName: "statusColor" }] : /* istanbul ignore next */ []));
|
|
31060
|
-
// === Percentage values ===
|
|
31061
|
-
percentageValue = computed(() => {
|
|
31062
|
-
let value = this.data()?.value;
|
|
31063
|
-
if (value === null || value === undefined)
|
|
31064
|
-
return null;
|
|
31065
|
-
// Unwrap nested { value: { value: N } } / { value: "49%" } shapes (up to a
|
|
31066
|
-
// couple of levels) so the progress-bar fill width parses correctly.
|
|
31067
|
-
for (let i = 0; i < 3 && value && typeof value === 'object'; i++) {
|
|
31068
|
-
value =
|
|
31069
|
-
value.value ??
|
|
31070
|
-
value.actualValue ??
|
|
31071
|
-
value.displayValue ??
|
|
31072
|
-
value.display ??
|
|
31073
|
-
null;
|
|
31074
|
-
}
|
|
31075
|
-
if (value === null || value === undefined)
|
|
31076
|
-
return null;
|
|
31077
|
-
const num = parseFloat(String(value).replace('%', '').trim());
|
|
31078
|
-
return Number.isNaN(num) ? 0 : num;
|
|
31079
|
-
}, ...(ngDevMode ? [{ debugName: "percentageValue" }] : /* istanbul ignore next */ []));
|
|
31080
|
-
percentageColor = computed(() => {
|
|
31081
|
-
// "% status color": the table injects the row's status colour as
|
|
31082
|
-
// data().statusColor and sets extraInfoData.showPercentageStatus — prefer
|
|
31083
|
-
// it so the progress bar / dot reflects the row's status (Delayed -> red…).
|
|
31084
|
-
const statusColor = this.data()?.statusColor;
|
|
31085
|
-
if (this.extraInfoData()?.showPercentageStatus && statusColor) {
|
|
31086
|
-
return statusColor;
|
|
31087
|
-
}
|
|
31088
|
-
// Otherwise use any colour carried on the value (incl. one level of nesting).
|
|
31089
|
-
const value = this.data()?.value;
|
|
31090
|
-
if (!value || typeof value !== 'object')
|
|
31091
|
-
return '';
|
|
31092
|
-
return value.color || value.details?.color || value.value?.color || '';
|
|
31093
|
-
}, ...(ngDevMode ? [{ debugName: "percentageColor" }] : /* istanbul ignore next */ []));
|
|
31094
|
-
// === Slider values ===
|
|
31095
|
-
sliderValue = computed(() => {
|
|
31096
|
-
const value = this.data()?.value;
|
|
31097
|
-
if (!value)
|
|
31098
|
-
return 0;
|
|
31099
|
-
if (typeof value === 'object') {
|
|
31100
|
-
return parseFloat(value.value) || 0;
|
|
31101
|
-
}
|
|
31102
|
-
return parseFloat(value) || 0;
|
|
31103
|
-
}, ...(ngDevMode ? [{ debugName: "sliderValue" }] : /* istanbul ignore next */ []));
|
|
31104
|
-
// === User values ===
|
|
31105
|
-
userData = computed(() => {
|
|
31106
|
-
const value = this.data()?.value;
|
|
31107
|
-
if (!value || typeof value !== 'object')
|
|
31108
|
-
return null;
|
|
31109
|
-
return value;
|
|
31110
|
-
}, ...(ngDevMode ? [{ debugName: "userData" }] : /* istanbul ignore next */ []));
|
|
31111
|
-
userName = computed(() => {
|
|
31112
|
-
const user = this.userData();
|
|
31113
|
-
if (!user)
|
|
31114
|
-
return '';
|
|
31115
|
-
return user.displayName || user.name || user.fullName || '';
|
|
31116
|
-
}, ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
|
|
31117
|
-
userPhoto = computed(() => resolveEntityUserPhoto(this.userData()), ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
|
|
31118
|
-
userInitials = computed(() => {
|
|
31119
|
-
const name = this.userName();
|
|
31120
|
-
return this.getInitials(name);
|
|
31121
|
-
}, ...(ngDevMode ? [{ debugName: "userInitials" }] : /* istanbul ignore next */ []));
|
|
31122
|
-
// === Multiselect values ===
|
|
31123
|
-
multiselectValues = computed(() => {
|
|
31124
|
-
const value = this.data()?.value;
|
|
31125
|
-
if (!value)
|
|
31126
|
-
return [];
|
|
31127
|
-
return Array.isArray(value) ? value : [];
|
|
31128
|
-
}, ...(ngDevMode ? [{ debugName: "multiselectValues" }] : /* istanbul ignore next */ []));
|
|
31129
|
-
// === Multi user values ===
|
|
31130
|
-
multiUserValues = computed(() => {
|
|
31131
|
-
const value = this.data()?.value;
|
|
31132
|
-
if (!value)
|
|
31133
|
-
return [];
|
|
31134
|
-
return Array.isArray(value) ? value : [];
|
|
31135
|
-
}, ...(ngDevMode ? [{ debugName: "multiUserValues" }] : /* istanbul ignore next */ []));
|
|
31136
|
-
getUserPhoto(user) {
|
|
31137
|
-
return resolveEntityUserPhoto(user);
|
|
31138
|
-
}
|
|
31139
|
-
// === Dynamic list values ===
|
|
31140
|
-
dynamicListValues = computed(() => {
|
|
31141
|
-
const value = this.data()?.value;
|
|
31142
|
-
if (!value)
|
|
31143
|
-
return [];
|
|
31144
|
-
return Array.isArray(value) ? value : [];
|
|
31145
|
-
}, ...(ngDevMode ? [{ debugName: "dynamicListValues" }] : /* istanbul ignore next */ []));
|
|
31146
|
-
// === Location values ===
|
|
31147
|
-
locationDisplayValue = computed(() => {
|
|
31148
|
-
const value = this.data()?.value;
|
|
31149
|
-
if (!value)
|
|
31150
|
-
return '';
|
|
31151
|
-
if (typeof value === 'object') {
|
|
31152
|
-
return value.display_name || value.displayName || value.name || '';
|
|
31153
|
-
}
|
|
31154
|
-
return String(value);
|
|
31155
|
-
}, ...(ngDevMode ? [{ debugName: "locationDisplayValue" }] : /* istanbul ignore next */ []));
|
|
31156
|
-
/** Get initials from name */
|
|
31157
|
-
getInitials(name) {
|
|
31158
|
-
if (!name)
|
|
31159
|
-
return '?';
|
|
31160
|
-
const parts = name.split(' ').filter(Boolean);
|
|
31161
|
-
if (parts.length === 1) {
|
|
31162
|
-
return parts[0].charAt(0).toUpperCase();
|
|
31163
|
-
}
|
|
31164
|
-
return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
|
|
31165
|
-
}
|
|
31166
|
-
/** Format currency value */
|
|
31167
|
-
formatCurrency(value) {
|
|
31168
|
-
if (value === null || value === undefined || value === '')
|
|
31169
|
-
return '';
|
|
31170
|
-
const num = parseFloat(value);
|
|
31171
|
-
if (isNaN(num))
|
|
31172
|
-
return String(value);
|
|
31173
|
-
return num.toLocaleString(undefined, {
|
|
31174
|
-
minimumFractionDigits: 2,
|
|
31175
|
-
maximumFractionDigits: 2,
|
|
31176
|
-
});
|
|
31177
|
-
}
|
|
31178
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31179
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityInfoComponent, isStandalone: true, selector: "mt-entity-info", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, extraInfoData: { classPropertyName: "extraInfoData", publicName: "extraInfoData", isSignal: true, isRequired: false, transformFunction: null }, limitWords: { classPropertyName: "limitWords", publicName: "limitWords", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"entity-info-wrapper w-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @switch (viewTypeLower()) {\r\n <!-- Text Types -->\r\n @case (\"text\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"float\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"longtext\") {\r\n <ng-container *ngTemplateOutlet=\"longTextTemplate\"></ng-container>\r\n }\r\n @case (\"title\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"phasegate\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Number -->\r\n @case (\"number\") {\r\n <ng-container *ngTemplateOutlet=\"numberTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Date Types -->\r\n @case (\"date\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n @case (\"datetime\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Currency -->\r\n @case (\"currency\") {\r\n <ng-container *ngTemplateOutlet=\"currencyTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Time -->\r\n @case (\"time\") {\r\n <ng-container *ngTemplateOutlet=\"timeTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup -->\r\n @case (\"lookup\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup Matrix (same value shape as lookup: key/display/color) -->\r\n @case (\"lookupmatrix\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @case (\"checkbox\") {\r\n <ng-container *ngTemplateOutlet=\"checkboxTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Status -->\r\n @case (\"status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n @case (\"request_status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Percentage -->\r\n @case (\"percentage\") {\r\n <ng-container *ngTemplateOutlet=\"percentageTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Slider -->\r\n @case (\"slider\") {\r\n <ng-container *ngTemplateOutlet=\"sliderTemplate\"></ng-container>\r\n }\r\n\r\n <!-- User -->\r\n @case (\"user\") {\r\n <ng-container *ngTemplateOutlet=\"userTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Multi-select lookup -->\r\n @case (\"lookupmultiselect\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"lookupMultiselectTemplate\"\r\n ></ng-container>\r\n }\r\n\r\n <!-- Multi user -->\r\n @case (\"multiuser\") {\r\n <ng-container *ngTemplateOutlet=\"multiUserTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Dynamic List -->\r\n @case (\"dynamiclist\") {\r\n <ng-container *ngTemplateOutlet=\"dynamicListTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Location -->\r\n @case (\"location\") {\r\n <ng-container *ngTemplateOutlet=\"locationTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Default: treat as text -->\r\n @default {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- Text Template -->\r\n<ng-template #textTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div\r\n class=\"font-semibold\"\r\n [class.text-ellipsis]=\"limitWords()\"\r\n [class.overflow-hidden]=\"limitWords()\"\r\n [class.whitespace-nowrap]=\"limitWords()\"\r\n [style.max-width]=\"limitWords() ? '200px' : 'auto'\"\r\n [title]=\"textValue()\"\r\n >\r\n {{ textValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Long Text Template: the value is rich-text HTML, so render it as markup\r\n (Angular sanitizes [innerHTML]) instead of printing the tags. -->\r\n<ng-template #longTextTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (longTextTooltip()) {\r\n <div\r\n class=\"entity-long-text font-semibold break-words\"\r\n [class.entity-long-text-clamped]=\"displayType() === 'inTable'\"\r\n [title]=\"longTextTooltip()\"\r\n [innerHTML]=\"longTextHtml()\"\r\n ></div>\r\n } @else {\r\n <div class=\"font-semibold\">__</div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Number Template -->\r\n<ng-template #numberTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ numericValue() !== null ? (numericValue() | number) : \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Date Template -->\r\n<ng-template #dateTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ dateDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Currency Template -->\r\n<ng-template #currencyTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ currencyDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Time Template -->\r\n<ng-template #timeTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ timeDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Lookup Template -->\r\n<ng-template #lookupTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (lookupName()) {\r\n <span class=\"flex items-center gap-1\" [style.color]=\"lookupColor()\">\r\n @if (displayType() === \"entity\" && lookupColor()) {\r\n <span\r\n class=\"w-2 h-2 rounded-full inline-block\"\r\n [style.backgroundColor]=\"lookupColor()\"\r\n ></span>\r\n }\r\n {{ lookupName() }}\r\n </span>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Checkbox Template -->\r\n<ng-template #checkboxTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center\">\r\n <i\r\n [class]=\"\r\n checkboxValue()\r\n ? 'pi pi-check-square text-primary'\r\n : 'pi pi-stop text-muted-color'\r\n \"\r\n ></i>\r\n <span class=\"ml-2\">{{ checkboxLabel() }}</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Status Template -->\r\n<ng-template #statusTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (statusColor()) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"statusColor()\"\r\n ></span>\r\n }\r\n <span [style.color]=\"statusColor()\">\r\n {{ statusName() || \"__\" }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Percentage Template -->\r\n<ng-template #percentageTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (\r\n displayType() !== \"inTable\" ||\r\n extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-24\"\r\n >\r\n <div\r\n class=\"h-full rounded-full transition-all\"\r\n [style.width.%]=\"percentageValue() || 0\"\r\n [style.backgroundColor]=\"percentageColor() || 'var(--primary-color)'\"\r\n ></div>\r\n </div>\r\n }\r\n @if (\r\n extraInfoData()?.showPercentageStatus &&\r\n !extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"percentageColor() || '#000'\"\r\n ></span>\r\n }\r\n <span [style.color]=\"percentageColor()\">\r\n {{\r\n percentageValue() !== null\r\n ? (percentageValue() | number: \"1.0-0\") + \"%\"\r\n : \"__\"\r\n }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Slider Template -->\r\n<ng-template #sliderTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-32\"\r\n >\r\n <div\r\n class=\"h-full bg-primary rounded-full transition-all\"\r\n [style.width.%]=\"sliderValue() || 0\"\r\n ></div>\r\n </div>\r\n <span class=\"text-sm\">{{ sliderValue() || 0 }}%</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- User Template -->\r\n<ng-template #userTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (userData()) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (userPhoto()) {\r\n <img\r\n [src]=\"userPhoto() | secureImage: true : httpContext : 'avatar/'\"\r\n alt=\"User avatar\"\r\n class=\"w-8 h-8 rounded-full object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center text-primary font-semibold text-sm\"\r\n >\r\n {{ userInitials() }}\r\n </div>\r\n }\r\n <span class=\"font-medium\">{{ userName() }}</span>\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Lookup Multiselect Template -->\r\n<ng-template #lookupMultiselectTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiselectValues()?.length) {\r\n <div class=\"flex flex-wrap gap-1\">\r\n @for (item of multiselectValues(); track item.key || $index) {\r\n <!-- A lookup value is { key, display, color } \u2014 `details.color` alone\r\n left every chip on the grey fallback. Same order as lookupColor(). -->\r\n <span\r\n class=\"px-2 py-0.5 rounded-full text-xs font-medium\"\r\n [style.backgroundColor]=\"\r\n (item.details?.color || item.color || '#6b7280') + '20'\r\n \"\r\n [style.color]=\"item.details?.color || item.color || '#6b7280'\"\r\n >\r\n {{ item.name || item.display || item.key || item }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Multi User Template -->\r\n<ng-template #multiUserTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiUserValues()?.length) {\r\n <div class=\"flex items-center -space-x-2\">\r\n @for (user of multiUserValues().slice(0, 5); track user.id || $index) {\r\n @if (getUserPhoto(user); as userPhoto) {\r\n <img\r\n [src]=\"userPhoto | secureImage: true : httpContext : 'avatar/'\"\r\n [alt]=\"user.name || user.displayName\"\r\n class=\"w-7 h-7 rounded-full border-2 border-white object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-primary/20 flex items-center justify-center text-primary font-semibold text-xs\"\r\n >\r\n {{ getInitials(user.name || user.displayName) }}\r\n </div>\r\n }\r\n }\r\n @if (multiUserValues().length > 5) {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-surface-300 flex items-center justify-center text-xs font-medium\"\r\n >\r\n +{{ multiUserValues().length - 5 }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Dynamic List Template -->\r\n<ng-template #dynamicListTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (dynamicListValues()?.length) {\r\n <div class=\"flex flex-col gap-1\">\r\n @for (item of dynamicListValues(); track $index) {\r\n <div class=\"text-sm\">\r\n {{ item?.label || item?.name || item }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Location Template -->\r\n<ng-template #locationTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ locationDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n", styles: [":host{display:block}.text-ellipsis{text-overflow:ellipsis}.entity-long-text ::ng-deep :is(p,ul,ol,h1,h2,h3,h4,h5,h6){margin:0}.entity-long-text-clamped{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6){display:inline}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6):after{content:\" \"}\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: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: SecureImagePipe, name: "secureImage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31180
|
-
}
|
|
31181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, decorators: [{
|
|
31182
|
-
type: Component,
|
|
31183
|
-
args: [{ selector: 'mt-entity-info', standalone: true, imports: [CommonModule, TranslocoDirective, DecimalPipe, SecureImagePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"entity-info-wrapper w-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @switch (viewTypeLower()) {\r\n <!-- Text Types -->\r\n @case (\"text\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"float\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"longtext\") {\r\n <ng-container *ngTemplateOutlet=\"longTextTemplate\"></ng-container>\r\n }\r\n @case (\"title\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"phasegate\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Number -->\r\n @case (\"number\") {\r\n <ng-container *ngTemplateOutlet=\"numberTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Date Types -->\r\n @case (\"date\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n @case (\"datetime\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Currency -->\r\n @case (\"currency\") {\r\n <ng-container *ngTemplateOutlet=\"currencyTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Time -->\r\n @case (\"time\") {\r\n <ng-container *ngTemplateOutlet=\"timeTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup -->\r\n @case (\"lookup\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup Matrix (same value shape as lookup: key/display/color) -->\r\n @case (\"lookupmatrix\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @case (\"checkbox\") {\r\n <ng-container *ngTemplateOutlet=\"checkboxTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Status -->\r\n @case (\"status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n @case (\"request_status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Percentage -->\r\n @case (\"percentage\") {\r\n <ng-container *ngTemplateOutlet=\"percentageTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Slider -->\r\n @case (\"slider\") {\r\n <ng-container *ngTemplateOutlet=\"sliderTemplate\"></ng-container>\r\n }\r\n\r\n <!-- User -->\r\n @case (\"user\") {\r\n <ng-container *ngTemplateOutlet=\"userTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Multi-select lookup -->\r\n @case (\"lookupmultiselect\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"lookupMultiselectTemplate\"\r\n ></ng-container>\r\n }\r\n\r\n <!-- Multi user -->\r\n @case (\"multiuser\") {\r\n <ng-container *ngTemplateOutlet=\"multiUserTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Dynamic List -->\r\n @case (\"dynamiclist\") {\r\n <ng-container *ngTemplateOutlet=\"dynamicListTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Location -->\r\n @case (\"location\") {\r\n <ng-container *ngTemplateOutlet=\"locationTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Default: treat as text -->\r\n @default {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- Text Template -->\r\n<ng-template #textTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div\r\n class=\"font-semibold\"\r\n [class.text-ellipsis]=\"limitWords()\"\r\n [class.overflow-hidden]=\"limitWords()\"\r\n [class.whitespace-nowrap]=\"limitWords()\"\r\n [style.max-width]=\"limitWords() ? '200px' : 'auto'\"\r\n [title]=\"textValue()\"\r\n >\r\n {{ textValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Long Text Template: the value is rich-text HTML, so render it as markup\r\n (Angular sanitizes [innerHTML]) instead of printing the tags. -->\r\n<ng-template #longTextTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (longTextTooltip()) {\r\n <div\r\n class=\"entity-long-text font-semibold break-words\"\r\n [class.entity-long-text-clamped]=\"displayType() === 'inTable'\"\r\n [title]=\"longTextTooltip()\"\r\n [innerHTML]=\"longTextHtml()\"\r\n ></div>\r\n } @else {\r\n <div class=\"font-semibold\">__</div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Number Template -->\r\n<ng-template #numberTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ numericValue() !== null ? (numericValue() | number) : \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Date Template -->\r\n<ng-template #dateTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ dateDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Currency Template -->\r\n<ng-template #currencyTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ currencyDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Time Template -->\r\n<ng-template #timeTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ timeDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Lookup Template -->\r\n<ng-template #lookupTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (lookupName()) {\r\n <span class=\"flex items-center gap-1\" [style.color]=\"lookupColor()\">\r\n @if (displayType() === \"entity\" && lookupColor()) {\r\n <span\r\n class=\"w-2 h-2 rounded-full inline-block\"\r\n [style.backgroundColor]=\"lookupColor()\"\r\n ></span>\r\n }\r\n {{ lookupName() }}\r\n </span>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Checkbox Template -->\r\n<ng-template #checkboxTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center\">\r\n <i\r\n [class]=\"\r\n checkboxValue()\r\n ? 'pi pi-check-square text-primary'\r\n : 'pi pi-stop text-muted-color'\r\n \"\r\n ></i>\r\n <span class=\"ml-2\">{{ checkboxLabel() }}</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Status Template -->\r\n<ng-template #statusTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (statusColor()) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"statusColor()\"\r\n ></span>\r\n }\r\n <span [style.color]=\"statusColor()\">\r\n {{ statusName() || \"__\" }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Percentage Template -->\r\n<ng-template #percentageTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (\r\n displayType() !== \"inTable\" ||\r\n extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-24\"\r\n >\r\n <div\r\n class=\"h-full rounded-full transition-all\"\r\n [style.width.%]=\"percentageValue() || 0\"\r\n [style.backgroundColor]=\"percentageColor() || 'var(--primary-color)'\"\r\n ></div>\r\n </div>\r\n }\r\n @if (\r\n extraInfoData()?.showPercentageStatus &&\r\n !extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"percentageColor() || '#000'\"\r\n ></span>\r\n }\r\n <span [style.color]=\"percentageColor()\">\r\n {{\r\n percentageValue() !== null\r\n ? (percentageValue() | number: \"1.0-0\") + \"%\"\r\n : \"__\"\r\n }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Slider Template -->\r\n<ng-template #sliderTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-32\"\r\n >\r\n <div\r\n class=\"h-full bg-primary rounded-full transition-all\"\r\n [style.width.%]=\"sliderValue() || 0\"\r\n ></div>\r\n </div>\r\n <span class=\"text-sm\">{{ sliderValue() || 0 }}%</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- User Template -->\r\n<ng-template #userTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (userData()) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (userPhoto()) {\r\n <img\r\n [src]=\"userPhoto() | secureImage: true : httpContext : 'avatar/'\"\r\n alt=\"User avatar\"\r\n class=\"w-8 h-8 rounded-full object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center text-primary font-semibold text-sm\"\r\n >\r\n {{ userInitials() }}\r\n </div>\r\n }\r\n <span class=\"font-medium\">{{ userName() }}</span>\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Lookup Multiselect Template -->\r\n<ng-template #lookupMultiselectTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiselectValues()?.length) {\r\n <div class=\"flex flex-wrap gap-1\">\r\n @for (item of multiselectValues(); track item.key || $index) {\r\n <!-- A lookup value is { key, display, color } \u2014 `details.color` alone\r\n left every chip on the grey fallback. Same order as lookupColor(). -->\r\n <span\r\n class=\"px-2 py-0.5 rounded-full text-xs font-medium\"\r\n [style.backgroundColor]=\"\r\n (item.details?.color || item.color || '#6b7280') + '20'\r\n \"\r\n [style.color]=\"item.details?.color || item.color || '#6b7280'\"\r\n >\r\n {{ item.name || item.display || item.key || item }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Multi User Template -->\r\n<ng-template #multiUserTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiUserValues()?.length) {\r\n <div class=\"flex items-center -space-x-2\">\r\n @for (user of multiUserValues().slice(0, 5); track user.id || $index) {\r\n @if (getUserPhoto(user); as userPhoto) {\r\n <img\r\n [src]=\"userPhoto | secureImage: true : httpContext : 'avatar/'\"\r\n [alt]=\"user.name || user.displayName\"\r\n class=\"w-7 h-7 rounded-full border-2 border-white object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-primary/20 flex items-center justify-center text-primary font-semibold text-xs\"\r\n >\r\n {{ getInitials(user.name || user.displayName) }}\r\n </div>\r\n }\r\n }\r\n @if (multiUserValues().length > 5) {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-surface-300 flex items-center justify-center text-xs font-medium\"\r\n >\r\n +{{ multiUserValues().length - 5 }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Dynamic List Template -->\r\n<ng-template #dynamicListTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (dynamicListValues()?.length) {\r\n <div class=\"flex flex-col gap-1\">\r\n @for (item of dynamicListValues(); track $index) {\r\n <div class=\"text-sm\">\r\n {{ item?.label || item?.name || item }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Location Template -->\r\n<ng-template #locationTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ locationDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n", styles: [":host{display:block}.text-ellipsis{text-overflow:ellipsis}.entity-long-text ::ng-deep :is(p,ul,ol,h1,h2,h3,h4,h5,h6){margin:0}.entity-long-text-clamped{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6){display:inline}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6):after{content:\" \"}\n"] }]
|
|
31184
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], extraInfoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraInfoData", required: false }] }], limitWords: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitWords", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }] } });
|
|
31185
|
-
|
|
31186
|
-
/** A group row of a dashboard table: the group's entity value and the server's aggregates. */
|
|
31187
|
-
class TableCardGroupValue {
|
|
31188
|
-
params = input.required(...(ngDevMode ? [{ debugName: "params" }] : /* istanbul ignore next */ []));
|
|
31189
|
-
first = computed(() => this.params().node.allLeafChildren?.[0]?.data, ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
|
|
31190
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardGroupValue, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
31191
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardGroupValue, isStandalone: true, selector: "mt-table-card-group-value", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (first(); as row) {\n <span class=\"inline-flex flex-wrap items-center gap-x-4 gap-y-1\">\n <mt-entity-info\n [data]=\"{\n viewType: row.__mtgroup?.viewType,\n value: row.__mtgroup?.value,\n }\"\n displayType=\"inTable\"\n />\n @if (row.__mtaggregates) {\n <span class=\"text-xs font-medium whitespace-pre-wrap\">{{\n row.__mtaggregates\n }}</span>\n }\n </span>\n}\n", dependencies: [{ kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31192
|
-
}
|
|
31193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardGroupValue, decorators: [{
|
|
31194
|
-
type: Component,
|
|
31195
|
-
args: [{ selector: 'mt-table-card-group-value', imports: [EntityInfoComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (first(); as row) {\n <span class=\"inline-flex flex-wrap items-center gap-x-4 gap-y-1\">\n <mt-entity-info\n [data]=\"{\n viewType: row.__mtgroup?.viewType,\n value: row.__mtgroup?.value,\n }\"\n displayType=\"inTable\"\n />\n @if (row.__mtaggregates) {\n <span class=\"text-xs font-medium whitespace-pre-wrap\">{{\n row.__mtaggregates\n }}</span>\n }\n </span>\n}\n" }]
|
|
31196
|
-
}], propDecorators: { params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: true }] }] } });
|
|
31197
|
-
|
|
31198
|
-
/**
|
|
31199
|
-
* Table Card Component
|
|
31200
|
-
*
|
|
31201
|
-
* Displays data in a table format with entity-info rendering.
|
|
31202
|
-
* Matches old app-table-card + app-table behavior.
|
|
31203
|
-
*
|
|
31204
|
-
* Features:
|
|
31205
|
-
* - Grouped and non-grouped modes
|
|
31206
|
-
* - Entity-info rendering for each cell viewType
|
|
31207
|
-
* - Column sorting
|
|
31208
|
-
* - Row click actions
|
|
31209
|
-
* - Style configuration
|
|
31210
|
-
* - Status labels
|
|
31211
|
-
*/
|
|
31212
|
-
/**
|
|
31213
|
-
* Helper: switch all keys to lowercase
|
|
31214
|
-
*/
|
|
31215
|
-
function switchAllKeysSmall(obj) {
|
|
31216
|
-
if (!obj || typeof obj !== 'object')
|
|
31217
|
-
return obj;
|
|
31218
|
-
const result = {};
|
|
31219
|
-
Object.keys(obj).forEach((key) => {
|
|
31220
|
-
result[key.toLowerCase()] = obj[key];
|
|
31221
|
-
});
|
|
31222
|
-
return result;
|
|
31223
|
-
}
|
|
31224
|
-
/**
|
|
31225
|
-
* Helper: get object with keys in lowercase
|
|
31226
|
-
*/
|
|
31227
|
-
function getObjectKeysInLowerCase(obj) {
|
|
31228
|
-
if (!obj || typeof obj !== 'object')
|
|
31229
|
-
return obj;
|
|
31230
|
-
const result = {};
|
|
31231
|
-
Object.keys(obj).forEach((key) => {
|
|
31232
|
-
result[key.toLowerCase()] = obj[key];
|
|
31233
|
-
});
|
|
31234
|
-
return result;
|
|
31235
|
-
}
|
|
31236
|
-
function unwrapEntityValue(value) {
|
|
31237
|
-
if (value === null || value === undefined)
|
|
31238
|
-
return value;
|
|
31239
|
-
if (typeof value !== 'object')
|
|
31240
|
-
return value;
|
|
31241
|
-
const wrapped = value.value;
|
|
31242
|
-
if (wrapped !== undefined && wrapped !== null) {
|
|
31243
|
-
if (typeof wrapped !== 'object')
|
|
31244
|
-
return wrapped;
|
|
31245
|
-
return (wrapped.value ??
|
|
31246
|
-
wrapped.key ??
|
|
31247
|
-
wrapped.id ??
|
|
31248
|
-
wrapped.actualValue ??
|
|
31249
|
-
wrapped.displayValue ??
|
|
31250
|
-
wrapped.name ??
|
|
31251
|
-
wrapped.displayName ??
|
|
31252
|
-
wrapped.display ??
|
|
31253
|
-
wrapped);
|
|
31254
|
-
}
|
|
31255
|
-
return (value.rawValue ??
|
|
31256
|
-
value.actualValue ??
|
|
31257
|
-
value.key ??
|
|
31258
|
-
value.id ??
|
|
31259
|
-
value.displayValue ??
|
|
31260
|
-
value.displayName ??
|
|
31261
|
-
value.name ??
|
|
31262
|
-
value.display ??
|
|
31263
|
-
value);
|
|
31264
|
-
}
|
|
31265
|
-
function displayEntityValue(value) {
|
|
31266
|
-
if (value === null || value === undefined)
|
|
31267
|
-
return '';
|
|
31268
|
-
if (typeof value !== 'object')
|
|
31269
|
-
return String(value);
|
|
31270
|
-
const wrapped = value.value;
|
|
31271
|
-
if (wrapped && typeof wrapped === 'object') {
|
|
31272
|
-
const display = wrapped.display;
|
|
31273
|
-
return String(wrapped.displayName ??
|
|
31274
|
-
wrapped.name ??
|
|
31275
|
-
(typeof display === 'object'
|
|
31276
|
-
? display?.name || display?.displayName || display?.label
|
|
31277
|
-
: display) ??
|
|
31278
|
-
wrapped.value ??
|
|
31279
|
-
wrapped.key ??
|
|
31280
|
-
'');
|
|
31281
|
-
}
|
|
31282
|
-
return String(value.displayName ??
|
|
31283
|
-
value.name ??
|
|
31284
|
-
value.display ??
|
|
31285
|
-
value.label ??
|
|
31286
|
-
unwrapEntityValue(value) ??
|
|
31287
|
-
'');
|
|
31288
|
-
}
|
|
31289
|
-
/**
|
|
31290
|
-
* One entry per property key across ALL rows, in first-seen order. Rows from
|
|
31291
|
-
* different sources of a multi-source table carry different keys (milestone_*
|
|
31292
|
-
* on some, deliverable_* on others); building columns from a single "widest"
|
|
31293
|
-
* row dropped every other source's columns and showed their values as empty.
|
|
31294
|
-
*/
|
|
31295
|
-
function columnSample(values) {
|
|
31296
|
-
const sample = {};
|
|
31297
|
-
values.forEach((item) => {
|
|
31298
|
-
const itemLower = getObjectKeysInLowerCase(item || {});
|
|
31299
|
-
Object.keys(itemLower).forEach((key) => {
|
|
31300
|
-
if (!(key in sample))
|
|
31301
|
-
sample[key] = itemLower[key];
|
|
31302
|
-
});
|
|
31303
|
-
});
|
|
31304
|
-
return sample;
|
|
31305
|
-
}
|
|
31306
|
-
function normalizeIdentity(value) {
|
|
31307
|
-
return String(value ?? '')
|
|
31308
|
-
.trim()
|
|
31309
|
-
.toLowerCase()
|
|
31310
|
-
.replace(/[\s_-]+/g, '');
|
|
31311
|
-
}
|
|
31312
|
-
function fieldIdentity(prop, fallbackKey) {
|
|
31313
|
-
return [prop?.normalizedKey, prop?.key, fallbackKey, prop?.label, prop?.name]
|
|
31314
|
-
.map(normalizeIdentity)
|
|
31315
|
-
.filter(Boolean)
|
|
31316
|
-
.join('|');
|
|
31317
|
-
}
|
|
31318
|
-
function isIdentityField(prop, fallbackKey) {
|
|
31319
|
-
const identities = [
|
|
31320
|
-
normalizeIdentity(fallbackKey),
|
|
31321
|
-
normalizeIdentity(prop?.normalizedKey),
|
|
31322
|
-
normalizeIdentity(prop?.key),
|
|
31323
|
-
normalizeIdentity(prop?.label),
|
|
31324
|
-
].filter(Boolean);
|
|
31325
|
-
return identities.some((identity) => identity === 'id' ||
|
|
31326
|
-
identity.endsWith('id') ||
|
|
31327
|
-
identity === 'identifier' ||
|
|
31328
|
-
identity.includes('leveldataid') ||
|
|
31329
|
-
identity.includes('moduledataid') ||
|
|
31330
|
-
identity.includes('entityid'));
|
|
31331
|
-
}
|
|
31332
|
-
function toBooleanValue(value) {
|
|
31333
|
-
const primitive = unwrapEntityValue(value);
|
|
31334
|
-
if (typeof primitive === 'boolean')
|
|
31335
|
-
return primitive;
|
|
31336
|
-
if (typeof primitive === 'number')
|
|
31337
|
-
return primitive === 1;
|
|
31338
|
-
const text = String(primitive ?? '')
|
|
31339
|
-
.trim()
|
|
31340
|
-
.toLowerCase();
|
|
31341
|
-
return text === 'true' || text === '1' || text === 'yes';
|
|
31342
|
-
}
|
|
31343
|
-
function toNumberValue(value) {
|
|
31344
|
-
const primitive = unwrapEntityValue(value);
|
|
31345
|
-
if (primitive === null ||
|
|
31346
|
-
primitive === undefined ||
|
|
31347
|
-
(typeof primitive === 'string' && !primitive.trim())) {
|
|
31348
|
-
return null;
|
|
31349
|
-
}
|
|
31350
|
-
const num = Number(primitive);
|
|
31351
|
-
return Number.isFinite(num) ? num : null;
|
|
31352
|
-
}
|
|
31353
|
-
function getEntityColor(value) {
|
|
31354
|
-
const wrapped = value?.value;
|
|
31355
|
-
return (wrapped?.details?.color ||
|
|
31356
|
-
wrapped?.display?.color ||
|
|
31357
|
-
wrapped?.color ||
|
|
31358
|
-
value?.details?.color ||
|
|
31359
|
-
value?.display?.color ||
|
|
31360
|
-
value?.color ||
|
|
31361
|
-
'');
|
|
31362
|
-
}
|
|
31363
|
-
class TableCardComponent {
|
|
31364
|
-
storeService = inject(DashboardItemStoreService);
|
|
31365
|
-
transloco = inject(TranslocoService);
|
|
31366
|
-
subscription = new Subscription();
|
|
31367
|
-
/** Dashboard ID */
|
|
31368
|
-
dashboardId = input.required(...(ngDevMode ? [{ debugName: "dashboardId" }] : /* istanbul ignore next */ []));
|
|
31369
|
-
/** Whether card is in a group */
|
|
31370
|
-
inGroup = input(false, ...(ngDevMode ? [{ debugName: "inGroup" }] : /* istanbul ignore next */ []));
|
|
31371
|
-
/** Hide the card header (e.g. inside a dialog where the dialog header suffices). */
|
|
31372
|
-
hideHeader = input(false, ...(ngDevMode ? [{ debugName: "hideHeader" }] : /* istanbul ignore next */ []));
|
|
31373
|
-
/** Action event output */
|
|
31374
|
-
onAction = output();
|
|
31375
|
-
/** Configuration item */
|
|
31376
|
-
configurationItem = signal(null, ...(ngDevMode ? [{ debugName: "configurationItem" }] : /* istanbul ignore next */ []));
|
|
31377
|
-
/** Raw data from handler */
|
|
31378
|
-
rawData = signal(null, ...(ngDevMode ? [{ debugName: "rawData" }] : /* istanbul ignore next */ []));
|
|
31379
|
-
/** Loading state */
|
|
31380
|
-
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
31381
|
-
/** Columns */
|
|
31382
|
-
columns = signal([], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
31383
|
-
/** Labels for status display */
|
|
31384
|
-
labels = signal([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
31385
|
-
/** Table legends are visible by default for backward compatibility. */
|
|
31386
|
-
showLegend = computed(() => this.configurationItem()?.clientConfig?.configAsType?.['legend']?.['show'] !== false, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
31387
|
-
/**
|
|
31388
|
-
* Whether there is a legend to render at all. Shared by both hosts (the card
|
|
31389
|
-
* header's top-end slot and, when the header is hidden, the card body) so the
|
|
31390
|
-
* two never disagree about visibility.
|
|
31391
|
-
*/
|
|
31392
|
-
hasLegend = computed(() => this.showLegend() && this.labels().length > 0, ...(ngDevMode ? [{ debugName: "hasLegend" }] : /* istanbul ignore next */ []));
|
|
31393
|
-
legendPosition = computed(() => {
|
|
31394
|
-
const position = this.configurationItem()?.clientConfig?.configAsType?.['legend']?.['position'];
|
|
31395
|
-
return position === 'right' ||
|
|
31396
|
-
position === 'bottom' ||
|
|
31397
|
-
position === 'left'
|
|
31398
|
-
? position
|
|
31399
|
-
: 'top';
|
|
31400
|
-
}, ...(ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []));
|
|
31401
|
-
legendIconType = computed(() => {
|
|
31402
|
-
const iconType = this.configurationItem()?.clientConfig?.configAsType?.['legend']?.['iconType'];
|
|
31403
|
-
return typeof iconType === 'string' && iconType ? iconType : 'circle';
|
|
31404
|
-
}, ...(ngDevMode ? [{ debugName: "legendIconType" }] : /* istanbul ignore next */ []));
|
|
31405
|
-
isSideLegend = computed(() => this.legendPosition() === 'left' || this.legendPosition() === 'right', ...(ngDevMode ? [{ debugName: "isSideLegend" }] : /* istanbul ignore next */ []));
|
|
31406
|
-
/** Processed table rows */
|
|
31407
|
-
tableRows = signal([], ...(ngDevMode ? [{ debugName: "tableRows" }] : /* istanbul ignore next */ []));
|
|
31408
|
-
/** Grouped data */
|
|
31409
|
-
groupedData = signal([], ...(ngDevMode ? [{ debugName: "groupedData" }] : /* istanbul ignore next */ []));
|
|
31410
|
-
/** Totals the backend calculated for a flat table's aggregations. */
|
|
31411
|
-
tableAggregates = signal([], ...(ngDevMode ? [{ debugName: "tableAggregates" }] : /* istanbul ignore next */ []));
|
|
31412
|
-
static AGGREGATE_LABEL_KEYS = {
|
|
31413
|
-
sum: 'sum',
|
|
31414
|
-
avg: 'average',
|
|
31415
|
-
average: 'average',
|
|
31416
|
-
count: 'count',
|
|
31417
|
-
min: 'min',
|
|
31418
|
-
max: 'max',
|
|
31419
|
-
formula: 'formula',
|
|
31420
|
-
};
|
|
31421
|
-
/**
|
|
31422
|
-
* "Sum · Actual Progress: 138.55" per aggregation (`{ propertyKey,
|
|
31423
|
-
* aggregateFunction, alias, value }`); an alias replaces the generated name.
|
|
31424
|
-
*/
|
|
31425
|
-
aggregateSummary(aggregates) {
|
|
31426
|
-
if (!Array.isArray(aggregates) || !aggregates.length)
|
|
31427
|
-
return '';
|
|
31428
|
-
const lang = this.transloco.getActiveLang();
|
|
31429
|
-
return aggregates
|
|
31430
|
-
.map((aggregate) => {
|
|
31431
|
-
const alias = String(aggregate?.alias ?? '').trim();
|
|
31432
|
-
const key = String(aggregate?.propertyKey ?? '').toLowerCase();
|
|
31433
|
-
const column = this.columns().find((col) => (col.keyPure ?? col.key)?.toLowerCase() === key);
|
|
31434
|
-
const fnKey = TableCardComponent.AGGREGATE_LABEL_KEYS[String(aggregate?.aggregateFunction ?? '').toLowerCase()];
|
|
31435
|
-
const name = alias ||
|
|
31436
|
-
[
|
|
31437
|
-
fnKey
|
|
31438
|
-
? this.transloco.translate(`dashboardBuilder.${fnKey}`)
|
|
31439
|
-
: aggregate?.aggregateFunction,
|
|
31440
|
-
column?.label ?? aggregate?.propertyKey,
|
|
31441
|
-
]
|
|
31442
|
-
.filter(Boolean)
|
|
31443
|
-
.join(' · ');
|
|
31444
|
-
const value = aggregate?.value === null || aggregate?.value === undefined
|
|
31445
|
-
? '-'
|
|
31446
|
-
: formatValue(aggregate.value, undefined, lang);
|
|
31447
|
-
return `${name}: ${value}`;
|
|
31448
|
-
})
|
|
31449
|
-
.join(' ');
|
|
31450
|
-
}
|
|
31451
|
-
/** Title */
|
|
31452
|
-
title = computed(() => {
|
|
31453
|
-
const config = this.configurationItem();
|
|
31454
|
-
const lang = this.transloco.getActiveLang();
|
|
31455
|
-
return config?.clientConfig?.title?.[lang] || '';
|
|
31456
|
-
}, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
31457
|
-
/** Table style config */
|
|
31458
|
-
tableStyleConfig = computed(() => {
|
|
31459
|
-
const config = this.configurationItem();
|
|
31460
|
-
return config?.clientConfig?.['tableFormat'] || null;
|
|
31461
|
-
}, ...(ngDevMode ? [{ debugName: "tableStyleConfig" }] : /* istanbul ignore next */ []));
|
|
31462
|
-
/** Last applied `column|direction` signature, to ignore unrelated edits. */
|
|
31463
|
-
lastSortSig = '';
|
|
31464
|
-
/**
|
|
31465
|
-
* Re-apply the configured sort live whenever `tableFormat.sortConfig`
|
|
31466
|
-
* changes. buildTable() only sorts on data load, so edits to the sort
|
|
31467
|
-
* column/direction in the settings drawer would otherwise not reflect in the
|
|
31468
|
-
* preview until the next data refresh. Reads/writes of rows + columns run
|
|
31469
|
-
* untracked so this never loops, and a signature guard skips unrelated config
|
|
31470
|
-
* edits (colors, labels) plus manual header sorts, which don't touch the
|
|
31471
|
-
* persisted sort config.
|
|
31472
|
-
*/
|
|
31473
|
-
_sortConfigSync = effect(() => {
|
|
31474
|
-
const sortConfig = this.tableStyleConfig()?.sortConfig;
|
|
31475
|
-
const column = sortConfig?.column ?? '';
|
|
31476
|
-
const direction = sortConfig?.direction ?? 'asc';
|
|
31477
|
-
const sig = `${column}|${direction}`;
|
|
31478
|
-
untracked(() => {
|
|
31479
|
-
if (sig === this.lastSortSig)
|
|
31480
|
-
return;
|
|
31481
|
-
const hadColumn = Boolean(this.lastSortSig.split('|')[0]);
|
|
31482
|
-
this.lastSortSig = sig;
|
|
31483
|
-
const data = this.rawData();
|
|
31484
|
-
if (!data)
|
|
31485
|
-
return;
|
|
31486
|
-
if (column) {
|
|
31487
|
-
this.applyDefaultSort();
|
|
31488
|
-
}
|
|
31489
|
-
else if (hadColumn) {
|
|
31490
|
-
// A configured sort column was cleared → rebuild to restore the
|
|
31491
|
-
// natural (data) order.
|
|
31492
|
-
this.buildTable(data);
|
|
31493
|
-
}
|
|
31494
|
-
});
|
|
31495
|
-
}, ...(ngDevMode ? [{ debugName: "_sortConfigSync" }] : /* istanbul ignore next */ []));
|
|
31496
|
-
/**
|
|
31497
|
-
* Whether to skip currency formatting on cells.
|
|
31498
|
-
* Reads `clientConfig.tableFormat.disableCurrencyFormat`. Gated: only true
|
|
31499
|
-
* when the flag is explicitly set.
|
|
31500
|
-
*/
|
|
31501
|
-
disableCurrencyFormat = computed(() => this.tableStyleConfig()?.disableCurrencyFormat === true, ...(ngDevMode ? [{ debugName: "disableCurrencyFormat" }] : /* istanbul ignore next */ []));
|
|
31502
|
-
/** "% status color" toggle — color percentage cells by the row's status. */
|
|
31503
|
-
showPercentageStatus = computed(() => this.tableStyleConfig()?.showPercentageStatus === true, ...(ngDevMode ? [{ debugName: "showPercentageStatus" }] : /* istanbul ignore next */ []));
|
|
31504
|
-
/**
|
|
31505
|
-
* Resolve the row's status colour from the column whose viewType is 'status'
|
|
31506
|
-
* (e.g. Delayed -> red, Completed -> green). Used to tint percentage cells.
|
|
31507
|
-
*/
|
|
31508
|
-
getRowStatusColor(row) {
|
|
31509
|
-
for (const col of this.columns()) {
|
|
31510
|
-
if (String(col.viewType || '').toLowerCase() !== 'status')
|
|
31511
|
-
continue;
|
|
31512
|
-
const cell = row?.[col.key] ?? row?.[col.keyPure || ''];
|
|
31513
|
-
const value = cell && typeof cell === 'object' ? cell.value : cell;
|
|
31514
|
-
const color = value?.details?.color || value?.color || cell?.color;
|
|
31515
|
-
if (color)
|
|
31516
|
-
return String(color);
|
|
31517
|
-
}
|
|
31518
|
-
return '';
|
|
31519
|
-
}
|
|
31520
|
-
/**
|
|
31521
|
-
* Extra-columns-from-lookup config persisted at `clientConfig.tableCoulmns`
|
|
31522
|
-
* (misspelling preserved on purpose). Shape: { extraCoulmnFromLookup,
|
|
31523
|
-
* lookupId, groupedBy, propKey }. Read here so the renderer can react to it;
|
|
31524
|
-
* the data-join itself is performed in buildTable when present.
|
|
31525
|
-
*/
|
|
31526
|
-
extraColumnsConfig = computed(() => {
|
|
31527
|
-
const config = this.configurationItem();
|
|
31528
|
-
return config?.clientConfig?.['tableCoulmns'] || null;
|
|
31529
|
-
}, ...(ngDevMode ? [{ debugName: "extraColumnsConfig" }] : /* istanbul ignore next */ []));
|
|
31530
|
-
/** Whether to show index column */
|
|
31531
|
-
showIndex = computed(() => {
|
|
31532
|
-
const config = this.configurationItem();
|
|
31533
|
-
return config?.clientConfig?.configAsType?.['hideIndex'] !== true;
|
|
31534
|
-
}, ...(ngDevMode ? [{ debugName: "showIndex" }] : /* istanbul ignore next */ []));
|
|
31535
|
-
/** Whether table is grouped */
|
|
31536
|
-
isGrouped = computed(() => {
|
|
31537
|
-
const config = this.configurationItem();
|
|
31538
|
-
return !!(config?.serviceConfig?.['groupBy'] ||
|
|
31539
|
-
config?.serviceConfig?.['groupByMultiple']?.length);
|
|
31540
|
-
}, ...(ngDevMode ? [{ debugName: "isGrouped" }] : /* istanbul ignore next */ []));
|
|
31541
|
-
/** Has data */
|
|
31542
|
-
hasData = computed(() => {
|
|
31543
|
-
if (this.isGrouped()) {
|
|
31544
|
-
return this.groupedData()?.some((g) => g.data?.length > 0);
|
|
31545
|
-
}
|
|
31546
|
-
return this.tableRows()?.length > 0;
|
|
31547
|
-
}, ...(ngDevMode ? [{ debugName: "hasData" }] : /* istanbul ignore next */ []));
|
|
31548
|
-
/** Visible columns (not hidden) */
|
|
31549
|
-
visibleColumns = computed(() => {
|
|
31550
|
-
const cols = this.columns();
|
|
31551
|
-
const hiddenCols = this.tableStyleConfig()?.hiddenColumns?.map((c) => c.toLowerCase()) || [];
|
|
31552
|
-
return cols.filter((col) => !col.hideColumn &&
|
|
31553
|
-
!hiddenCols.includes(col.key?.toLowerCase()) &&
|
|
31554
|
-
!hiddenCols.includes(col.keyPure?.toLowerCase() || ''));
|
|
31555
|
-
}, ...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
|
|
31556
|
-
/** Row clickable */
|
|
31557
|
-
isRowClickable = computed(() => {
|
|
31558
|
-
const config = this.configurationItem();
|
|
31559
|
-
return config?.clientConfig?.actions?.some((a) => a.type === 'click' || a.type === 'dblclick' || a.type === 'rowClick');
|
|
31560
|
-
}, ...(ngDevMode ? [{ debugName: "isRowClickable" }] : /* istanbul ignore next */ []));
|
|
31561
|
-
// ── The standard grid ────────────────────────────────────────────────
|
|
31562
|
-
/** Rows for the standard grid: the source row, its index, its group and the group's aggregates. */
|
|
31563
|
-
gridRows = computed(() => {
|
|
31564
|
-
if (this.isGrouped())
|
|
31565
|
-
return this.groupedData().flatMap((group, groupIndex) => (group.data ?? []).map((row, index) => ({
|
|
31566
|
-
__row: row,
|
|
31567
|
-
__index: index + 1,
|
|
31568
|
-
__id: `${groupIndex}:${this.resolveRowTrackId(row, index)}`,
|
|
31569
|
-
__mtgroup: group.prop ?? null,
|
|
31570
|
-
__mtaggregates: this.aggregateSummary(group.aggregates),
|
|
31571
|
-
})));
|
|
31572
|
-
return this.tableRows().map((row, index) => ({
|
|
31573
|
-
__row: row,
|
|
31574
|
-
__index: index + 1,
|
|
31575
|
-
__id: this.resolveRowTrackId(row, index),
|
|
31576
|
-
}));
|
|
31577
|
-
}, ...(ngDevMode ? [{ debugName: "gridRows" }] : /* istanbul ignore next */ []));
|
|
31578
|
-
gridRowId = (row) => row.__id;
|
|
31579
|
-
gridCells = viewChildren('gridCell', ...(ngDevMode ? [{ debugName: "gridCells" }] : /* istanbul ignore next */ []));
|
|
31580
|
-
gridColumns = computed(() => {
|
|
31581
|
-
const cells = this.gridCells();
|
|
31582
|
-
const group = this.isGrouped()
|
|
31583
|
-
? [
|
|
31584
|
-
mtEntityColumn({
|
|
31585
|
-
key: '__mtgroup',
|
|
31586
|
-
label: '',
|
|
31587
|
-
viewType: (this.groupedData()[0]?.prop?.viewType ??
|
|
31588
|
-
'Text'),
|
|
31589
|
-
entity: (row) => row.__mtgroup ?? null,
|
|
31590
|
-
hidden: true,
|
|
31591
|
-
enableRowGroup: true,
|
|
31592
|
-
groupValueRenderer: TableCardGroupValue,
|
|
31593
|
-
}),
|
|
31594
|
-
]
|
|
31595
|
-
: [];
|
|
31596
|
-
const index = !this.tableStyleConfig()?.hideIndex && this.showIndex()
|
|
31597
|
-
? [
|
|
31598
|
-
{
|
|
31599
|
-
colId: '__index',
|
|
31600
|
-
field: '__index',
|
|
31601
|
-
headerName: '#',
|
|
31602
|
-
initialWidth: 72,
|
|
31603
|
-
type: 'rightAligned',
|
|
31604
|
-
filter: 'number',
|
|
31605
|
-
},
|
|
31606
|
-
]
|
|
31607
|
-
: [];
|
|
31608
|
-
return [
|
|
31609
|
-
...group,
|
|
31610
|
-
...index,
|
|
31611
|
-
...this.visibleColumns().map((column, position) => ({
|
|
31612
|
-
colId: column.key,
|
|
31613
|
-
headerName: column.label,
|
|
31614
|
-
minWidth: 120,
|
|
31615
|
-
// A phase-gate matrix cell has no order to sort by.
|
|
31616
|
-
...(this.isPhaseGateColumn(column) ? { sortable: false } : {}),
|
|
31617
|
-
filter: 'text',
|
|
31618
|
-
enableRowGroup: true,
|
|
31619
|
-
valueGetter: ({ data }) => this.getSortValue(data.__row, column),
|
|
31620
|
-
cellRenderer: MtTemplateCell,
|
|
31621
|
-
cellRendererParams: { template: cells[position] },
|
|
31622
|
-
})),
|
|
31623
|
-
];
|
|
31624
|
-
}, ...(ngDevMode ? [{ debugName: "gridColumns" }] : /* istanbul ignore next */ []));
|
|
31625
|
-
gridApi = signal(null, ...(ngDevMode ? [{ debugName: "gridApi" }] : /* istanbul ignore next */ []));
|
|
31626
|
-
gridHost = viewChild('gridHost', ...(ngDevMode ? [{ debugName: "gridHost" }] : /* istanbul ignore next */ []));
|
|
31627
|
-
/** The grid fills the card body; measured, because the dashboard layout sizes the card. */
|
|
31628
|
-
gridHeight = signal(400, ...(ngDevMode ? [{ debugName: "gridHeight" }] : /* istanbul ignore next */ []));
|
|
31629
|
-
gridEffects = [
|
|
31630
|
-
effect(() => {
|
|
31631
|
-
const api = this.gridApi(), grouped = this.isGrouped();
|
|
31632
|
-
if (!api)
|
|
31633
|
-
return;
|
|
31634
|
-
untracked(() => api.setRowGroupColumns(grouped ? ['__mtgroup'] : []));
|
|
31635
|
-
}),
|
|
31636
|
-
effect((onCleanup) => {
|
|
31637
|
-
const host = this.gridHost()?.nativeElement;
|
|
31638
|
-
if (!host || typeof ResizeObserver === 'undefined')
|
|
31639
|
-
return;
|
|
31640
|
-
const observer = new ResizeObserver(([entry]) => this.gridHeight.set(Math.max(240, Math.floor(entry?.contentRect.height ?? 400))));
|
|
31641
|
-
observer.observe(host);
|
|
31642
|
-
onCleanup(() => observer.disconnect());
|
|
31643
|
-
}),
|
|
31644
|
-
];
|
|
31645
|
-
/** Double-click on a data row runs the item's double-click action. */
|
|
31646
|
-
onGridDoubleClick(event) {
|
|
31647
|
-
const target = event.target;
|
|
31648
|
-
if (target?.closest('button,a,input,textarea,select,[role="button"]'))
|
|
31649
|
-
return;
|
|
31650
|
-
const id = target?.closest('[data-row-id]')?.getAttribute('data-row-id');
|
|
31651
|
-
const row = this.gridRows().find((candidate) => candidate.__id === id);
|
|
31652
|
-
if (row)
|
|
31653
|
-
this.onRowDblClick(row.__row);
|
|
31654
|
-
}
|
|
31655
|
-
ngOnInit() {
|
|
31656
|
-
const id = this.dashboardId();
|
|
31657
|
-
// Subscribe to configuration
|
|
31658
|
-
this.subscription.add(this.storeService
|
|
31659
|
-
.selectItemProperty$(id, 'ConfigurationItem')
|
|
31660
|
-
.subscribe((config) => {
|
|
31661
|
-
if (config) {
|
|
31662
|
-
this.configurationItem.set(config);
|
|
31663
|
-
}
|
|
31664
|
-
}));
|
|
31665
|
-
// Subscribe to data
|
|
31666
|
-
this.subscription.add(this.storeService
|
|
31667
|
-
.selectItemProperty$(id, 'DataHandled')
|
|
31668
|
-
.subscribe((data) => {
|
|
31669
|
-
this.rawData.set(data);
|
|
31670
|
-
this.buildTable(data);
|
|
31671
|
-
}));
|
|
31672
|
-
}
|
|
31673
|
-
ngOnDestroy() {
|
|
31674
|
-
this.clicks.cancel();
|
|
31675
|
-
this.subscription.unsubscribe();
|
|
31676
|
-
}
|
|
31677
|
-
resolveRowTrackId(row, index) {
|
|
31678
|
-
const rawId = row?.Id?.value ??
|
|
31679
|
-
row?.Id ??
|
|
31680
|
-
row?.id?.value ??
|
|
31681
|
-
row?.id ??
|
|
31682
|
-
row?._index ??
|
|
31683
|
-
index;
|
|
31684
|
-
return String(rawId);
|
|
31685
|
-
}
|
|
31686
|
-
/**
|
|
31687
|
-
* Build table columns and rows from raw data
|
|
31688
|
-
* Matches old buildTable logic in table-card.component.ts
|
|
31689
|
-
*/
|
|
31690
|
-
buildTable(data) {
|
|
31691
|
-
if (!data) {
|
|
31692
|
-
this.columns.set([]);
|
|
31693
|
-
this.tableRows.set([]);
|
|
31694
|
-
this.groupedData.set([]);
|
|
31695
|
-
this.labels.set([]);
|
|
31696
|
-
return;
|
|
31697
|
-
}
|
|
31698
|
-
const config = this.configurationItem();
|
|
31699
|
-
const languageCode = this.transloco.getActiveLang() || 'en';
|
|
31700
|
-
// Apply color overrides from percentage properties
|
|
31701
|
-
const colorConfig = config?.clientConfig?.configAsType?.['overrideSelectedPropertiesColors'];
|
|
31702
|
-
if (colorConfig && data.values) {
|
|
31703
|
-
data.values = fillColorForPercentageProperty(data.values, colorConfig);
|
|
31704
|
-
}
|
|
31705
|
-
// Get localization config
|
|
31706
|
-
const configLocalization = this.storeService.getLocalization?.() || {};
|
|
31707
|
-
const localization = switchAllKeysSmall(configLocalization);
|
|
31708
|
-
// Get label overrides
|
|
31709
|
-
const overrideLabels = switchAllKeysSmall(config?.clientConfig?.configAsType?.['overrideSelectedPropertiesLabels'] || {});
|
|
31710
|
-
if (this.isPhaseGateTable(config)) {
|
|
31711
|
-
this.buildPhaseGateTable(data, languageCode, localization, overrideLabels, config);
|
|
31712
|
-
return;
|
|
31713
|
-
}
|
|
31714
|
-
// Totals of the Aggregation Properties: the response root carries them
|
|
31715
|
-
// for a flat table, each group's data for a grouped one (#1850).
|
|
31716
|
-
this.tableAggregates.set(!this.isGrouped() && Array.isArray(data?.aggregates)
|
|
31717
|
-
? data.aggregates
|
|
31718
|
-
: []);
|
|
31719
|
-
if (this.isGrouped()) {
|
|
31720
|
-
// Grouped mode
|
|
31721
|
-
this.buildGroupedTable(data, languageCode, localization, overrideLabels);
|
|
31722
|
-
}
|
|
31723
|
-
else {
|
|
31724
|
-
// Non-grouped mode
|
|
31725
|
-
this.buildFlatTable(data, languageCode, localization, overrideLabels);
|
|
31726
|
-
}
|
|
31727
|
-
// Set labels. Grouped table responses are arrays, so labels may live on
|
|
31728
|
-
// the first group data block rather than at the response root.
|
|
31729
|
-
const dataLabels = this.extractLabels(data);
|
|
31730
|
-
this.labels.set(this.applyLegendOrder(dataLabels.map((l) => ({
|
|
31731
|
-
...l,
|
|
31732
|
-
shape: 'circle',
|
|
31733
|
-
}))));
|
|
31734
|
-
}
|
|
31735
|
-
/**
|
|
31736
|
-
* Build flat (non-grouped) table
|
|
31737
|
-
*/
|
|
31738
|
-
buildFlatTable(data, languageCode, localization, overrideLabels) {
|
|
31739
|
-
let values = data?.values || [];
|
|
31740
|
-
if (!values.length) {
|
|
31741
|
-
this.columns.set([]);
|
|
31742
|
-
this.tableRows.set([]);
|
|
31743
|
-
return;
|
|
31744
|
-
}
|
|
31745
|
-
// Apply lookupProperty ordering if configured
|
|
31746
|
-
const config = this.configurationItem();
|
|
31747
|
-
const lookupProperty = config?.serviceConfig?.query?.['lookupProperty'] ||
|
|
31748
|
-
config?.serviceConfig?.['lookupProperty'];
|
|
31749
|
-
const orderConfig = config?.clientConfig?.['orderConfig'];
|
|
31750
|
-
if (lookupProperty && orderConfig) {
|
|
31751
|
-
values = dynamicReorder({
|
|
31752
|
-
array: values,
|
|
31753
|
-
orderConfig: orderConfig,
|
|
31754
|
-
path: lookupProperty + '.value.key',
|
|
31755
|
-
});
|
|
31756
|
-
}
|
|
31757
|
-
const sampleItem = columnSample(values);
|
|
31758
|
-
// Build columns
|
|
31759
|
-
const cols = Object.keys(sampleItem).map((key, index) => {
|
|
31760
|
-
const prop = sampleItem[key];
|
|
31761
|
-
const overrideLabel = overrideLabels?.[key.toLowerCase()]?.[languageCode];
|
|
31762
|
-
return {
|
|
31763
|
-
key: prop?.normalizedKey !== 'Id'
|
|
31764
|
-
? (prop?.normalizedKey || key) + index
|
|
31765
|
-
: prop?.normalizedKey,
|
|
31766
|
-
keyPure: key,
|
|
31767
|
-
label: overrideLabel ||
|
|
31768
|
-
localization?.[key.toLowerCase()]?.[languageCode] ||
|
|
31769
|
-
prop?.label ||
|
|
31770
|
-
key,
|
|
31771
|
-
viewType: prop?.viewType,
|
|
31772
|
-
columnType: 'entity',
|
|
31773
|
-
hideColumn: isIdentityField(prop, key),
|
|
31774
|
-
};
|
|
31775
|
-
});
|
|
31776
|
-
this.columns.set(cols);
|
|
31777
|
-
// Build rows - store full entity data for each cell
|
|
31778
|
-
const rows = values.map((item, rowIndex) => {
|
|
31779
|
-
const itemLower = getObjectKeysInLowerCase(item);
|
|
31780
|
-
const rowData = { _index: rowIndex, _original: item };
|
|
31781
|
-
cols.forEach((col) => {
|
|
31782
|
-
// Find matching key in item by keyPure
|
|
31783
|
-
if (col.keyPure && itemLower[col.keyPure]) {
|
|
31784
|
-
rowData[col.key] = itemLower[col.keyPure];
|
|
31785
|
-
}
|
|
31786
|
-
});
|
|
31787
|
-
// Add Id for row click
|
|
31788
|
-
const idKey = Object.keys(item).find((k) => isIdentityField(item[k], k));
|
|
31789
|
-
if (idKey) {
|
|
31790
|
-
rowData['Id'] = item[idKey];
|
|
31791
|
-
}
|
|
31792
|
-
return rowData;
|
|
31793
|
-
});
|
|
31794
|
-
this.tableRows.set(rows);
|
|
31795
|
-
this.applyDefaultSort();
|
|
31796
|
-
}
|
|
31797
|
-
/**
|
|
31798
|
-
* Apply the configured default sort (tableFormat.sortConfig) on load. The
|
|
31799
|
-
* configured column is a selected-property key; match it against the built
|
|
31800
|
-
* columns (by keyPure / key prefix, case-insensitive) and sort the flat rows.
|
|
31801
|
-
* No-op when no sortConfig.column is set.
|
|
31802
|
-
*/
|
|
31803
|
-
applyDefaultSort() {
|
|
31804
|
-
const sortConfig = this.tableStyleConfig()?.sortConfig;
|
|
31805
|
-
const column = sortConfig?.column;
|
|
31806
|
-
if (!column)
|
|
31807
|
-
return;
|
|
31808
|
-
// Normalize like the hidden-columns match (strip separators + the trailing
|
|
31809
|
-
// index suffix on `key`) so the configured property key reliably resolves to
|
|
31810
|
-
// a built column whether it was stored as the key, normalizedKey or label.
|
|
31811
|
-
const norm = (s) => String(s ?? '')
|
|
31812
|
-
.toLowerCase()
|
|
31813
|
-
.replace(/[\s_-]+/g, '')
|
|
31814
|
-
.replace(/\d+$/, '');
|
|
31815
|
-
const target = norm(column);
|
|
31816
|
-
const cols = this.columns();
|
|
31817
|
-
const match = cols.find((c) => norm(c.keyPure) === target ||
|
|
31818
|
-
norm(c.key) === target ||
|
|
31819
|
-
norm(c.label) === target);
|
|
31820
|
-
if (!match)
|
|
31821
|
-
return;
|
|
31822
|
-
const asc = sortConfig?.direction !== 'desc';
|
|
31823
|
-
this.columns.set(cols.map((c) => ({
|
|
31824
|
-
...c,
|
|
31825
|
-
isSort: c.key === match.key,
|
|
31826
|
-
isAsc: c.key === match.key ? asc : c.isAsc,
|
|
31827
|
-
})));
|
|
31828
|
-
const rows = [...this.tableRows()];
|
|
31829
|
-
rows.sort((a, b) => {
|
|
31830
|
-
const aVal = this.getSortValue(a, match);
|
|
31831
|
-
const bVal = this.getSortValue(b, match);
|
|
31832
|
-
if (aVal === bVal)
|
|
31833
|
-
return 0;
|
|
31834
|
-
if (aVal === null || aVal === undefined)
|
|
31835
|
-
return 1;
|
|
31836
|
-
if (bVal === null || bVal === undefined)
|
|
31837
|
-
return -1;
|
|
31838
|
-
const comparison = aVal < bVal ? -1 : 1;
|
|
31839
|
-
return asc ? comparison : -comparison;
|
|
31840
|
-
});
|
|
31841
|
-
this.tableRows.set(rows);
|
|
31842
|
-
}
|
|
31843
|
-
/**
|
|
31844
|
-
* Build grouped table
|
|
31845
|
-
*/
|
|
31846
|
-
buildGroupedTable(data, languageCode, localization, overrideLabels) {
|
|
31847
|
-
if (!Array.isArray(data)) {
|
|
31848
|
-
this.columns.set([]);
|
|
31849
|
-
this.groupedData.set([]);
|
|
31850
|
-
return;
|
|
31851
|
-
}
|
|
31852
|
-
// Find first group with data to build columns
|
|
31853
|
-
let sampleItem = null;
|
|
31854
|
-
let sampleLabels = null;
|
|
31855
|
-
for (const groupItem of data) {
|
|
31856
|
-
if (groupItem.data?.values?.length > 0) {
|
|
31857
|
-
sampleItem = columnSample(groupItem.data.values);
|
|
31858
|
-
sampleLabels = groupItem.data.labels;
|
|
31859
|
-
break;
|
|
31860
|
-
}
|
|
31861
|
-
}
|
|
31862
|
-
if (!sampleItem) {
|
|
31863
|
-
this.columns.set([]);
|
|
31864
|
-
this.groupedData.set([]);
|
|
31865
|
-
return;
|
|
31866
|
-
}
|
|
31867
|
-
// Build columns
|
|
31868
|
-
const cols = Object.keys(sampleItem).map((key) => {
|
|
31869
|
-
const prop = sampleItem[key];
|
|
31870
|
-
const overrideLabel = overrideLabels?.[key.toLowerCase()]?.[languageCode];
|
|
31871
|
-
return {
|
|
31872
|
-
key: key,
|
|
31873
|
-
keyPure: key,
|
|
31874
|
-
label: overrideLabel ||
|
|
31875
|
-
localization?.[key.toLowerCase()]?.[languageCode] ||
|
|
31876
|
-
prop?.label ||
|
|
31877
|
-
key,
|
|
31878
|
-
viewType: prop?.viewType,
|
|
31879
|
-
columnType: 'entity',
|
|
31880
|
-
hideColumn: isIdentityField(prop, key),
|
|
31881
|
-
};
|
|
31882
|
-
});
|
|
31883
|
-
this.columns.set(cols);
|
|
31884
|
-
// Get lookupProperty ordering config
|
|
31885
|
-
const config = this.configurationItem();
|
|
31886
|
-
const lookupProperty = config?.serviceConfig?.query?.['lookupProperty'] ||
|
|
31887
|
-
config?.serviceConfig?.['lookupProperty'];
|
|
31888
|
-
const orderConfig = config?.clientConfig?.['orderConfig'];
|
|
31889
|
-
// Build grouped data
|
|
31890
|
-
const groups = data.map((groupItem) => {
|
|
31891
|
-
let groupValues = groupItem.data?.values || [];
|
|
31892
|
-
// Apply lookupProperty ordering to each group
|
|
31893
|
-
if (lookupProperty && orderConfig && groupValues.length) {
|
|
31894
|
-
groupValues = dynamicReorder({
|
|
31895
|
-
array: groupValues,
|
|
31896
|
-
orderConfig: orderConfig,
|
|
31897
|
-
path: lookupProperty + '.key',
|
|
31898
|
-
});
|
|
31899
|
-
}
|
|
31900
|
-
const processedData = groupValues.map((item) => {
|
|
31901
|
-
const itemLower = getObjectKeysInLowerCase(item);
|
|
31902
|
-
const rowData = { _original: item };
|
|
31903
|
-
Object.keys(itemLower).forEach((key) => {
|
|
31904
|
-
rowData[key] = itemLower[key];
|
|
31905
|
-
});
|
|
31906
|
-
return rowData;
|
|
31907
|
-
});
|
|
31908
|
-
return {
|
|
31909
|
-
prop: groupItem.groupByKey,
|
|
31910
|
-
data: processedData,
|
|
31911
|
-
aggregates: Array.isArray(groupItem.data?.aggregates)
|
|
31912
|
-
? groupItem.data.aggregates
|
|
31913
|
-
: [],
|
|
31914
|
-
};
|
|
31915
|
-
});
|
|
31916
|
-
this.groupedData.set(groups);
|
|
31917
|
-
this.labels.set(this.extractLabels(data, sampleLabels));
|
|
31918
|
-
}
|
|
31919
|
-
isPhaseGateTable(config) {
|
|
31920
|
-
return (config?.clientConfig?.componentName === 'phaseGateTable' ||
|
|
31921
|
-
config?.serviceConfig?.['componentName'] === 'phaseGateTable' ||
|
|
31922
|
-
config?.serviceConfig?.['serviceType'] === 'phaseGate');
|
|
31923
|
-
}
|
|
31924
|
-
buildPhaseGateTable(data, languageCode, localization, overrideLabels, config) {
|
|
31925
|
-
const values = this.extractPhaseGateValues(data);
|
|
31926
|
-
if (!values.length) {
|
|
31927
|
-
this.columns.set([]);
|
|
31928
|
-
this.tableRows.set([]);
|
|
31929
|
-
this.groupedData.set([]);
|
|
31930
|
-
this.labels.set([]);
|
|
31931
|
-
return;
|
|
31932
|
-
}
|
|
31933
|
-
const query = (config?.serviceConfig?.query ??
|
|
31934
|
-
{});
|
|
31935
|
-
const isCanonicalQuery = this.isCanonicalPhaseGateQuery(query);
|
|
31936
|
-
const sampleItem = this.findLargestRow(values);
|
|
31937
|
-
const fieldKeys = Object.keys(sampleItem);
|
|
31938
|
-
const phaseFields = this.resolvePhaseGateFields(values, query, isCanonicalQuery);
|
|
31939
|
-
const configuredBaseKeys = this.resolveConfiguredTableKeys(values, query, isCanonicalQuery);
|
|
31940
|
-
const baseKeys = (configuredBaseKeys ?? fieldKeys).filter((key) => {
|
|
31941
|
-
const prop = this.findFirstFieldValue(values, key);
|
|
31942
|
-
if (this.isConfiguredPhaseMetadataField(prop, key, phaseFields)) {
|
|
31943
|
-
return false;
|
|
31944
|
-
}
|
|
31945
|
-
if (!isCanonicalQuery && this.isLegacyPhaseGateMetaField(prop, key)) {
|
|
31946
|
-
return false;
|
|
31947
|
-
}
|
|
31948
|
-
return true;
|
|
31949
|
-
});
|
|
31950
|
-
const baseColumns = baseKeys.map((key, index) => {
|
|
31951
|
-
const prop = this.findFirstFieldValue(values, key);
|
|
31952
|
-
const overrideLabel = overrideLabels?.[key.toLowerCase()]?.[languageCode];
|
|
31953
|
-
return {
|
|
31954
|
-
key: !isIdentityField(prop, key) && prop?.normalizedKey
|
|
31955
|
-
? `${prop.normalizedKey}${index}`
|
|
31956
|
-
: key,
|
|
31957
|
-
keyPure: key,
|
|
31958
|
-
label: overrideLabel ||
|
|
31959
|
-
localization?.[key.toLowerCase()]?.[languageCode] ||
|
|
31960
|
-
prop?.label ||
|
|
31961
|
-
key,
|
|
31962
|
-
viewType: prop?.viewType,
|
|
31963
|
-
columnType: 'entity',
|
|
31964
|
-
hideColumn: isIdentityField(prop, key),
|
|
31965
|
-
};
|
|
31966
|
-
});
|
|
31967
|
-
const phaseOrder = new Map();
|
|
31968
|
-
values.forEach((item, encounterOrder) => {
|
|
31969
|
-
const row = getObjectKeysInLowerCase(item);
|
|
31970
|
-
const phaseValue = this.getPhaseGateFieldValue(row, phaseFields.phaseName);
|
|
31971
|
-
const phaseIdValue = this.getPhaseGateFieldValue(row, phaseFields.phaseId);
|
|
31972
|
-
const phaseLabel = this.getPhaseGateIdentityText(phaseValue) ||
|
|
31973
|
-
displayEntityValue(phaseIdValue) ||
|
|
31974
|
-
'Phase';
|
|
31975
|
-
const phaseIdentity = phaseFields.phaseId ? phaseIdValue : phaseValue;
|
|
31976
|
-
const phaseKey = this.toPhaseColumnKey(phaseIdentity, phaseLabel);
|
|
31977
|
-
if (!phaseOrder.has(phaseKey)) {
|
|
31978
|
-
phaseOrder.set(phaseKey, {
|
|
31979
|
-
label: phaseLabel,
|
|
31980
|
-
orderValue: this.getPhaseGateFieldValue(row, phaseFields.phaseOrder),
|
|
31981
|
-
encounterOrder,
|
|
31982
|
-
});
|
|
31983
|
-
}
|
|
31984
|
-
});
|
|
31985
|
-
const phaseColumns = Array.from(phaseOrder.entries())
|
|
31986
|
-
.sort((a, b) => this.comparePhaseGateOrder(a, b, phaseFields.phaseOrder !== null))
|
|
31987
|
-
.map(([key, value]) => ({
|
|
31988
|
-
key,
|
|
31989
|
-
label: value.label,
|
|
31990
|
-
columnType: 'phaseGate',
|
|
31991
|
-
width: '10rem',
|
|
31992
|
-
}));
|
|
31993
|
-
const rowMap = new Map();
|
|
31994
|
-
const statusLabels = new Map();
|
|
31995
|
-
values.forEach((item) => {
|
|
31996
|
-
const row = getObjectKeysInLowerCase(item);
|
|
31997
|
-
const groupKey = isCanonicalQuery
|
|
31998
|
-
? this.getCanonicalPhaseGateGroupKey(row, phaseFields.rowIdentity)
|
|
31999
|
-
: this.getLegacyPhaseGateGroupKey(row, baseColumns);
|
|
32000
|
-
let rowData = rowMap.get(groupKey);
|
|
32001
|
-
if (!rowData) {
|
|
32002
|
-
rowData = { _index: rowMap.size, _original: item };
|
|
32003
|
-
baseColumns.forEach((col) => {
|
|
32004
|
-
if (col.keyPure &&
|
|
32005
|
-
Object.prototype.hasOwnProperty.call(row, col.keyPure)) {
|
|
32006
|
-
rowData[col.key] = row[col.keyPure];
|
|
32007
|
-
}
|
|
32008
|
-
});
|
|
32009
|
-
if (isCanonicalQuery) {
|
|
32010
|
-
const identityValue = this.getPhaseGateFieldValue(row, phaseFields.rowIdentity);
|
|
32011
|
-
if (identityValue !== null && identityValue !== undefined) {
|
|
32012
|
-
rowData['Id'] = identityValue;
|
|
32013
|
-
}
|
|
32014
|
-
}
|
|
32015
|
-
else {
|
|
32016
|
-
const idKey = Object.keys(row).find((key) => isIdentityField(row[key], key));
|
|
32017
|
-
if (idKey) {
|
|
32018
|
-
rowData['Id'] = row[idKey];
|
|
32019
|
-
}
|
|
32020
|
-
}
|
|
32021
|
-
rowMap.set(groupKey, rowData);
|
|
32022
|
-
}
|
|
32023
|
-
const phaseValue = this.getPhaseGateFieldValue(row, phaseFields.phaseName);
|
|
32024
|
-
const phaseIdValue = this.getPhaseGateFieldValue(row, phaseFields.phaseId);
|
|
32025
|
-
const phaseLabel = this.getPhaseGateIdentityText(phaseValue) ||
|
|
32026
|
-
displayEntityValue(phaseIdValue) ||
|
|
32027
|
-
'Phase';
|
|
32028
|
-
const phaseIdentity = phaseFields.phaseId ? phaseIdValue : phaseValue;
|
|
32029
|
-
const phaseColumnKey = this.toPhaseColumnKey(phaseIdentity, phaseLabel);
|
|
32030
|
-
const cell = this.buildPhaseGateCell(row, phaseFields, item, phaseLabel);
|
|
32031
|
-
if (cell.statusLabel) {
|
|
32032
|
-
statusLabels.set(cell.statusLabel.toLowerCase(), {
|
|
32033
|
-
key: cell.statusLabel,
|
|
32034
|
-
label: cell.statusLabel,
|
|
32035
|
-
color: cell.statusColor || this.getPhaseGateCellColor(cell),
|
|
32036
|
-
});
|
|
32037
|
-
}
|
|
32038
|
-
rowData[phaseColumnKey] = cell;
|
|
32039
|
-
});
|
|
32040
|
-
this.columns.set([...baseColumns, ...phaseColumns]);
|
|
32041
|
-
this.tableRows.set(Array.from(rowMap.values()));
|
|
32042
|
-
this.groupedData.set([]);
|
|
32043
|
-
this.labels.set(this.applyLegendOrder(Array.from(statusLabels.values()).map((label) => ({
|
|
32044
|
-
...label,
|
|
32045
|
-
shape: 'circle',
|
|
32046
|
-
}))));
|
|
32047
|
-
}
|
|
32048
|
-
extractPhaseGateValues(data) {
|
|
32049
|
-
if (Array.isArray(data)) {
|
|
32050
|
-
return data.flatMap((group) => group?.data?.values || group?.values || []);
|
|
32051
|
-
}
|
|
32052
|
-
return Array.isArray(data?.values) ? data.values : [];
|
|
32053
|
-
}
|
|
32054
|
-
resolveConfiguredTableKeys(values, query, isCanonicalQuery) {
|
|
32055
|
-
const hasConfiguredList = isCanonicalQuery
|
|
32056
|
-
? Object.prototype.hasOwnProperty.call(query, 'baseProperties')
|
|
32057
|
-
: Object.prototype.hasOwnProperty.call(query, 'selectedProperties') ||
|
|
32058
|
-
Object.prototype.hasOwnProperty.call(query, 'properties');
|
|
32059
|
-
const configured = isCanonicalQuery
|
|
32060
|
-
? this.toStringArray(query['baseProperties'])
|
|
32061
|
-
: [
|
|
32062
|
-
...this.toStringArray(query['properties']),
|
|
32063
|
-
...this.toStringArray(query['selectedProperties']),
|
|
32064
|
-
];
|
|
32065
|
-
if (!configured.length)
|
|
32066
|
-
return hasConfiguredList ? [] : null;
|
|
32067
|
-
const seen = new Set();
|
|
32068
|
-
const resolved = [];
|
|
32069
|
-
configured.forEach((configuredKey) => {
|
|
32070
|
-
const responseKey = this.resolvePhaseGateFieldKey(values, configuredKey);
|
|
32071
|
-
if (!responseKey)
|
|
32072
|
-
return;
|
|
32073
|
-
const normalized = normalizePhaseGatePropertyIdentity(responseKey);
|
|
32074
|
-
if (seen.has(normalized))
|
|
32075
|
-
return;
|
|
32076
|
-
seen.add(normalized);
|
|
32077
|
-
resolved.push(responseKey.toLowerCase());
|
|
32078
|
-
});
|
|
32079
|
-
return resolved;
|
|
32080
|
-
}
|
|
32081
|
-
toStringArray(value) {
|
|
32082
|
-
if (!Array.isArray(value))
|
|
32083
|
-
return [];
|
|
32084
|
-
return value.filter((item) => typeof item === 'string');
|
|
32085
|
-
}
|
|
32086
|
-
findLargestRow(values) {
|
|
32087
|
-
let sample = getObjectKeysInLowerCase(values[0] || {});
|
|
32088
|
-
values.forEach((item) => {
|
|
32089
|
-
const itemLower = getObjectKeysInLowerCase(item);
|
|
32090
|
-
if (Object.keys(itemLower).length > Object.keys(sample).length) {
|
|
32091
|
-
sample = itemLower;
|
|
32092
|
-
}
|
|
32093
|
-
});
|
|
32094
|
-
return sample;
|
|
32095
|
-
}
|
|
32096
|
-
isCanonicalPhaseGateQuery(query) {
|
|
32097
|
-
return [
|
|
32098
|
-
query.rowIdentityProperty,
|
|
32099
|
-
query.phaseNameProperty,
|
|
32100
|
-
query.phaseStatusProperty,
|
|
32101
|
-
].every((value) => typeof value === 'string' && value.trim().length > 0);
|
|
32102
|
-
}
|
|
32103
|
-
resolvePhaseGateFields(values, query, isCanonicalQuery) {
|
|
32104
|
-
const configuredFields = {
|
|
32105
|
-
rowIdentity: this.readPhaseGateProperty(query.rowIdentityProperty),
|
|
32106
|
-
phaseName: this.readPhaseGateProperty(query.phaseNameProperty),
|
|
32107
|
-
phaseId: this.readPhaseGateProperty(query.phaseIdProperty),
|
|
32108
|
-
phaseOrder: this.readPhaseGateProperty(query.phaseOrderProperty),
|
|
32109
|
-
isCurrent: this.readPhaseGateProperty(query.phaseIsCurrentProperty),
|
|
32110
|
-
isCompleted: this.readPhaseGateProperty(query.phaseIsCompletedProperty),
|
|
32111
|
-
allItemsCompleted: this.readPhaseGateProperty(query.phaseAllItemsCompletedProperty),
|
|
32112
|
-
status: this.readPhaseGateProperty(query.phaseStatusProperty),
|
|
32113
|
-
percentage: this.readPhaseGateProperty(query.phaseProgressProperty),
|
|
32114
|
-
};
|
|
32115
|
-
if (isCanonicalQuery)
|
|
32116
|
-
return configuredFields;
|
|
32117
|
-
// A partially migrated dashboard remains on the legacy path, but any
|
|
32118
|
-
// explicit semantic role still wins and is resolved exactly.
|
|
32119
|
-
const lookupProperty = this.readPhaseGateProperty(query['lookupProperty']);
|
|
32120
|
-
const fields = {
|
|
32121
|
-
...configuredFields,
|
|
32122
|
-
status: configuredFields.status || lookupProperty,
|
|
32123
|
-
};
|
|
32124
|
-
fields.phaseName ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32125
|
-
'phase_name',
|
|
32126
|
-
'phasegate_name',
|
|
32127
|
-
]);
|
|
32128
|
-
fields.phaseId ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32129
|
-
'phase_schemagateid',
|
|
32130
|
-
'phasegate_id',
|
|
32131
|
-
'phasegateid',
|
|
32132
|
-
]);
|
|
32133
|
-
fields.phaseOrder ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32134
|
-
'phase_order',
|
|
32135
|
-
'phasegate_order',
|
|
32136
|
-
'phase_sequence',
|
|
32137
|
-
]);
|
|
32138
|
-
fields.isCurrent ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32139
|
-
'phase_iscurrent',
|
|
32140
|
-
'phasegate_iscurrent',
|
|
32141
|
-
'iscurrentphase',
|
|
32142
|
-
]);
|
|
32143
|
-
fields.isCompleted ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32144
|
-
'phase_iscompleted',
|
|
32145
|
-
'phasegate_iscompleted',
|
|
32146
|
-
'iscompletedphase',
|
|
32147
|
-
]);
|
|
32148
|
-
fields.allItemsCompleted ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32149
|
-
'phase_all_items_completed',
|
|
32150
|
-
'phasegate_all_items_completed',
|
|
32151
|
-
'allitemscompleted',
|
|
32152
|
-
]);
|
|
32153
|
-
fields.status ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32154
|
-
'phase_status',
|
|
32155
|
-
'phasegate_status',
|
|
32156
|
-
'phase_request_status',
|
|
32157
|
-
'phasegate_request_status',
|
|
32158
|
-
]);
|
|
32159
|
-
fields.percentage ??= this.resolveLegacyPhaseGateAlias(values, [
|
|
32160
|
-
'phase_percentage',
|
|
32161
|
-
'phasegate_percentage',
|
|
32162
|
-
'phase_progress',
|
|
32163
|
-
'phasegate_progress',
|
|
32164
|
-
]);
|
|
32165
|
-
fields.status ??= this.resolveLegacyFieldByViewType(values, [
|
|
32166
|
-
'status',
|
|
32167
|
-
'requeststatus',
|
|
32168
|
-
]);
|
|
32169
|
-
fields.percentage ??= this.resolveLegacyFieldByViewType(values, [
|
|
32170
|
-
'percentage',
|
|
32171
|
-
'slider',
|
|
32172
|
-
]);
|
|
32173
|
-
return fields;
|
|
32174
|
-
}
|
|
32175
|
-
findFirstFieldValue(values, key) {
|
|
32176
|
-
const normalizedKey = key.toLowerCase();
|
|
32177
|
-
for (const item of values) {
|
|
32178
|
-
const row = getObjectKeysInLowerCase(item);
|
|
32179
|
-
if (Object.prototype.hasOwnProperty.call(row, normalizedKey)) {
|
|
32180
|
-
return row[normalizedKey];
|
|
32181
|
-
}
|
|
32182
|
-
}
|
|
32183
|
-
return null;
|
|
32184
|
-
}
|
|
32185
|
-
readPhaseGateProperty(value) {
|
|
32186
|
-
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
32187
|
-
}
|
|
32188
|
-
resolvePhaseGateFieldKey(values, configuredKey) {
|
|
32189
|
-
if (!configuredKey)
|
|
32190
|
-
return null;
|
|
32191
|
-
for (const item of values) {
|
|
32192
|
-
const row = getObjectKeysInLowerCase(item);
|
|
32193
|
-
const key = resolvePhaseGateResponseKey(row, configuredKey);
|
|
32194
|
-
if (key)
|
|
32195
|
-
return key;
|
|
32196
|
-
}
|
|
32197
|
-
return null;
|
|
32198
|
-
}
|
|
32199
|
-
resolveLegacyPhaseGateAlias(values, aliases) {
|
|
32200
|
-
for (const alias of aliases) {
|
|
32201
|
-
const key = this.resolvePhaseGateFieldKey(values, alias);
|
|
32202
|
-
if (key)
|
|
32203
|
-
return key;
|
|
32204
|
-
}
|
|
32205
|
-
return null;
|
|
32206
|
-
}
|
|
32207
|
-
resolveLegacyFieldByViewType(values, viewTypes) {
|
|
32208
|
-
const allowedTypes = new Set(viewTypes.map(normalizeIdentity));
|
|
32209
|
-
const candidateKeys = Array.from(new Set(values.flatMap((item) => Object.keys(getObjectKeysInLowerCase(item))))).sort((left, right) => {
|
|
32210
|
-
const leftProp = this.findFirstFieldValue(values, left);
|
|
32211
|
-
const rightProp = this.findFirstFieldValue(values, right);
|
|
32212
|
-
const leftIdentity = fieldIdentity(leftProp, left);
|
|
32213
|
-
const rightIdentity = fieldIdentity(rightProp, right);
|
|
32214
|
-
const leftPhaseRank = leftIdentity.includes('phasegate')
|
|
32215
|
-
? 0
|
|
32216
|
-
: leftIdentity.includes('phase')
|
|
32217
|
-
? 1
|
|
32218
|
-
: 2;
|
|
32219
|
-
const rightPhaseRank = rightIdentity.includes('phasegate')
|
|
32220
|
-
? 0
|
|
32221
|
-
: rightIdentity.includes('phase')
|
|
32222
|
-
? 1
|
|
32223
|
-
: 2;
|
|
32224
|
-
if (leftPhaseRank !== rightPhaseRank) {
|
|
32225
|
-
return leftPhaseRank - rightPhaseRank;
|
|
32226
|
-
}
|
|
32227
|
-
return leftIdentity.localeCompare(rightIdentity, undefined, {
|
|
32228
|
-
numeric: true,
|
|
32229
|
-
sensitivity: 'base',
|
|
32230
|
-
});
|
|
32231
|
-
});
|
|
32232
|
-
return (candidateKeys.find((key) => {
|
|
32233
|
-
const prop = this.findFirstFieldValue(values, key);
|
|
32234
|
-
return allowedTypes.has(normalizeIdentity(prop?.viewType));
|
|
32235
|
-
}) ?? null);
|
|
32236
|
-
}
|
|
32237
|
-
getPhaseGateFieldValue(row, property) {
|
|
32238
|
-
if (!property)
|
|
32239
|
-
return null;
|
|
32240
|
-
const responseKey = resolvePhaseGateResponseKey(row, property);
|
|
32241
|
-
return responseKey ? row[responseKey] : null;
|
|
32242
|
-
}
|
|
32243
|
-
getPhaseGateIdentityText(value) {
|
|
32244
|
-
const runtimeValue = unwrapEntityValue(value);
|
|
32245
|
-
if (runtimeValue !== null &&
|
|
32246
|
-
runtimeValue !== undefined &&
|
|
32247
|
-
typeof runtimeValue !== 'object') {
|
|
32248
|
-
return String(runtimeValue);
|
|
32249
|
-
}
|
|
32250
|
-
return displayEntityValue(value);
|
|
32251
|
-
}
|
|
32252
|
-
isConfiguredPhaseMetadataField(prop, key, fields) {
|
|
32253
|
-
const phaseMetadataRoles = [
|
|
32254
|
-
fields.phaseName,
|
|
32255
|
-
fields.phaseId,
|
|
32256
|
-
fields.phaseOrder,
|
|
32257
|
-
fields.status,
|
|
32258
|
-
fields.percentage,
|
|
32259
|
-
fields.isCurrent,
|
|
32260
|
-
fields.isCompleted,
|
|
32261
|
-
fields.allItemsCompleted,
|
|
32262
|
-
];
|
|
32263
|
-
const row = { [key]: prop };
|
|
32264
|
-
return phaseMetadataRoles.some((role) => !!role && resolvePhaseGateResponseKey(row, role) === key);
|
|
32265
|
-
}
|
|
32266
|
-
isLegacyPhaseGateMetaField(prop, key) {
|
|
32267
|
-
const aliases = [
|
|
32268
|
-
'phase_name',
|
|
32269
|
-
'phasegate_name',
|
|
32270
|
-
'phase_schemagateid',
|
|
32271
|
-
'phasegate_id',
|
|
32272
|
-
'phase_order',
|
|
32273
|
-
'phasegate_order',
|
|
32274
|
-
'phase_iscurrent',
|
|
32275
|
-
'phasegate_iscurrent',
|
|
32276
|
-
'phase_iscompleted',
|
|
32277
|
-
'phasegate_iscompleted',
|
|
32278
|
-
'phase_all_items_completed',
|
|
32279
|
-
'phasegate_all_items_completed',
|
|
32280
|
-
'phase_status',
|
|
32281
|
-
'phasegate_status',
|
|
32282
|
-
'phase_request_status',
|
|
32283
|
-
'phasegate_request_status',
|
|
32284
|
-
'phase_percentage',
|
|
32285
|
-
'phasegate_percentage',
|
|
32286
|
-
'phase_progress',
|
|
32287
|
-
'phasegate_progress',
|
|
32288
|
-
];
|
|
32289
|
-
const row = { [key]: prop };
|
|
32290
|
-
return aliases.some((alias) => resolvePhaseGateResponseKey(row, alias) === key);
|
|
32291
|
-
}
|
|
32292
|
-
toPhaseColumnKey(identityValue, fallbackLabel) {
|
|
32293
|
-
const primitiveIdentity = unwrapEntityValue(identityValue);
|
|
32294
|
-
const identity = normalizePhaseGatePropertyIdentity(primitiveIdentity || fallbackLabel || 'unknown');
|
|
32295
|
-
return `_phase_${identity || 'unknown'}`;
|
|
32296
|
-
}
|
|
32297
|
-
comparePhaseGateOrder(left, right, hasConfiguredOrder) {
|
|
32298
|
-
if (!hasConfiguredOrder) {
|
|
32299
|
-
return left[1].encounterOrder - right[1].encounterOrder;
|
|
32300
|
-
}
|
|
32301
|
-
// The order is the cell's own value. displayEntityValue would prefer the
|
|
32302
|
-
// wrapper's `label` — the property name ("Order") — making every phase
|
|
32303
|
-
// tie and the columns fall back to alphabetical order.
|
|
32304
|
-
const orderText = (value) => {
|
|
32305
|
-
const raw = unwrapEntityValue(value);
|
|
32306
|
-
return raw === null || raw === undefined || typeof raw === 'object'
|
|
32307
|
-
? ''
|
|
32308
|
-
: String(raw).trim();
|
|
32309
|
-
};
|
|
32310
|
-
const leftOrder = orderText(left[1].orderValue);
|
|
32311
|
-
const rightOrder = orderText(right[1].orderValue);
|
|
32312
|
-
if (leftOrder && rightOrder) {
|
|
32313
|
-
const leftNumber = Number(leftOrder);
|
|
32314
|
-
const rightNumber = Number(rightOrder);
|
|
32315
|
-
if (Number.isFinite(leftNumber) && Number.isFinite(rightNumber)) {
|
|
32316
|
-
const numericComparison = leftNumber - rightNumber;
|
|
32317
|
-
if (numericComparison !== 0)
|
|
32318
|
-
return numericComparison;
|
|
32319
|
-
}
|
|
32320
|
-
else {
|
|
32321
|
-
const textComparison = leftOrder.localeCompare(rightOrder, undefined, {
|
|
32322
|
-
numeric: true,
|
|
32323
|
-
sensitivity: 'base',
|
|
32324
|
-
});
|
|
32325
|
-
if (textComparison !== 0)
|
|
32326
|
-
return textComparison;
|
|
32327
|
-
}
|
|
32328
|
-
}
|
|
32329
|
-
else if (leftOrder || rightOrder) {
|
|
32330
|
-
return leftOrder ? -1 : 1;
|
|
32331
|
-
}
|
|
32332
|
-
const labelComparison = left[1].label.localeCompare(right[1].label, undefined, { numeric: true, sensitivity: 'base' });
|
|
32333
|
-
return labelComparison || left[0].localeCompare(right[0]);
|
|
32334
|
-
}
|
|
32335
|
-
getCanonicalPhaseGateGroupKey(row, rowIdentityProperty) {
|
|
32336
|
-
const identityValue = this.getPhaseGateFieldValue(row, rowIdentityProperty);
|
|
32337
|
-
return `id:${this.toStablePhaseGateValue(identityValue)}`;
|
|
32338
|
-
}
|
|
32339
|
-
getLegacyPhaseGateGroupKey(row, baseColumns) {
|
|
32340
|
-
const identityColumn = baseColumns.find((col) => col.keyPure && isIdentityField(row[col.keyPure], col.keyPure));
|
|
32341
|
-
if (identityColumn?.keyPure) {
|
|
32342
|
-
return `id:${this.toStablePhaseGateValue(row[identityColumn.keyPure])}`;
|
|
32343
|
-
}
|
|
32344
|
-
const parts = baseColumns
|
|
32345
|
-
.filter((col) => col.keyPure)
|
|
32346
|
-
.map((col) => this.toStablePhaseGateValue(row[col.keyPure]));
|
|
32347
|
-
return parts.some(Boolean)
|
|
32348
|
-
? `values:${JSON.stringify(parts)}`
|
|
32349
|
-
: 'values:unidentified';
|
|
32350
|
-
}
|
|
32351
|
-
toStablePhaseGateValue(value) {
|
|
32352
|
-
const primitive = unwrapEntityValue(value);
|
|
32353
|
-
if (primitive === null || primitive === undefined)
|
|
32354
|
-
return '';
|
|
32355
|
-
if (typeof primitive !== 'object')
|
|
32356
|
-
return String(primitive);
|
|
32357
|
-
return displayEntityValue(primitive);
|
|
32358
|
-
}
|
|
32359
|
-
buildPhaseGateCell(row, fields, original, phaseName) {
|
|
32360
|
-
const statusValue = this.getPhaseGateFieldValue(row, fields.status);
|
|
32361
|
-
const percentageValue = this.getPhaseGateFieldValue(row, fields.percentage);
|
|
32362
|
-
return {
|
|
32363
|
-
phaseName,
|
|
32364
|
-
statusLabel: displayEntityValue(statusValue),
|
|
32365
|
-
statusColor: getEntityColor(statusValue),
|
|
32366
|
-
percentage: toNumberValue(percentageValue),
|
|
32367
|
-
isCurrent: fields.isCurrent
|
|
32368
|
-
? toBooleanValue(this.getPhaseGateFieldValue(row, fields.isCurrent))
|
|
32369
|
-
: false,
|
|
32370
|
-
isCompleted: fields.isCompleted
|
|
32371
|
-
? toBooleanValue(this.getPhaseGateFieldValue(row, fields.isCompleted))
|
|
32372
|
-
: false,
|
|
32373
|
-
allItemsCompleted: fields.allItemsCompleted
|
|
32374
|
-
? toBooleanValue(this.getPhaseGateFieldValue(row, fields.allItemsCompleted))
|
|
32375
|
-
: false,
|
|
32376
|
-
raw: original,
|
|
32377
|
-
};
|
|
32378
|
-
}
|
|
32379
|
-
getLegendColor(label) {
|
|
32380
|
-
const override = resolveLegendColorOverride(this.configurationItem()?.clientConfig?.configAsType?.['legend']?.['colorOverrides'], this.getLegendText(label));
|
|
32381
|
-
return (override ||
|
|
32382
|
-
label?.details?.color ||
|
|
32383
|
-
label?.value?.details?.color ||
|
|
32384
|
-
label?.color ||
|
|
32385
|
-
label?.backgroundColor ||
|
|
32386
|
-
'#999');
|
|
32387
|
-
}
|
|
32388
|
-
getLegendText(label) {
|
|
32389
|
-
const languageCode = this.transloco.getActiveLang() || 'en';
|
|
32390
|
-
const localizedLabel = label?.label && typeof label.label === 'object'
|
|
32391
|
-
? label.label?.[languageCode] || label.label?.en || label.label?.ar
|
|
32392
|
-
: label?.label;
|
|
32393
|
-
const value = label?.value;
|
|
32394
|
-
return (localizedLabel ||
|
|
32395
|
-
label?.name ||
|
|
32396
|
-
label?.display ||
|
|
32397
|
-
label?.title ||
|
|
32398
|
-
value?.name ||
|
|
32399
|
-
value?.display ||
|
|
32400
|
-
value?.label ||
|
|
32401
|
-
value?.key ||
|
|
32402
|
-
label?.key ||
|
|
32403
|
-
'');
|
|
32404
|
-
}
|
|
32405
|
-
applyLegendOrder(labels) {
|
|
32406
|
-
return orderLegendItems(labels, getLegendOverrideOrder(this.configurationItem()), (label) => this.getLegendText(label));
|
|
32407
|
-
}
|
|
32408
|
-
extractLabels(data, fallback = null) {
|
|
32409
|
-
if (Array.isArray(fallback) && fallback.length) {
|
|
32410
|
-
return fallback;
|
|
32411
|
-
}
|
|
32412
|
-
if (Array.isArray(data)) {
|
|
32413
|
-
for (const groupItem of data) {
|
|
32414
|
-
const labels = groupItem?.data?.labels;
|
|
32415
|
-
if (Array.isArray(labels) && labels.length) {
|
|
32416
|
-
return labels;
|
|
32417
|
-
}
|
|
32418
|
-
}
|
|
32419
|
-
return [];
|
|
32420
|
-
}
|
|
32421
|
-
return Array.isArray(data?.labels) ? data.labels : [];
|
|
32422
|
-
}
|
|
32423
|
-
/**
|
|
32424
|
-
* Get cell data for entity-info component
|
|
32425
|
-
* Returns the full entity data object { viewType, value, label }
|
|
32426
|
-
*/
|
|
32427
|
-
getCellData(row, column) {
|
|
32428
|
-
const cellData = row[column.key] || row[column.keyPure || ''];
|
|
32429
|
-
if (!cellData) {
|
|
32430
|
-
return { viewType: column.viewType || 'text', value: null };
|
|
32431
|
-
}
|
|
32432
|
-
// If it's already an entity object with viewType
|
|
32433
|
-
if (typeof cellData === 'object' && cellData !== null) {
|
|
32434
|
-
const viewType = cellData.viewType || column.viewType || 'text';
|
|
32435
|
-
// disableCurrencyFormat: render currency cells as a plain number so no
|
|
32436
|
-
// currency formatting / symbol is applied. Gated — only when the flag is
|
|
32437
|
-
// set AND the cell is currency, otherwise behavior is unchanged.
|
|
32438
|
-
if (this.disableCurrencyFormat() &&
|
|
32439
|
-
String(viewType).toLowerCase() === 'currency') {
|
|
32440
|
-
return {
|
|
32441
|
-
viewType: 'number',
|
|
32442
|
-
value: unwrapEntityValue(cellData),
|
|
32443
|
-
label: cellData.label,
|
|
32444
|
-
};
|
|
32445
|
-
}
|
|
32446
|
-
const base = {
|
|
32447
|
-
viewType,
|
|
32448
|
-
value: cellData.value,
|
|
32449
|
-
label: cellData.label,
|
|
32450
|
-
};
|
|
32451
|
-
// "% status color": tint the percentage progress bar / dot by the ROW's
|
|
32452
|
-
// status property color (the column whose viewType is 'status'), instead
|
|
32453
|
-
// of the percentage cell's own (usually empty) color. Gated on the toggle.
|
|
32454
|
-
if (this.showPercentageStatus() &&
|
|
32455
|
-
String(viewType).toLowerCase() === 'percentage') {
|
|
32456
|
-
return { ...base, statusColor: this.getRowStatusColor(row) };
|
|
32457
|
-
}
|
|
32458
|
-
return base;
|
|
32459
|
-
}
|
|
32460
|
-
// Primitive value
|
|
32461
|
-
const primitiveViewType = column.viewType || 'text';
|
|
32462
|
-
if (this.disableCurrencyFormat() &&
|
|
32463
|
-
String(primitiveViewType).toLowerCase() === 'currency') {
|
|
32464
|
-
return { viewType: 'number', value: cellData };
|
|
32465
|
-
}
|
|
32466
|
-
return {
|
|
32467
|
-
viewType: primitiveViewType,
|
|
32468
|
-
value: cellData,
|
|
32469
|
-
};
|
|
32470
|
-
}
|
|
32471
|
-
isPhaseGateColumn(column) {
|
|
32472
|
-
return column.columnType === 'phaseGate';
|
|
32473
|
-
}
|
|
32474
|
-
getPhaseGateCell(row, column) {
|
|
32475
|
-
return row?.[column.key] || null;
|
|
32476
|
-
}
|
|
32477
|
-
getPhaseGateCellColor(cell) {
|
|
32478
|
-
if (!cell)
|
|
32479
|
-
return '#9ca3af';
|
|
32480
|
-
if (cell.statusColor)
|
|
32481
|
-
return cell.statusColor;
|
|
32482
|
-
if (cell.isCompleted && cell.allItemsCompleted)
|
|
32483
|
-
return '#16a34a';
|
|
32484
|
-
if (cell.isCompleted)
|
|
32485
|
-
return '#22c55e';
|
|
32486
|
-
if (cell.isCurrent)
|
|
32487
|
-
return 'var(--primary-color, #3b82f6)';
|
|
32488
|
-
return '#9ca3af';
|
|
32489
|
-
}
|
|
32490
|
-
getPhaseGateCellText(cell) {
|
|
32491
|
-
if (!cell)
|
|
32492
|
-
return '__';
|
|
32493
|
-
if (cell.statusLabel)
|
|
32494
|
-
return cell.statusLabel;
|
|
32495
|
-
if (cell.isCompleted)
|
|
32496
|
-
return 'Completed';
|
|
32497
|
-
if (cell.isCurrent)
|
|
32498
|
-
return 'Current';
|
|
32499
|
-
return 'Pending';
|
|
32500
|
-
}
|
|
32501
|
-
getPhaseGatePercentage(cell) {
|
|
32502
|
-
if (cell?.percentage === null || cell?.percentage === undefined) {
|
|
32503
|
-
return null;
|
|
32504
|
-
}
|
|
32505
|
-
return Math.max(0, Math.min(100, cell.percentage));
|
|
32506
|
-
}
|
|
32507
|
-
getPhaseGateCellTooltip(cell) {
|
|
32508
|
-
if (!cell)
|
|
32509
|
-
return '';
|
|
32510
|
-
const parts = [cell.phaseName, this.getPhaseGateCellText(cell)].filter(Boolean);
|
|
32511
|
-
const percentage = this.getPhaseGatePercentage(cell);
|
|
32512
|
-
if (percentage !== null) {
|
|
32513
|
-
parts.push(`${percentage}%`);
|
|
32514
|
-
}
|
|
32515
|
-
return parts.join(' - ');
|
|
32516
|
-
}
|
|
32517
|
-
/**
|
|
32518
|
-
* Get sortable value from row
|
|
32519
|
-
*/
|
|
32520
|
-
getSortValue(row, column) {
|
|
32521
|
-
const cellData = row[column.key] || row[column.keyPure || ''];
|
|
32522
|
-
if (!cellData)
|
|
32523
|
-
return null;
|
|
32524
|
-
if (typeof cellData === 'object') {
|
|
32525
|
-
// For entity values, get the actual value
|
|
32526
|
-
const val = cellData.value;
|
|
32527
|
-
if (typeof val === 'object') {
|
|
32528
|
-
return val.name || val.displayName || val.display || '';
|
|
32529
|
-
}
|
|
32530
|
-
return val;
|
|
32531
|
-
}
|
|
32532
|
-
return cellData;
|
|
32533
|
-
}
|
|
32534
|
-
/** Delays a click only while a Double Click action is configured (#1905). */
|
|
32535
|
-
clicks = new ClickDispatcher();
|
|
32536
|
-
/**
|
|
32537
|
-
* Handle row click
|
|
32538
|
-
*/
|
|
32539
|
-
onRowClick(row) {
|
|
32540
|
-
this.clicks.click(hasDoubleClickAction(this.configurationItem()), () => this.emitRowAction('click', row));
|
|
32541
|
-
}
|
|
32542
|
-
/** Handle row double click — the Actions drawer offers it for tables too. */
|
|
32543
|
-
onRowDblClick(row) {
|
|
32544
|
-
this.clicks.doubleClick(() => this.emitRowAction('dblclick', row));
|
|
32545
|
-
}
|
|
32546
|
-
emitRowAction(type, row) {
|
|
32547
|
-
if (!this.isRowClickable())
|
|
32548
|
-
return;
|
|
32549
|
-
const config = this.configurationItem();
|
|
32550
|
-
if (!config)
|
|
32551
|
-
return;
|
|
32552
|
-
// Build body with key from Id
|
|
32553
|
-
const body = {
|
|
32554
|
-
...row,
|
|
32555
|
-
key: row.Id?.value,
|
|
32556
|
-
};
|
|
32557
|
-
// Emit action — routed through dashboard-item.doActions -> ActionService.
|
|
32558
|
-
this.onAction.emit({ type, data: body });
|
|
32559
|
-
}
|
|
32560
|
-
/**
|
|
32561
|
-
* Handle header click
|
|
32562
|
-
*/
|
|
32563
|
-
onHeaderClick() {
|
|
32564
|
-
const config = this.configurationItem();
|
|
32565
|
-
if (!config)
|
|
32566
|
-
return;
|
|
32567
|
-
this.onAction.emit({ type: 'clickOnHeader', data: {} });
|
|
32568
|
-
}
|
|
32569
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32570
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardComponent, isStandalone: true, selector: "mt-table-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, viewQueries: [{ propertyName: "gridCells", predicate: ["gridCell"], descendants: true, isSignal: true }, { propertyName: "gridHost", first: true, predicate: ["gridHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- One legend definition; the body grid places it on any configured edge. -->\n<ng-template #legendList>\n <div\n class=\"flex flex-wrap items-center gap-2\"\n [class.flex-col]=\"isSideLegend()\"\n [class.items-start]=\"isSideLegend()\"\n >\n @for (label of labels(); track label.key || $index) {\n <div class=\"flex items-center gap-1 text-xs\">\n <span\n class=\"table-legend-marker\"\n [class.shape-rect]=\"legendIconType() === 'rect'\"\n [class.shape-roundRect]=\"legendIconType() === 'roundRect'\"\n [class.shape-diamond]=\"legendIconType() === 'diamond'\"\n [class.shape-triangle]=\"legendIconType() === 'triangle'\"\n [style.backgroundColor]=\"\n legendIconType() === 'triangle' ? null : getLegendColor(label)\n \"\n [style.border-bottom-color]=\"\n legendIconType() === 'triangle' ? getLegendColor(label) : null\n \"\n ></span>\n <span>{{ getLegendText(label) }}</span>\n </div>\n }\n </div>\n</ng-template>\n\n<mt-card-content\n [inGroup]=\"inGroup()\"\n [showHeader]=\"!hideHeader()\"\n [title]=\"title()\"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n (headerClick)=\"onHeaderClick()\"\n>\n <ng-container body>\n <div\n class=\"table-wrapper h-full\"\n [attr.data-legend-position]=\"legendPosition()\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n >\n @if (hasLegend()) {\n <div class=\"table-legend-host\">\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n </div>\n }\n\n <div class=\"table-content\">\n @if (loading()) {\n <div class=\"flex items-center justify-center h-32\">\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\n </div>\n } @else if (hasData()) {\n <!-- One cell template per visible column: phase-gate cells and entity values. -->\n @for (column of visibleColumns(); track column.key) {\n <ng-template #gridCell let-row>\n @if (isPhaseGateColumn(column)) {\n @let phaseCell = getPhaseGateCell(row.__row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"getPhaseGateCellColor(phaseCell)\"\n ></span>\n <span class=\"font-medium truncate\">{{\n getPhaseGateCellText(phaseCell)\n }}</span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"getPhaseGatePercentage(phaseCell)\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(row.__row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </ng-template>\n }\n <div class=\"flex h-full min-h-0 flex-col gap-2\">\n <div\n #gridHost\n class=\"min-h-0 flex-1\"\n (dblclick)=\"onGridDoubleClick($event)\"\n >\n <mt-standard-grid\n [rows]=\"gridRows()\"\n [columns]=\"gridColumns()\"\n [rowId]=\"gridRowId\"\n [label]=\"title()\"\n [height]=\"gridHeight()\"\n [exportName]=\"title()\"\n (gridReady)=\"gridApi.set($event.api)\"\n (rowClicked)=\"onRowClick($event.__row)\"\n />\n </div>\n @if (aggregateSummary(tableAggregates()); as totals) {\n <div\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-sm font-semibold whitespace-pre-wrap\"\n >\n {{ totals }}\n </div>\n }\n </div>\n } @else {\n <!-- No Data -->\n <div\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\n >\n <i class=\"pi pi-info-circle text-2xl\"></i>\n <span>{{ t(\"noData\") }}</span>\n </div>\n }\n </div>\n </div>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.table-wrapper{display:grid;grid-template-areas:\"legend\" \"content\";grid-template-rows:auto minmax(0,1fr);min-height:0}.table-wrapper[data-legend-position=bottom]{grid-template-areas:\"content\" \"legend\";grid-template-rows:minmax(0,1fr) auto}.table-wrapper[data-legend-position=left]{grid-template-areas:\"legend content\";grid-template-columns:auto minmax(0,1fr);grid-template-rows:minmax(0,1fr)}.table-wrapper[data-legend-position=right]{grid-template-areas:\"content legend\";grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr)}.table-content{grid-area:content;min-height:0;min-width:0;display:flex;flex-direction:column}.table-legend-host{grid-area:legend;min-width:0;padding:.25rem .5rem}.table-wrapper[data-legend-position=left] .table-legend-host,.table-wrapper[data-legend-position=right] .table-legend-host{max-width:12rem;overflow:auto}.table-legend-marker{display:inline-block;width:.625rem;height:.625rem;flex:0 0 auto;border-radius:999px}.table-legend-marker.shape-rect{border-radius:0}.table-legend-marker.shape-roundRect{border-radius:.2rem}.table-legend-marker.shape-diamond{border-radius:.0625rem;transform:rotate(45deg)}.table-legend-marker.shape-triangle{width:0;height:0;background:transparent!important;border-radius:0;border-left:.34rem solid transparent;border-right:.34rem solid transparent;border-bottom-width:.6rem;border-bottom-style:solid}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }, { kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "selection", "exportable", "exportName", "exportFormats", "exporter", "rowMenuItems", "server", "paged", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32571
|
-
}
|
|
32572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, decorators: [{
|
|
32573
|
-
type: Component,
|
|
32574
|
-
args: [{ selector: 'mt-table-card', standalone: true, imports: [
|
|
32575
|
-
CommonModule,
|
|
32576
|
-
TranslocoDirective,
|
|
32577
|
-
CardContentComponent,
|
|
32578
|
-
EntityInfoComponent,
|
|
32579
|
-
MtStandardGridComponent,
|
|
32580
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- One legend definition; the body grid places it on any configured edge. -->\n<ng-template #legendList>\n <div\n class=\"flex flex-wrap items-center gap-2\"\n [class.flex-col]=\"isSideLegend()\"\n [class.items-start]=\"isSideLegend()\"\n >\n @for (label of labels(); track label.key || $index) {\n <div class=\"flex items-center gap-1 text-xs\">\n <span\n class=\"table-legend-marker\"\n [class.shape-rect]=\"legendIconType() === 'rect'\"\n [class.shape-roundRect]=\"legendIconType() === 'roundRect'\"\n [class.shape-diamond]=\"legendIconType() === 'diamond'\"\n [class.shape-triangle]=\"legendIconType() === 'triangle'\"\n [style.backgroundColor]=\"\n legendIconType() === 'triangle' ? null : getLegendColor(label)\n \"\n [style.border-bottom-color]=\"\n legendIconType() === 'triangle' ? getLegendColor(label) : null\n \"\n ></span>\n <span>{{ getLegendText(label) }}</span>\n </div>\n }\n </div>\n</ng-template>\n\n<mt-card-content\n [inGroup]=\"inGroup()\"\n [showHeader]=\"!hideHeader()\"\n [title]=\"title()\"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n (headerClick)=\"onHeaderClick()\"\n>\n <ng-container body>\n <div\n class=\"table-wrapper h-full\"\n [attr.data-legend-position]=\"legendPosition()\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n >\n @if (hasLegend()) {\n <div class=\"table-legend-host\">\n <ng-container [ngTemplateOutlet]=\"legendList\" />\n </div>\n }\n\n <div class=\"table-content\">\n @if (loading()) {\n <div class=\"flex items-center justify-center h-32\">\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\n </div>\n } @else if (hasData()) {\n <!-- One cell template per visible column: phase-gate cells and entity values. -->\n @for (column of visibleColumns(); track column.key) {\n <ng-template #gridCell let-row>\n @if (isPhaseGateColumn(column)) {\n @let phaseCell = getPhaseGateCell(row.__row, column);\n <div\n class=\"min-w-36\"\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\n >\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\n [style.backgroundColor]=\"getPhaseGateCellColor(phaseCell)\"\n ></span>\n <span class=\"font-medium truncate\">{{\n getPhaseGateCellText(phaseCell)\n }}</span>\n </div>\n @if (getPhaseGatePercentage(phaseCell) !== null) {\n <div\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\n >\n <div\n class=\"h-full rounded-full\"\n [style.width.%]=\"getPhaseGatePercentage(phaseCell)\"\n [style.backgroundColor]=\"\n getPhaseGateCellColor(phaseCell)\n \"\n ></div>\n </div>\n }\n </div>\n } @else {\n <mt-entity-info\n [data]=\"getCellData(row.__row, column)\"\n [displayType]=\"'inTable'\"\n [extraInfoData]=\"tableStyleConfig()\"\n ></mt-entity-info>\n }\n </ng-template>\n }\n <div class=\"flex h-full min-h-0 flex-col gap-2\">\n <div\n #gridHost\n class=\"min-h-0 flex-1\"\n (dblclick)=\"onGridDoubleClick($event)\"\n >\n <mt-standard-grid\n [rows]=\"gridRows()\"\n [columns]=\"gridColumns()\"\n [rowId]=\"gridRowId\"\n [label]=\"title()\"\n [height]=\"gridHeight()\"\n [exportName]=\"title()\"\n (gridReady)=\"gridApi.set($event.api)\"\n (rowClicked)=\"onRowClick($event.__row)\"\n />\n </div>\n @if (aggregateSummary(tableAggregates()); as totals) {\n <div\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2 text-sm font-semibold whitespace-pre-wrap\"\n >\n {{ totals }}\n </div>\n }\n </div>\n } @else {\n <!-- No Data -->\n <div\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\n >\n <i class=\"pi pi-info-circle text-2xl\"></i>\n <span>{{ t(\"noData\") }}</span>\n </div>\n }\n </div>\n </div>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.table-wrapper{display:grid;grid-template-areas:\"legend\" \"content\";grid-template-rows:auto minmax(0,1fr);min-height:0}.table-wrapper[data-legend-position=bottom]{grid-template-areas:\"content\" \"legend\";grid-template-rows:minmax(0,1fr) auto}.table-wrapper[data-legend-position=left]{grid-template-areas:\"legend content\";grid-template-columns:auto minmax(0,1fr);grid-template-rows:minmax(0,1fr)}.table-wrapper[data-legend-position=right]{grid-template-areas:\"content legend\";grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr)}.table-content{grid-area:content;min-height:0;min-width:0;display:flex;flex-direction:column}.table-legend-host{grid-area:legend;min-width:0;padding:.25rem .5rem}.table-wrapper[data-legend-position=left] .table-legend-host,.table-wrapper[data-legend-position=right] .table-legend-host{max-width:12rem;overflow:auto}.table-legend-marker{display:inline-block;width:.625rem;height:.625rem;flex:0 0 auto;border-radius:999px}.table-legend-marker.shape-rect{border-radius:0}.table-legend-marker.shape-roundRect{border-radius:.2rem}.table-legend-marker.shape-diamond{border-radius:.0625rem;transform:rotate(45deg)}.table-legend-marker.shape-triangle{width:0;height:0;background:transparent!important;border-radius:0;border-left:.34rem solid transparent;border-right:.34rem solid transparent;border-bottom-width:.6rem;border-bottom-style:solid}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"] }]
|
|
32581
|
-
}], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }], gridCells: [{ type: i0.ViewChildren, args: ['gridCell', { isSignal: true }] }], gridHost: [{ type: i0.ViewChild, args: ['gridHost', { isSignal: true }] }] } });
|
|
32582
|
-
|
|
32583
30860
|
/**
|
|
32584
30861
|
* Statistic Card Component
|
|
32585
30862
|
*
|
|
@@ -35515,26 +33792,26 @@ class DashboardItem {
|
|
|
35515
33792
|
return merged;
|
|
35516
33793
|
}
|
|
35517
33794
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35518
|
-
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 -->\r\n @case (\"table\") {\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 }\r\n\r\n <!-- Phase Gate Table -->\r\n @case (\"phaseGateTable\") {\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 }\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 <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 }\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: TableCardComponent, selector: "mt-table-card", inputs: ["dashboardId", "inGroup", "hideHeader"], outputs: ["onAction"] }, { 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 });
|
|
33795
|
+
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-kHPxfvAb.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs').then(m => m.TableCardComponent)]] });
|
|
35519
33796
|
}
|
|
35520
|
-
i0.ɵɵ
|
|
35521
|
-
|
|
35522
|
-
|
|
35523
|
-
|
|
35524
|
-
|
|
35525
|
-
|
|
35526
|
-
|
|
35527
|
-
|
|
35528
|
-
|
|
35529
|
-
|
|
35530
|
-
|
|
35531
|
-
|
|
35532
|
-
|
|
35533
|
-
|
|
35534
|
-
|
|
35535
|
-
|
|
35536
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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 -->\r\n @case (\"table\") {\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 }\r\n\r\n <!-- Phase Gate Table -->\r\n @case (\"phaseGateTable\") {\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 }\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 <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 }\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"] }]
|
|
35537
|
-
|
|
33797
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, resolveDeferredDeps: () => [import('./masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs').then(m => m.TableCardComponent)], resolveMetadata: TableCardComponent => ({ decorators: [{
|
|
33798
|
+
type: Component,
|
|
33799
|
+
args: [{ selector: 'mt-dashboard-item', standalone: true, imports: [
|
|
33800
|
+
CommonModule,
|
|
33801
|
+
TranslocoDirective,
|
|
33802
|
+
Button,
|
|
33803
|
+
Icon,
|
|
33804
|
+
ChartCardComponent,
|
|
33805
|
+
TableCardComponent,
|
|
33806
|
+
ListStatisticCardComponent,
|
|
33807
|
+
HeaderCardComponent,
|
|
33808
|
+
TopbarCardComponent,
|
|
33809
|
+
SkeletonCardComponent,
|
|
33810
|
+
PropertiesCardComponent,
|
|
33811
|
+
EntityPreviewCardComponent,
|
|
33812
|
+
LastHistoryLevelCardComponent,
|
|
33813
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
33814
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartTypeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartTypeId", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], useCachedDataOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "useCachedDataOnly", required: false }] }], pageName: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageName", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], isDialog: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDialog", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], extraFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraFilters", required: false }] }], reportId: [{ type: i0.Input, args: [{ isSignal: true, alias: "reportId", required: false }] }], ignoreQueryFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "ignoreQueryFilter", required: false }] }], builderMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "builderMode", required: false }] }], actionTriggered: [{ type: i0.Output, args: ["actionTriggered"] }], configureRequested: [{ type: i0.Output, args: ["configureRequested"] }], titleEdited: [{ type: i0.Output, args: ["titleEdited"] }] } }) });
|
|
35538
33815
|
|
|
35539
33816
|
/**
|
|
35540
33817
|
* Chart Viewer Component
|
|
@@ -47700,6 +45977,339 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
47700
45977
|
* preserved.
|
|
47701
45978
|
*/
|
|
47702
45979
|
|
|
45980
|
+
/**
|
|
45981
|
+
* Entity Info Component
|
|
45982
|
+
*
|
|
45983
|
+
* Renders property values based on their viewType.
|
|
45984
|
+
* Matches old app-entity-info behavior with viewType-based rendering.
|
|
45985
|
+
*
|
|
45986
|
+
* Supported viewTypes:
|
|
45987
|
+
* - text, float, title, phasegate → text display
|
|
45988
|
+
* - longtext → rich-text HTML display
|
|
45989
|
+
* - number → formatted number
|
|
45990
|
+
* - date, datetime → date display
|
|
45991
|
+
* - currency → currency display
|
|
45992
|
+
* - time → time display
|
|
45993
|
+
* - lookup, lookupmatrix → lookup display with color indicator
|
|
45994
|
+
* - checkbox → checkbox display
|
|
45995
|
+
* - status, request_status → status display with color
|
|
45996
|
+
* - percentage → percentage with progress bar
|
|
45997
|
+
* - slider → slider/progress display
|
|
45998
|
+
* - user → user avatar display
|
|
45999
|
+
* - lookupmultiselect → multi-select tags
|
|
46000
|
+
* - multiuser → multiple user avatars
|
|
46001
|
+
* - dynamiclist → list of properties
|
|
46002
|
+
* - api → API fetched value
|
|
46003
|
+
* - integrated → integrated value display
|
|
46004
|
+
*/
|
|
46005
|
+
function resolveEntityUserPhoto(value) {
|
|
46006
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
46007
|
+
return '';
|
|
46008
|
+
const user = value;
|
|
46009
|
+
for (const key of ['photoUrl', 'image', 'avatar']) {
|
|
46010
|
+
const candidate = user[key];
|
|
46011
|
+
if (typeof candidate === 'string' && candidate.trim()) {
|
|
46012
|
+
return candidate.trim();
|
|
46013
|
+
}
|
|
46014
|
+
}
|
|
46015
|
+
return '';
|
|
46016
|
+
}
|
|
46017
|
+
/**
|
|
46018
|
+
* The dashboard backend sends a Checkbox value as text (`"True"` / `"False"`),
|
|
46019
|
+
* so `Boolean(value)` read every non-empty string, `"False"` included, as
|
|
46020
|
+
* checked. Parsed the same way as the table card's `toBooleanValue`.
|
|
46021
|
+
*/
|
|
46022
|
+
function resolveEntityCheckbox(value) {
|
|
46023
|
+
if (typeof value === 'boolean')
|
|
46024
|
+
return value;
|
|
46025
|
+
if (typeof value === 'number')
|
|
46026
|
+
return value === 1;
|
|
46027
|
+
if (typeof value === 'string') {
|
|
46028
|
+
const text = value.trim().toLowerCase();
|
|
46029
|
+
return text === 'true' || text === '1' || text === 'yes';
|
|
46030
|
+
}
|
|
46031
|
+
if (value && typeof value === 'object' && 'value' in value) {
|
|
46032
|
+
return resolveEntityCheckbox(value.value);
|
|
46033
|
+
}
|
|
46034
|
+
return false;
|
|
46035
|
+
}
|
|
46036
|
+
class EntityInfoComponent {
|
|
46037
|
+
transloco = inject(TranslocoService);
|
|
46038
|
+
httpContext = new HttpContext().set(REQUEST_CONTEXT, {
|
|
46039
|
+
useBaseUrl: true,
|
|
46040
|
+
});
|
|
46041
|
+
/** Entity data to display */
|
|
46042
|
+
data = input(null, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
46043
|
+
/** Display type: 'entity' shows label, 'inTable' shows value only */
|
|
46044
|
+
displayType = input('entity', ...(ngDevMode ? [{ debugName: "displayType" }] : /* istanbul ignore next */ []));
|
|
46045
|
+
/** Extra configuration */
|
|
46046
|
+
extraInfoData = input({}, ...(ngDevMode ? [{ debugName: "extraInfoData" }] : /* istanbul ignore next */ []));
|
|
46047
|
+
/** Whether to limit words with ellipsis */
|
|
46048
|
+
limitWords = input(false, ...(ngDevMode ? [{ debugName: "limitWords" }] : /* istanbul ignore next */ []));
|
|
46049
|
+
/** Custom CSS class */
|
|
46050
|
+
customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : /* istanbul ignore next */ []));
|
|
46051
|
+
/** Computed viewType in lowercase */
|
|
46052
|
+
viewTypeLower = computed(() => {
|
|
46053
|
+
return this.data()?.viewType?.toLowerCase() || 'text';
|
|
46054
|
+
}, ...(ngDevMode ? [{ debugName: "viewTypeLower" }] : /* istanbul ignore next */ []));
|
|
46055
|
+
// === Text values ===
|
|
46056
|
+
textValue = computed(() => {
|
|
46057
|
+
const value = this.data()?.value;
|
|
46058
|
+
if (value === null || value === undefined)
|
|
46059
|
+
return '';
|
|
46060
|
+
if (typeof value === 'object') {
|
|
46061
|
+
return value.displayName || value.display || value.name || String(value);
|
|
46062
|
+
}
|
|
46063
|
+
return String(value);
|
|
46064
|
+
}, ...(ngDevMode ? [{ debugName: "textValue" }] : /* istanbul ignore next */ []));
|
|
46065
|
+
// === Long text values ===
|
|
46066
|
+
/**
|
|
46067
|
+
* A `LongText` property stores rich-text HTML authored in the editor, so the
|
|
46068
|
+
* cell has to render it as markup — interpolating it printed the raw
|
|
46069
|
+
* `<p>…</p>` source into the table. Angular sanitizes `[innerHTML]`, and this
|
|
46070
|
+
* matches `mt-entity-long-text`, which is what the level-workspace table
|
|
46071
|
+
* renders the same property with.
|
|
46072
|
+
*/
|
|
46073
|
+
longTextHtml = computed(() => this.textValue(), ...(ngDevMode ? [{ debugName: "longTextHtml" }] : /* istanbul ignore next */ []));
|
|
46074
|
+
/** Tag-stripped text for the `title` tooltip — an attribute can't hold markup. */
|
|
46075
|
+
longTextTooltip = computed(() => {
|
|
46076
|
+
const text = TableValueResolver.stripHtml(this.longTextHtml());
|
|
46077
|
+
return typeof text === 'string' ? text : '';
|
|
46078
|
+
}, ...(ngDevMode ? [{ debugName: "longTextTooltip" }] : /* istanbul ignore next */ []));
|
|
46079
|
+
// === Number values ===
|
|
46080
|
+
numericValue = computed(() => {
|
|
46081
|
+
const value = this.data()?.value;
|
|
46082
|
+
if (value === null || value === undefined)
|
|
46083
|
+
return null;
|
|
46084
|
+
const num = parseFloat(value);
|
|
46085
|
+
return isNaN(num) ? null : num;
|
|
46086
|
+
}, ...(ngDevMode ? [{ debugName: "numericValue" }] : /* istanbul ignore next */ []));
|
|
46087
|
+
// === Date values ===
|
|
46088
|
+
dateDisplayValue = computed(() => {
|
|
46089
|
+
const value = this.data()?.value;
|
|
46090
|
+
if (!value)
|
|
46091
|
+
return '';
|
|
46092
|
+
if (typeof value === 'object') {
|
|
46093
|
+
return value.displayValue || value.display || '';
|
|
46094
|
+
}
|
|
46095
|
+
// Try to format as date
|
|
46096
|
+
try {
|
|
46097
|
+
const date = new Date(value);
|
|
46098
|
+
if (!isNaN(date.getTime())) {
|
|
46099
|
+
return date.toLocaleDateString();
|
|
46100
|
+
}
|
|
46101
|
+
}
|
|
46102
|
+
catch {
|
|
46103
|
+
// ignore
|
|
46104
|
+
}
|
|
46105
|
+
return String(value);
|
|
46106
|
+
}, ...(ngDevMode ? [{ debugName: "dateDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46107
|
+
// === Currency values ===
|
|
46108
|
+
currencyDisplayValue = computed(() => {
|
|
46109
|
+
const value = this.data()?.value;
|
|
46110
|
+
if (!value)
|
|
46111
|
+
return '';
|
|
46112
|
+
if (typeof value === 'object') {
|
|
46113
|
+
return value.display || this.formatCurrency(value.value);
|
|
46114
|
+
}
|
|
46115
|
+
return this.formatCurrency(value);
|
|
46116
|
+
}, ...(ngDevMode ? [{ debugName: "currencyDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46117
|
+
// === Time values ===
|
|
46118
|
+
timeDisplayValue = computed(() => {
|
|
46119
|
+
const value = this.data()?.value;
|
|
46120
|
+
if (!value)
|
|
46121
|
+
return '';
|
|
46122
|
+
if (typeof value === 'object') {
|
|
46123
|
+
return value.displayValue || value.display || '';
|
|
46124
|
+
}
|
|
46125
|
+
return String(value);
|
|
46126
|
+
}, ...(ngDevMode ? [{ debugName: "timeDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46127
|
+
// === Lookup values ===
|
|
46128
|
+
lookupName = computed(() => {
|
|
46129
|
+
const value = this.data()?.value;
|
|
46130
|
+
if (!value)
|
|
46131
|
+
return '';
|
|
46132
|
+
if (typeof value === 'object') {
|
|
46133
|
+
return value.name || value.display?.name || value.display || '';
|
|
46134
|
+
}
|
|
46135
|
+
return String(value);
|
|
46136
|
+
}, ...(ngDevMode ? [{ debugName: "lookupName" }] : /* istanbul ignore next */ []));
|
|
46137
|
+
lookupColor = computed(() => {
|
|
46138
|
+
const value = this.data()?.value;
|
|
46139
|
+
if (!value || typeof value !== 'object')
|
|
46140
|
+
return '';
|
|
46141
|
+
return value.details?.color || value.color || '';
|
|
46142
|
+
}, ...(ngDevMode ? [{ debugName: "lookupColor" }] : /* istanbul ignore next */ []));
|
|
46143
|
+
// === Checkbox values ===
|
|
46144
|
+
checkboxValue = computed(() => resolveEntityCheckbox(this.data()?.value), ...(ngDevMode ? [{ debugName: "checkboxValue" }] : /* istanbul ignore next */ []));
|
|
46145
|
+
checkboxLabel = computed(() => this.transloco.translate(this.checkboxValue() ? 'dashboardBuilder.yes' : 'dashboardBuilder.no'), ...(ngDevMode ? [{ debugName: "checkboxLabel" }] : /* istanbul ignore next */ []));
|
|
46146
|
+
// === Status values ===
|
|
46147
|
+
statusName = computed(() => {
|
|
46148
|
+
const value = this.data()?.value;
|
|
46149
|
+
if (!value)
|
|
46150
|
+
return '';
|
|
46151
|
+
if (typeof value === 'object') {
|
|
46152
|
+
const languageCode = document.dir === 'rtl' ? 'ar' : 'en';
|
|
46153
|
+
const display = typeof value.display === 'object'
|
|
46154
|
+
? value.display?.[languageCode] ||
|
|
46155
|
+
value.display?.en ||
|
|
46156
|
+
value.display?.ar ||
|
|
46157
|
+
value.display?.name ||
|
|
46158
|
+
value.display?.displayName ||
|
|
46159
|
+
value.display?.label
|
|
46160
|
+
: value.display;
|
|
46161
|
+
return (value.displayName ||
|
|
46162
|
+
value.name ||
|
|
46163
|
+
display ||
|
|
46164
|
+
value[languageCode] ||
|
|
46165
|
+
value.en ||
|
|
46166
|
+
value.ar ||
|
|
46167
|
+
value.label ||
|
|
46168
|
+
value.key ||
|
|
46169
|
+
'');
|
|
46170
|
+
}
|
|
46171
|
+
return String(value);
|
|
46172
|
+
}, ...(ngDevMode ? [{ debugName: "statusName" }] : /* istanbul ignore next */ []));
|
|
46173
|
+
statusColor = computed(() => {
|
|
46174
|
+
const value = this.data()?.value;
|
|
46175
|
+
if (!value || typeof value !== 'object')
|
|
46176
|
+
return '';
|
|
46177
|
+
return value.details?.color || value.color || '';
|
|
46178
|
+
}, ...(ngDevMode ? [{ debugName: "statusColor" }] : /* istanbul ignore next */ []));
|
|
46179
|
+
// === Percentage values ===
|
|
46180
|
+
percentageValue = computed(() => {
|
|
46181
|
+
let value = this.data()?.value;
|
|
46182
|
+
if (value === null || value === undefined)
|
|
46183
|
+
return null;
|
|
46184
|
+
// Unwrap nested { value: { value: N } } / { value: "49%" } shapes (up to a
|
|
46185
|
+
// couple of levels) so the progress-bar fill width parses correctly.
|
|
46186
|
+
for (let i = 0; i < 3 && value && typeof value === 'object'; i++) {
|
|
46187
|
+
value =
|
|
46188
|
+
value.value ??
|
|
46189
|
+
value.actualValue ??
|
|
46190
|
+
value.displayValue ??
|
|
46191
|
+
value.display ??
|
|
46192
|
+
null;
|
|
46193
|
+
}
|
|
46194
|
+
if (value === null || value === undefined)
|
|
46195
|
+
return null;
|
|
46196
|
+
const num = parseFloat(String(value).replace('%', '').trim());
|
|
46197
|
+
return Number.isNaN(num) ? 0 : num;
|
|
46198
|
+
}, ...(ngDevMode ? [{ debugName: "percentageValue" }] : /* istanbul ignore next */ []));
|
|
46199
|
+
percentageColor = computed(() => {
|
|
46200
|
+
// "% status color": the table injects the row's status colour as
|
|
46201
|
+
// data().statusColor and sets extraInfoData.showPercentageStatus — prefer
|
|
46202
|
+
// it so the progress bar / dot reflects the row's status (Delayed -> red…).
|
|
46203
|
+
const statusColor = this.data()?.statusColor;
|
|
46204
|
+
if (this.extraInfoData()?.showPercentageStatus && statusColor) {
|
|
46205
|
+
return statusColor;
|
|
46206
|
+
}
|
|
46207
|
+
// Otherwise use any colour carried on the value (incl. one level of nesting).
|
|
46208
|
+
const value = this.data()?.value;
|
|
46209
|
+
if (!value || typeof value !== 'object')
|
|
46210
|
+
return '';
|
|
46211
|
+
return value.color || value.details?.color || value.value?.color || '';
|
|
46212
|
+
}, ...(ngDevMode ? [{ debugName: "percentageColor" }] : /* istanbul ignore next */ []));
|
|
46213
|
+
// === Slider values ===
|
|
46214
|
+
sliderValue = computed(() => {
|
|
46215
|
+
const value = this.data()?.value;
|
|
46216
|
+
if (!value)
|
|
46217
|
+
return 0;
|
|
46218
|
+
if (typeof value === 'object') {
|
|
46219
|
+
return parseFloat(value.value) || 0;
|
|
46220
|
+
}
|
|
46221
|
+
return parseFloat(value) || 0;
|
|
46222
|
+
}, ...(ngDevMode ? [{ debugName: "sliderValue" }] : /* istanbul ignore next */ []));
|
|
46223
|
+
// === User values ===
|
|
46224
|
+
userData = computed(() => {
|
|
46225
|
+
const value = this.data()?.value;
|
|
46226
|
+
if (!value || typeof value !== 'object')
|
|
46227
|
+
return null;
|
|
46228
|
+
return value;
|
|
46229
|
+
}, ...(ngDevMode ? [{ debugName: "userData" }] : /* istanbul ignore next */ []));
|
|
46230
|
+
userName = computed(() => {
|
|
46231
|
+
const user = this.userData();
|
|
46232
|
+
if (!user)
|
|
46233
|
+
return '';
|
|
46234
|
+
return user.displayName || user.name || user.fullName || '';
|
|
46235
|
+
}, ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
|
|
46236
|
+
userPhoto = computed(() => resolveEntityUserPhoto(this.userData()), ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
|
|
46237
|
+
userInitials = computed(() => {
|
|
46238
|
+
const name = this.userName();
|
|
46239
|
+
return this.getInitials(name);
|
|
46240
|
+
}, ...(ngDevMode ? [{ debugName: "userInitials" }] : /* istanbul ignore next */ []));
|
|
46241
|
+
// === Multiselect values ===
|
|
46242
|
+
multiselectValues = computed(() => {
|
|
46243
|
+
const value = this.data()?.value;
|
|
46244
|
+
if (!value)
|
|
46245
|
+
return [];
|
|
46246
|
+
return Array.isArray(value) ? value : [];
|
|
46247
|
+
}, ...(ngDevMode ? [{ debugName: "multiselectValues" }] : /* istanbul ignore next */ []));
|
|
46248
|
+
// === Multi user values ===
|
|
46249
|
+
multiUserValues = computed(() => {
|
|
46250
|
+
const value = this.data()?.value;
|
|
46251
|
+
if (!value)
|
|
46252
|
+
return [];
|
|
46253
|
+
return Array.isArray(value) ? value : [];
|
|
46254
|
+
}, ...(ngDevMode ? [{ debugName: "multiUserValues" }] : /* istanbul ignore next */ []));
|
|
46255
|
+
getUserPhoto(user) {
|
|
46256
|
+
return resolveEntityUserPhoto(user);
|
|
46257
|
+
}
|
|
46258
|
+
// === Dynamic list values ===
|
|
46259
|
+
dynamicListValues = computed(() => {
|
|
46260
|
+
const value = this.data()?.value;
|
|
46261
|
+
if (!value)
|
|
46262
|
+
return [];
|
|
46263
|
+
return Array.isArray(value) ? value : [];
|
|
46264
|
+
}, ...(ngDevMode ? [{ debugName: "dynamicListValues" }] : /* istanbul ignore next */ []));
|
|
46265
|
+
// === Location values ===
|
|
46266
|
+
locationDisplayValue = computed(() => {
|
|
46267
|
+
const value = this.data()?.value;
|
|
46268
|
+
if (!value)
|
|
46269
|
+
return '';
|
|
46270
|
+
if (typeof value === 'object') {
|
|
46271
|
+
return value.display_name || value.displayName || value.name || '';
|
|
46272
|
+
}
|
|
46273
|
+
return String(value);
|
|
46274
|
+
}, ...(ngDevMode ? [{ debugName: "locationDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46275
|
+
/** Get initials from name */
|
|
46276
|
+
getInitials(name) {
|
|
46277
|
+
if (!name)
|
|
46278
|
+
return '?';
|
|
46279
|
+
const parts = name.split(' ').filter(Boolean);
|
|
46280
|
+
if (parts.length === 1) {
|
|
46281
|
+
return parts[0].charAt(0).toUpperCase();
|
|
46282
|
+
}
|
|
46283
|
+
return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
|
|
46284
|
+
}
|
|
46285
|
+
/** Format currency value */
|
|
46286
|
+
formatCurrency(value) {
|
|
46287
|
+
if (value === null || value === undefined || value === '')
|
|
46288
|
+
return '';
|
|
46289
|
+
const num = parseFloat(value);
|
|
46290
|
+
if (isNaN(num))
|
|
46291
|
+
return String(value);
|
|
46292
|
+
return num.toLocaleString(undefined, {
|
|
46293
|
+
minimumFractionDigits: 2,
|
|
46294
|
+
maximumFractionDigits: 2,
|
|
46295
|
+
});
|
|
46296
|
+
}
|
|
46297
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46298
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityInfoComponent, isStandalone: true, selector: "mt-entity-info", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, displayType: { classPropertyName: "displayType", publicName: "displayType", isSignal: true, isRequired: false, transformFunction: null }, extraInfoData: { classPropertyName: "extraInfoData", publicName: "extraInfoData", isSignal: true, isRequired: false, transformFunction: null }, limitWords: { classPropertyName: "limitWords", publicName: "limitWords", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"entity-info-wrapper w-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @switch (viewTypeLower()) {\r\n <!-- Text Types -->\r\n @case (\"text\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"float\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"longtext\") {\r\n <ng-container *ngTemplateOutlet=\"longTextTemplate\"></ng-container>\r\n }\r\n @case (\"title\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"phasegate\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Number -->\r\n @case (\"number\") {\r\n <ng-container *ngTemplateOutlet=\"numberTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Date Types -->\r\n @case (\"date\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n @case (\"datetime\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Currency -->\r\n @case (\"currency\") {\r\n <ng-container *ngTemplateOutlet=\"currencyTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Time -->\r\n @case (\"time\") {\r\n <ng-container *ngTemplateOutlet=\"timeTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup -->\r\n @case (\"lookup\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup Matrix (same value shape as lookup: key/display/color) -->\r\n @case (\"lookupmatrix\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @case (\"checkbox\") {\r\n <ng-container *ngTemplateOutlet=\"checkboxTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Status -->\r\n @case (\"status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n @case (\"request_status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Percentage -->\r\n @case (\"percentage\") {\r\n <ng-container *ngTemplateOutlet=\"percentageTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Slider -->\r\n @case (\"slider\") {\r\n <ng-container *ngTemplateOutlet=\"sliderTemplate\"></ng-container>\r\n }\r\n\r\n <!-- User -->\r\n @case (\"user\") {\r\n <ng-container *ngTemplateOutlet=\"userTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Multi-select lookup -->\r\n @case (\"lookupmultiselect\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"lookupMultiselectTemplate\"\r\n ></ng-container>\r\n }\r\n\r\n <!-- Multi user -->\r\n @case (\"multiuser\") {\r\n <ng-container *ngTemplateOutlet=\"multiUserTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Dynamic List -->\r\n @case (\"dynamiclist\") {\r\n <ng-container *ngTemplateOutlet=\"dynamicListTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Location -->\r\n @case (\"location\") {\r\n <ng-container *ngTemplateOutlet=\"locationTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Default: treat as text -->\r\n @default {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- Text Template -->\r\n<ng-template #textTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div\r\n class=\"font-semibold\"\r\n [class.text-ellipsis]=\"limitWords()\"\r\n [class.overflow-hidden]=\"limitWords()\"\r\n [class.whitespace-nowrap]=\"limitWords()\"\r\n [style.max-width]=\"limitWords() ? '200px' : 'auto'\"\r\n [title]=\"textValue()\"\r\n >\r\n {{ textValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Long Text Template: the value is rich-text HTML, so render it as markup\r\n (Angular sanitizes [innerHTML]) instead of printing the tags. -->\r\n<ng-template #longTextTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (longTextTooltip()) {\r\n <div\r\n class=\"entity-long-text font-semibold break-words\"\r\n [class.entity-long-text-clamped]=\"displayType() === 'inTable'\"\r\n [title]=\"longTextTooltip()\"\r\n [innerHTML]=\"longTextHtml()\"\r\n ></div>\r\n } @else {\r\n <div class=\"font-semibold\">__</div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Number Template -->\r\n<ng-template #numberTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ numericValue() !== null ? (numericValue() | number) : \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Date Template -->\r\n<ng-template #dateTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ dateDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Currency Template -->\r\n<ng-template #currencyTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ currencyDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Time Template -->\r\n<ng-template #timeTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ timeDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Lookup Template -->\r\n<ng-template #lookupTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (lookupName()) {\r\n <span class=\"flex items-center gap-1\" [style.color]=\"lookupColor()\">\r\n @if (displayType() === \"entity\" && lookupColor()) {\r\n <span\r\n class=\"w-2 h-2 rounded-full inline-block\"\r\n [style.backgroundColor]=\"lookupColor()\"\r\n ></span>\r\n }\r\n {{ lookupName() }}\r\n </span>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Checkbox Template -->\r\n<ng-template #checkboxTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center\">\r\n <i\r\n [class]=\"\r\n checkboxValue()\r\n ? 'pi pi-check-square text-primary'\r\n : 'pi pi-stop text-muted-color'\r\n \"\r\n ></i>\r\n <span class=\"ml-2\">{{ checkboxLabel() }}</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Status Template -->\r\n<ng-template #statusTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (statusColor()) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"statusColor()\"\r\n ></span>\r\n }\r\n <span [style.color]=\"statusColor()\">\r\n {{ statusName() || \"__\" }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Percentage Template -->\r\n<ng-template #percentageTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (\r\n displayType() !== \"inTable\" ||\r\n extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-24\"\r\n >\r\n <div\r\n class=\"h-full rounded-full transition-all\"\r\n [style.width.%]=\"percentageValue() || 0\"\r\n [style.backgroundColor]=\"percentageColor() || 'var(--primary-color)'\"\r\n ></div>\r\n </div>\r\n }\r\n @if (\r\n extraInfoData()?.showPercentageStatus &&\r\n !extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"percentageColor() || '#000'\"\r\n ></span>\r\n }\r\n <span [style.color]=\"percentageColor()\">\r\n {{\r\n percentageValue() !== null\r\n ? (percentageValue() | number: \"1.0-0\") + \"%\"\r\n : \"__\"\r\n }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Slider Template -->\r\n<ng-template #sliderTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-32\"\r\n >\r\n <div\r\n class=\"h-full bg-primary rounded-full transition-all\"\r\n [style.width.%]=\"sliderValue() || 0\"\r\n ></div>\r\n </div>\r\n <span class=\"text-sm\">{{ sliderValue() || 0 }}%</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- User Template -->\r\n<ng-template #userTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (userData()) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (userPhoto()) {\r\n <img\r\n [src]=\"userPhoto() | secureImage: true : httpContext : 'avatar/'\"\r\n alt=\"User avatar\"\r\n class=\"w-8 h-8 rounded-full object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center text-primary font-semibold text-sm\"\r\n >\r\n {{ userInitials() }}\r\n </div>\r\n }\r\n <span class=\"font-medium\">{{ userName() }}</span>\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Lookup Multiselect Template -->\r\n<ng-template #lookupMultiselectTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiselectValues()?.length) {\r\n <div class=\"flex flex-wrap gap-1\">\r\n @for (item of multiselectValues(); track item.key || $index) {\r\n <!-- A lookup value is { key, display, color } \u2014 `details.color` alone\r\n left every chip on the grey fallback. Same order as lookupColor(). -->\r\n <span\r\n class=\"px-2 py-0.5 rounded-full text-xs font-medium\"\r\n [style.backgroundColor]=\"\r\n (item.details?.color || item.color || '#6b7280') + '20'\r\n \"\r\n [style.color]=\"item.details?.color || item.color || '#6b7280'\"\r\n >\r\n {{ item.name || item.display || item.key || item }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Multi User Template -->\r\n<ng-template #multiUserTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiUserValues()?.length) {\r\n <div class=\"flex items-center -space-x-2\">\r\n @for (user of multiUserValues().slice(0, 5); track user.id || $index) {\r\n @if (getUserPhoto(user); as userPhoto) {\r\n <img\r\n [src]=\"userPhoto | secureImage: true : httpContext : 'avatar/'\"\r\n [alt]=\"user.name || user.displayName\"\r\n class=\"w-7 h-7 rounded-full border-2 border-white object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-primary/20 flex items-center justify-center text-primary font-semibold text-xs\"\r\n >\r\n {{ getInitials(user.name || user.displayName) }}\r\n </div>\r\n }\r\n }\r\n @if (multiUserValues().length > 5) {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-surface-300 flex items-center justify-center text-xs font-medium\"\r\n >\r\n +{{ multiUserValues().length - 5 }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Dynamic List Template -->\r\n<ng-template #dynamicListTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (dynamicListValues()?.length) {\r\n <div class=\"flex flex-col gap-1\">\r\n @for (item of dynamicListValues(); track $index) {\r\n <div class=\"text-sm\">\r\n {{ item?.label || item?.name || item }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Location Template -->\r\n<ng-template #locationTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ locationDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n", styles: [":host{display:block}.text-ellipsis{text-overflow:ellipsis}.entity-long-text ::ng-deep :is(p,ul,ol,h1,h2,h3,h4,h5,h6){margin:0}.entity-long-text-clamped{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6){display:inline}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6):after{content:\" \"}\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: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "pipe", type: SecureImagePipe, name: "secureImage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
46299
|
+
}
|
|
46300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, decorators: [{
|
|
46301
|
+
type: Component,
|
|
46302
|
+
args: [{ selector: 'mt-entity-info', standalone: true, imports: [CommonModule, TranslocoDirective, DecimalPipe, SecureImagePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"entity-info-wrapper w-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @switch (viewTypeLower()) {\r\n <!-- Text Types -->\r\n @case (\"text\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"float\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"longtext\") {\r\n <ng-container *ngTemplateOutlet=\"longTextTemplate\"></ng-container>\r\n }\r\n @case (\"title\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n @case (\"phasegate\") {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Number -->\r\n @case (\"number\") {\r\n <ng-container *ngTemplateOutlet=\"numberTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Date Types -->\r\n @case (\"date\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n @case (\"datetime\") {\r\n <ng-container *ngTemplateOutlet=\"dateTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Currency -->\r\n @case (\"currency\") {\r\n <ng-container *ngTemplateOutlet=\"currencyTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Time -->\r\n @case (\"time\") {\r\n <ng-container *ngTemplateOutlet=\"timeTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup -->\r\n @case (\"lookup\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Lookup Matrix (same value shape as lookup: key/display/color) -->\r\n @case (\"lookupmatrix\") {\r\n <ng-container *ngTemplateOutlet=\"lookupTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Checkbox -->\r\n @case (\"checkbox\") {\r\n <ng-container *ngTemplateOutlet=\"checkboxTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Status -->\r\n @case (\"status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n @case (\"request_status\") {\r\n <ng-container *ngTemplateOutlet=\"statusTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Percentage -->\r\n @case (\"percentage\") {\r\n <ng-container *ngTemplateOutlet=\"percentageTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Slider -->\r\n @case (\"slider\") {\r\n <ng-container *ngTemplateOutlet=\"sliderTemplate\"></ng-container>\r\n }\r\n\r\n <!-- User -->\r\n @case (\"user\") {\r\n <ng-container *ngTemplateOutlet=\"userTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Multi-select lookup -->\r\n @case (\"lookupmultiselect\") {\r\n <ng-container\r\n *ngTemplateOutlet=\"lookupMultiselectTemplate\"\r\n ></ng-container>\r\n }\r\n\r\n <!-- Multi user -->\r\n @case (\"multiuser\") {\r\n <ng-container *ngTemplateOutlet=\"multiUserTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Dynamic List -->\r\n @case (\"dynamiclist\") {\r\n <ng-container *ngTemplateOutlet=\"dynamicListTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Location -->\r\n @case (\"location\") {\r\n <ng-container *ngTemplateOutlet=\"locationTemplate\"></ng-container>\r\n }\r\n\r\n <!-- Default: treat as text -->\r\n @default {\r\n <ng-container *ngTemplateOutlet=\"textTemplate\"></ng-container>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- Text Template -->\r\n<ng-template #textTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div\r\n class=\"font-semibold\"\r\n [class.text-ellipsis]=\"limitWords()\"\r\n [class.overflow-hidden]=\"limitWords()\"\r\n [class.whitespace-nowrap]=\"limitWords()\"\r\n [style.max-width]=\"limitWords() ? '200px' : 'auto'\"\r\n [title]=\"textValue()\"\r\n >\r\n {{ textValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Long Text Template: the value is rich-text HTML, so render it as markup\r\n (Angular sanitizes [innerHTML]) instead of printing the tags. -->\r\n<ng-template #longTextTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (longTextTooltip()) {\r\n <div\r\n class=\"entity-long-text font-semibold break-words\"\r\n [class.entity-long-text-clamped]=\"displayType() === 'inTable'\"\r\n [title]=\"longTextTooltip()\"\r\n [innerHTML]=\"longTextHtml()\"\r\n ></div>\r\n } @else {\r\n <div class=\"font-semibold\">__</div>\r\n }\r\n</ng-template>\r\n\r\n<!-- Number Template -->\r\n<ng-template #numberTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ numericValue() !== null ? (numericValue() | number) : \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Date Template -->\r\n<ng-template #dateTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ dateDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Currency Template -->\r\n<ng-template #currencyTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ currencyDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Time Template -->\r\n<ng-template #timeTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ timeDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Lookup Template -->\r\n<ng-template #lookupTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (lookupName()) {\r\n <span class=\"flex items-center gap-1\" [style.color]=\"lookupColor()\">\r\n @if (displayType() === \"entity\" && lookupColor()) {\r\n <span\r\n class=\"w-2 h-2 rounded-full inline-block\"\r\n [style.backgroundColor]=\"lookupColor()\"\r\n ></span>\r\n }\r\n {{ lookupName() }}\r\n </span>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Checkbox Template -->\r\n<ng-template #checkboxTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center\">\r\n <i\r\n [class]=\"\r\n checkboxValue()\r\n ? 'pi pi-check-square text-primary'\r\n : 'pi pi-stop text-muted-color'\r\n \"\r\n ></i>\r\n <span class=\"ml-2\">{{ checkboxLabel() }}</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Status Template -->\r\n<ng-template #statusTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (statusColor()) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"statusColor()\"\r\n ></span>\r\n }\r\n <span [style.color]=\"statusColor()\">\r\n {{ statusName() || \"__\" }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Percentage Template -->\r\n<ng-template #percentageTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n @if (\r\n displayType() !== \"inTable\" ||\r\n extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-24\"\r\n >\r\n <div\r\n class=\"h-full rounded-full transition-all\"\r\n [style.width.%]=\"percentageValue() || 0\"\r\n [style.backgroundColor]=\"percentageColor() || 'var(--primary-color)'\"\r\n ></div>\r\n </div>\r\n }\r\n @if (\r\n extraInfoData()?.showPercentageStatus &&\r\n !extraInfoData()?.showPercentageAsProgressBar\r\n ) {\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"percentageColor() || '#000'\"\r\n ></span>\r\n }\r\n <span [style.color]=\"percentageColor()\">\r\n {{\r\n percentageValue() !== null\r\n ? (percentageValue() | number: \"1.0-0\") + \"%\"\r\n : \"__\"\r\n }}\r\n </span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Slider Template -->\r\n<ng-template #sliderTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"flex items-center gap-2\">\r\n <div\r\n class=\"flex-1 h-2 bg-surface-200 rounded-full overflow-hidden max-w-32\"\r\n >\r\n <div\r\n class=\"h-full bg-primary rounded-full transition-all\"\r\n [style.width.%]=\"sliderValue() || 0\"\r\n ></div>\r\n </div>\r\n <span class=\"text-sm\">{{ sliderValue() || 0 }}%</span>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- User Template -->\r\n<ng-template #userTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (userData()) {\r\n <div class=\"flex items-center gap-2\">\r\n @if (userPhoto()) {\r\n <img\r\n [src]=\"userPhoto() | secureImage: true : httpContext : 'avatar/'\"\r\n alt=\"User avatar\"\r\n class=\"w-8 h-8 rounded-full object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-8 h-8 rounded-full bg-primary/20 flex items-center justify-center text-primary font-semibold text-sm\"\r\n >\r\n {{ userInitials() }}\r\n </div>\r\n }\r\n <span class=\"font-medium\">{{ userName() }}</span>\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Lookup Multiselect Template -->\r\n<ng-template #lookupMultiselectTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiselectValues()?.length) {\r\n <div class=\"flex flex-wrap gap-1\">\r\n @for (item of multiselectValues(); track item.key || $index) {\r\n <!-- A lookup value is { key, display, color } \u2014 `details.color` alone\r\n left every chip on the grey fallback. Same order as lookupColor(). -->\r\n <span\r\n class=\"px-2 py-0.5 rounded-full text-xs font-medium\"\r\n [style.backgroundColor]=\"\r\n (item.details?.color || item.color || '#6b7280') + '20'\r\n \"\r\n [style.color]=\"item.details?.color || item.color || '#6b7280'\"\r\n >\r\n {{ item.name || item.display || item.key || item }}\r\n </span>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Multi User Template -->\r\n<ng-template #multiUserTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (multiUserValues()?.length) {\r\n <div class=\"flex items-center -space-x-2\">\r\n @for (user of multiUserValues().slice(0, 5); track user.id || $index) {\r\n @if (getUserPhoto(user); as userPhoto) {\r\n <img\r\n [src]=\"userPhoto | secureImage: true : httpContext : 'avatar/'\"\r\n [alt]=\"user.name || user.displayName\"\r\n class=\"w-7 h-7 rounded-full border-2 border-white object-cover\"\r\n />\r\n } @else {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-primary/20 flex items-center justify-center text-primary font-semibold text-xs\"\r\n >\r\n {{ getInitials(user.name || user.displayName) }}\r\n </div>\r\n }\r\n }\r\n @if (multiUserValues().length > 5) {\r\n <div\r\n class=\"w-7 h-7 rounded-full border-2 border-white bg-surface-300 flex items-center justify-center text-xs font-medium\"\r\n >\r\n +{{ multiUserValues().length - 5 }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Dynamic List Template -->\r\n<ng-template #dynamicListTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n @if (dynamicListValues()?.length) {\r\n <div class=\"flex flex-col gap-1\">\r\n @for (item of dynamicListValues(); track $index) {\r\n <div class=\"text-sm\">\r\n {{ item?.label || item?.name || item }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <span class=\"font-semibold\">__</span>\r\n }\r\n</ng-template>\r\n\r\n<!-- Location Template -->\r\n<ng-template #locationTemplate>\r\n @if (displayType() === \"entity\") {\r\n <div class=\"text-muted-color text-sm font-semibold mb-1\">\r\n {{ data()?.label }}\r\n </div>\r\n }\r\n <div class=\"font-semibold\">\r\n {{ locationDisplayValue() || \"__\" }}\r\n </div>\r\n</ng-template>\r\n", styles: [":host{display:block}.text-ellipsis{text-overflow:ellipsis}.entity-long-text ::ng-deep :is(p,ul,ol,h1,h2,h3,h4,h5,h6){margin:0}.entity-long-text-clamped{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6){display:inline}.entity-long-text-clamped ::ng-deep :is(p,div,li,h1,h2,h3,h4,h5,h6):after{content:\" \"}\n"] }]
|
|
46303
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], displayType: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayType", required: false }] }], extraInfoData: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraInfoData", required: false }] }], limitWords: [{ type: i0.Input, args: [{ isSignal: true, alias: "limitWords", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }] } });
|
|
46304
|
+
|
|
46305
|
+
/**
|
|
46306
|
+
* The table card renders the data grid, so the package's main entry never imports it
|
|
46307
|
+
* statically: `DashboardItem` defers it, and other callers load it with this function.
|
|
46308
|
+
* A static import here would put the whole grid in every host bundle that imports
|
|
46309
|
+
* `@masterteam/dashboard-builder`.
|
|
46310
|
+
*/
|
|
46311
|
+
const loadTableCard = () => import('./masterteam-dashboard-builder-table-card.component-kHPxfvAb.mjs').then((m) => m.TableCardComponent);
|
|
46312
|
+
|
|
47703
46313
|
/**
|
|
47704
46314
|
* Dashboard Item Components Index
|
|
47705
46315
|
*
|
|
@@ -54867,5 +53477,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
54867
53477
|
* Generated bundle index. Do not edit.
|
|
54868
53478
|
*/
|
|
54869
53479
|
|
|
54870
|
-
export {
|
|
54871
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
53480
|
+
export { DEFAULT_MAP_REGION_KEY 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_MARKER_PATH as V, MAP_FALLBACK_COLORS as W, isPlottable as X, plottableGroups as Y, buildMapChartOption as Z, MAP_REGIONS as _, fillColorForPercentageProperty as a, CHART_TYPES as a$, MAP_DATA_ATTRIBUTION as a0, resolveMapRegion as a1, MapViewComponent as a2, SkeletonCardComponent as a3, resolveStatisticIconPlacement as a4, StatisticCardComponent as a5, loadTableCard as a6, TopbarCardComponent as a7, ChartDataService as a8, observeNearViewport as a9, createTooltipFormatter as aA, formatAxisLabel as aB, formatWordsUnderBar as aC, formatXAxis as aD, handleFiltersForCustom as aE, handleFilterForCard as aF, handleFilterForSnapshot as aG, applyBuiltInConditions as aH, DashboardList as aI, MODULE_CLASSIFICATION_LOG as aJ, MODULE_CLASSIFICATION_LOG_NAME as aK, isLogClassification as aL, HTTPMethod as aM, DashboardBuilderService as aN, DashboardStoreService as aO, isManagePagesDeleteResult as aP, ManagePages as aQ, ManageBreadcrumb as aR, ManageFilterOnPage as aS, DynamicFiltersConfig as aT, ChartSettingsDrawer as aU, DisplaySettings as aV, DefaultControlUi as aW, PieControlUi as aX, BarControlUi as aY, StackBarControlUi as aZ, ManageItem as a_, loadImmediately as aa, DASHBOARD_ITEM_VISIBILITY as ab, BarChartHandler as ac, PieChartHandler as ad, StackBarChartHandler as ae, axisFormatters as af, groupDatesByYearAndMonth as ag, GaugeChartHandler as ah, TableViewHandler as ai, OverviewCardHandler as aj, TimelineHandler as ak, LineChartHandler as al, SnapshotHandler as am, ComparisonChartHandler as an, SplitterChartHandler as ao, LevelCardHandler as ap, MapChartHandler as aq, RingGaugeChartHandler as ar, SPlusChartHandler as as, PhaseGateStepperHandler as at, formatCurrency as au, getCurrencySuffix as av, formatPercentage as aw, formatNumber as ax, formatDate as ay, createAxisFormatter as az, resolveLegendColorOverride as b, findPreset as b$, ManageItemService as b0, GeneralSettings as b1, DataSourceSettings as b2, ActionsSettings as b3, ChartViewer as b4, StyleStudioDrawer as b5, StyleSettingsRenderer as b6, expandResetPatches as b7, StyleField as b8, SegmentedField as b9, toFormSourceLink as bA, normalizeOnLoad as bB, normalizeBeforeSave as bC, normalizeBeforeRequest as bD, CONFIG_DOMAINS as bE, domainsForCapability as bF, findDomain as bG, POPOVER_TABS as bH, POPOVER_TAB_SPECS as bI, titleToUi as bJ, applyTitleToPersisted as bK, datasourceToUi as bL, fieldsToUi as bM, filtersToUi as bN, styleToUi as bO, applyStyleToPersisted as bP, layoutToUi as bQ, applyLayoutToPersisted as bR, labelLegendFormatToUi as bS, applyLabelLegendFormatToPersisted as bT, behaviorToUi as bU, applyBehaviorToPersisted as bV, applyFilterChipsToPersisted as bW, persistedToUi as bX, buildAssembly as bY, STYLE_PRESETS as bZ, presetsForCapability as b_, ColorListField as ba, ArrayBuilderField as bb, KeyValueMapField as bc, LegendOrderField as bd, ItemCardMenuComponent as be, ChartFilterDrawer as bf, ItemContextToolbarComponent as bg, ItemConfigPopoverComponent as bh, GuidedConfigDialogComponent as bi, FilterChipsBarComponent as bj, FilterBuilderComponent as bk, DatasourcePanelComponent as bl, SchemaControlRendererComponent as bm, FilterByGroupPipe as bn, GetChartActionsPipe as bo, CHART_CAPABILITIES as bp, getCapabilityById as bq, resolveCapability as br, toBackendChartType as bs, normalizeChartTypeForRequest as bt, normalizeFilterOperation as bu, normalizeAggregateFunction as bv, normalizeFilters as bw, selectorFromLegacy as bx, moduleIdFromSelector as by, toBackendSourceLink as bz, CardContentComponent as c, validate as c0, hasBlockingIssues as c1, groupIssuesByDomain as c2, parseAdvancedJson as c3, deepMerge$1 as c4, formatForEditor as c5, CUSTOM_COLOR_OPTION as c6, readByPath$1 as c7, setByPath as c8, applyControlPatchToPersisted as c9, applyControlPatchesToPersisted as ca, getControlSchema as cb, listControlSchemaIds as cc, listControlSchemas as cd, getFallbackControlSchema as ce, flattenSchema as cf, resolveDisplayFields as cg, buildDisplayFieldPredicate as ch, bindingKey as ci, getBinding as cj, listBindings as ck, listBindingsForChart as cl, readBoundValue as cm, ITEM_GUIDANCE_REGISTRY as cn, describeGuidance as co, ItemGuidanceService as cp, 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 };
|
|
53481
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-CMWrKUhw.mjs.map
|