@masterteam/dashboard-builder 0.0.116 → 0.0.118
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/README.md +65 -75
- package/assets/dashboard-builder.css +2 -2
- package/assets/i18n/ar.json +3 -1
- package/assets/i18n/en.json +3 -1
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-BDNd7eud.mjs → masterteam-dashboard-builder-dashboard-dialog.component-DFy4sv6t.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-BDNd7eud.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-DFy4sv6t.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-BjNTcvqc.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-2MrkLmtr.mjs} +943 -2425
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-2MrkLmtr.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs +1431 -0
- package/fesm2022/masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +7 -6
- package/types/masterteam-dashboard-builder.d.ts +92 -169
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-BjNTcvqc.mjs.map +0 -1
- package/fesm2022/masterteam-dashboard-builder-riyadh.geo-CE3Amxoa.mjs +0 -3902
- package/fesm2022/masterteam-dashboard-builder-riyadh.geo-CE3Amxoa.mjs.map +0 -1
- package/fesm2022/masterteam-dashboard-builder-saudi.geo-C_9VzPCF.mjs +0 -2530
- package/fesm2022/masterteam-dashboard-builder-saudi.geo-C_9VzPCF.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
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, afterNextRender, ChangeDetectorRef, model, HostListener, contentChild } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
|
-
import { CommonModule, DatePipe, isPlatformBrowser, DecimalPipe } from '@angular/common';
|
|
4
|
+
import { CommonModule, DatePipe, isPlatformBrowser, DOCUMENT, DecimalPipe } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR, FormBuilder, Validators, ReactiveFormsModule, NG_VALIDATORS, FormRecord, FormControl, FormGroup } from '@angular/forms';
|
|
7
7
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
8
|
-
import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
|
|
8
|
+
import { TranslocoService, TranslocoDirective, TranslocoPipe } from '@jsverse/transloco';
|
|
9
9
|
import * as i2$3 from 'angular-gridster2';
|
|
10
10
|
import { DirTypes, GridsterModule } from 'angular-gridster2';
|
|
11
11
|
import { Button } from '@masterteam/components/button';
|
|
@@ -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
|
}
|
|
@@ -21872,8 +21871,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
21872
21871
|
/**
|
|
21873
21872
|
* Map Chart Handler
|
|
21874
21873
|
*
|
|
21875
|
-
*
|
|
21876
|
-
* Matches exactly the old MapChartService behavior.
|
|
21874
|
+
* Prepares grouped geographic records for the dashboard map.
|
|
21877
21875
|
*/
|
|
21878
21876
|
// Fallback list of colors for dynamic assignment
|
|
21879
21877
|
const FALLBACK_COLORS = [
|
|
@@ -21887,180 +21885,12 @@ const FALLBACK_COLORS = [
|
|
|
21887
21885
|
'#9a60b4',
|
|
21888
21886
|
'#ea7ccc',
|
|
21889
21887
|
];
|
|
21890
|
-
// Custom marker path from SVG
|
|
21891
|
-
const CUSTOM_MARKER_PATH = 'path://M6.99998 0.666687C5.24336 0.666599 3.55769 1.35982 2.30935 2.59568C1.06101 3.83154 0.350879 5.51016 0.333313 7.26669C0.333313 11.8334 6.20831 16.9167 6.45831 17.1334C6.60926 17.2625 6.80135 17.3334 6.99998 17.3334C7.19861 17.3334 7.3907 17.2625 7.54165 17.1334C7.83331 16.9167 13.6666 11.8334 13.6666 7.26669C13.6491 5.51016 12.939 3.83154 11.6906 2.59568C10.4423 1.35982 8.7566 0.666599 6.99998 0.666687ZM6.99998 9.83335C6.42312 9.83335 5.85921 9.66229 5.37957 9.34181C4.89992 9.02132 4.52609 8.5658 4.30533 8.03285C4.08458 7.4999 4.02682 6.91345 4.13936 6.34767C4.2519 5.7819 4.52968 5.2622 4.93758 4.85429C5.34549 4.44639 5.86519 4.1686 6.43097 4.05606C6.99674 3.94352 7.58319 4.00128 8.11614 4.22204C8.64909 4.44279 9.10461 4.81663 9.4251 5.29627C9.74559 5.77592 9.91665 6.33983 9.91665 6.91669C9.91665 7.29971 9.8412 7.67898 9.69463 8.03285C9.54805 8.38671 9.33321 8.70825 9.06237 8.97908C8.79154 9.24992 8.47001 9.46476 8.11614 9.61134C7.76227 9.75791 7.383 9.83335 6.99998 9.83335Z';
|
|
21892
21888
|
class MapChartHandler {
|
|
21893
21889
|
storeService = inject(DashboardStoreService);
|
|
21894
|
-
|
|
21895
|
-
/**
|
|
21896
|
-
* handleMapChart - for ECharts geo map
|
|
21897
|
-
* Returns ECharts option directly
|
|
21898
|
-
*/
|
|
21890
|
+
/** Compatibility with saved configurations that use the older handler key. */
|
|
21899
21891
|
handleMapChart(dataResponse, config) {
|
|
21900
|
-
|
|
21901
|
-
const configAsType = config.clientConfig?.configAsType || {};
|
|
21902
|
-
const legendPosition = this.normalizeLegendPosition(configAsType?.['legend']?.position);
|
|
21903
|
-
const locationKeyConfig = config.serviceConfig?.query?.['locationProperty']?.toLowerCase();
|
|
21904
|
-
const groupingKeyConfig = config.serviceConfig?.query?.['groupingProperty']?.toLowerCase();
|
|
21905
|
-
const mapType = config.clientConfig?.['map'];
|
|
21906
|
-
if (mapType && mapType !== 'SaudiArabia') {
|
|
21907
|
-
this.mapCity = 'RiyadhGovernorate';
|
|
21908
|
-
}
|
|
21909
|
-
// Group records by the grouping property
|
|
21910
|
-
const groupedRecords = new Map();
|
|
21911
|
-
// 2) Iterate over data.values
|
|
21912
|
-
const values = dataResponse?.values || [];
|
|
21913
|
-
// Table/Map tooltips sit beside the rows: tooltips[i] is values[i]'s (#1842).
|
|
21914
|
-
const tooltips = Array.isArray(dataResponse?.tooltips)
|
|
21915
|
-
? dataResponse.tooltips
|
|
21916
|
-
: [];
|
|
21917
|
-
values.forEach((record, recordIndex) => {
|
|
21918
|
-
const recordKeys = Object.keys(record);
|
|
21919
|
-
const locationKeyInRecord = recordKeys.find((k) => k.toLowerCase() === locationKeyConfig);
|
|
21920
|
-
if (!locationKeyInRecord)
|
|
21921
|
-
return;
|
|
21922
|
-
const locationProp = record[locationKeyInRecord];
|
|
21923
|
-
if (!locationProp || !locationProp.value)
|
|
21924
|
-
return;
|
|
21925
|
-
// parse lat/lon
|
|
21926
|
-
const lat = parseFloat(locationProp.value.lat);
|
|
21927
|
-
const lon = parseFloat(locationProp.value.lon);
|
|
21928
|
-
if (isNaN(lat) || isNaN(lon))
|
|
21929
|
-
return;
|
|
21930
|
-
const groupName = this.resolveGroupName(record, groupingKeyConfig);
|
|
21931
|
-
// location display
|
|
21932
|
-
const locationDisplay = locationProp.value.display_name || 'Untitled';
|
|
21933
|
-
// one scatter point
|
|
21934
|
-
const pointData = {
|
|
21935
|
-
name: locationDisplay,
|
|
21936
|
-
value: [lon, lat, locationDisplay],
|
|
21937
|
-
extraValues: record,
|
|
21938
|
-
tooltip: tooltips[recordIndex],
|
|
21939
|
-
};
|
|
21940
|
-
// Insert into grouped map
|
|
21941
|
-
if (!groupedRecords.has(groupName)) {
|
|
21942
|
-
groupedRecords.set(groupName, []);
|
|
21943
|
-
}
|
|
21944
|
-
groupedRecords.get(groupName).push(pointData);
|
|
21945
|
-
});
|
|
21946
|
-
// 3) Build dynamic color assignment & create scatter series
|
|
21947
|
-
const seriesList = [];
|
|
21948
|
-
const legendNames = [];
|
|
21949
|
-
const colorAssignments = new Map();
|
|
21950
|
-
let colorIndex = 0;
|
|
21951
|
-
groupedRecords.forEach((points, groupName) => {
|
|
21952
|
-
let color = colorAssignments.get(groupName);
|
|
21953
|
-
if (!color) {
|
|
21954
|
-
color = FALLBACK_COLORS[colorIndex % FALLBACK_COLORS.length];
|
|
21955
|
-
colorIndex++;
|
|
21956
|
-
colorAssignments.set(groupName, color);
|
|
21957
|
-
}
|
|
21958
|
-
// create series
|
|
21959
|
-
seriesList.push({
|
|
21960
|
-
name: groupName,
|
|
21961
|
-
type: 'scatter',
|
|
21962
|
-
coordinateSystem: 'geo',
|
|
21963
|
-
data: points,
|
|
21964
|
-
symbolSize: 10,
|
|
21965
|
-
symbol: CUSTOM_MARKER_PATH,
|
|
21966
|
-
itemStyle: { color },
|
|
21967
|
-
label: {
|
|
21968
|
-
show: true,
|
|
21969
|
-
position: 'bottom',
|
|
21970
|
-
distance: 8,
|
|
21971
|
-
color: '#333',
|
|
21972
|
-
fontFamily: generalConfiguration?.fontConfig?.fontFamily,
|
|
21973
|
-
fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.category,
|
|
21974
|
-
fontWeight: 'normal',
|
|
21975
|
-
formatter: (value) => {
|
|
21976
|
-
return formatWordsUnderBar(value?.data?.name);
|
|
21977
|
-
},
|
|
21978
|
-
},
|
|
21979
|
-
emphasis: {
|
|
21980
|
-
itemStyle: {
|
|
21981
|
-
color,
|
|
21982
|
-
shadowBlur: 10,
|
|
21983
|
-
shadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
21984
|
-
},
|
|
21985
|
-
label: {
|
|
21986
|
-
fontWeight: 'bold',
|
|
21987
|
-
},
|
|
21988
|
-
},
|
|
21989
|
-
zlevel: 2,
|
|
21990
|
-
});
|
|
21991
|
-
// The single group of an ungrouped map has no name to list.
|
|
21992
|
-
if (groupName)
|
|
21993
|
-
legendNames.push(groupName);
|
|
21994
|
-
});
|
|
21995
|
-
// 4) Construct final ECharts option
|
|
21996
|
-
const option = {
|
|
21997
|
-
tooltip: {
|
|
21998
|
-
trigger: 'item',
|
|
21999
|
-
formatter: (params) => params.name,
|
|
22000
|
-
},
|
|
22001
|
-
geo: {
|
|
22002
|
-
map: this.mapCity,
|
|
22003
|
-
roam: true,
|
|
22004
|
-
center: [46.6753, 24.7136],
|
|
22005
|
-
zoom: 1.8,
|
|
22006
|
-
itemStyle: {
|
|
22007
|
-
areaColor: '#f5f5f5',
|
|
22008
|
-
borderColor: '#ccc',
|
|
22009
|
-
borderWidth: 1.5,
|
|
22010
|
-
},
|
|
22011
|
-
emphasis: {
|
|
22012
|
-
itemStyle: {
|
|
22013
|
-
areaColor: '#e6e6e6',
|
|
22014
|
-
},
|
|
22015
|
-
},
|
|
22016
|
-
label: { show: false },
|
|
22017
|
-
},
|
|
22018
|
-
legend: {
|
|
22019
|
-
type: 'scroll',
|
|
22020
|
-
...this.getLegendLayout(legendPosition),
|
|
22021
|
-
data: legendNames,
|
|
22022
|
-
icon: configAsType?.['legend']?.['iconType'] || 'circle',
|
|
22023
|
-
show: configAsType?.['legend']?.show ?? true,
|
|
22024
|
-
textStyle: {
|
|
22025
|
-
fontFamily: generalConfiguration?.fontConfig?.fontFamily,
|
|
22026
|
-
fontSize: generalConfiguration?.fontConfig?.fontSizeConfig?.legend,
|
|
22027
|
-
color: '#333',
|
|
22028
|
-
},
|
|
22029
|
-
},
|
|
22030
|
-
series: seriesList,
|
|
22031
|
-
};
|
|
22032
|
-
return option;
|
|
22033
|
-
}
|
|
22034
|
-
normalizeLegendPosition(position) {
|
|
22035
|
-
return position === 'top' ||
|
|
22036
|
-
position === 'right' ||
|
|
22037
|
-
position === 'bottom' ||
|
|
22038
|
-
position === 'left'
|
|
22039
|
-
? position
|
|
22040
|
-
: 'bottom';
|
|
21892
|
+
return this.handleLeafletMap(dataResponse, config);
|
|
22041
21893
|
}
|
|
22042
|
-
getLegendLayout(position) {
|
|
22043
|
-
switch (position) {
|
|
22044
|
-
case 'top':
|
|
22045
|
-
return { top: '3%', left: 'center', orient: 'horizontal' };
|
|
22046
|
-
case 'left':
|
|
22047
|
-
return { left: '2%', top: 'middle', orient: 'vertical' };
|
|
22048
|
-
case 'right':
|
|
22049
|
-
return { right: '2%', top: 'middle', orient: 'vertical' };
|
|
22050
|
-
case 'bottom':
|
|
22051
|
-
default:
|
|
22052
|
-
return { bottom: '3%', left: 'center', orient: 'horizontal' };
|
|
22053
|
-
}
|
|
22054
|
-
}
|
|
22055
|
-
/**
|
|
22056
|
-
* The group a record is plotted under.
|
|
22057
|
-
*
|
|
22058
|
-
* The grouping property is optional: with none configured every record
|
|
22059
|
-
* lands in one unnamed group, which the map draws without a legend entry.
|
|
22060
|
-
* A record with no grouping value is grouped as "Unknown" rather than
|
|
22061
|
-
* dropped — the backend omits null properties from the row, so a missing
|
|
22062
|
-
* key means "no value", not "not requested".
|
|
22063
|
-
*/
|
|
22064
21894
|
resolveGroupName(record, groupingKey) {
|
|
22065
21895
|
if (!groupingKey)
|
|
22066
21896
|
return '';
|
|
@@ -25088,7 +24918,7 @@ class ActionService {
|
|
|
25088
24918
|
// "Dialog header"), not from the chart that opened it.
|
|
25089
24919
|
const header = resolveDashboardDialogHeader(dialogConfig);
|
|
25090
24920
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
25091
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
24921
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-DFy4sv6t.mjs').then(({ DashboardDialogComponent }) => {
|
|
25092
24922
|
// Open dialog using ModalService
|
|
25093
24923
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
25094
24924
|
header: header.title,
|
|
@@ -25713,128 +25543,128 @@ class CardFilterComponent {
|
|
|
25713
25543
|
}
|
|
25714
25544
|
}
|
|
25715
25545
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25716
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardFilterComponent, isStandalone: true, selector: "mt-card-filter", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, ngImport: i0, template: `
|
|
25717
|
-
<div class="card-filter" *transloco="let t; prefix: 'dashboard'">
|
|
25718
|
-
@switch (filterType()) {
|
|
25719
|
-
@case ('select') {
|
|
25720
|
-
<select
|
|
25721
|
-
class="filter-select"
|
|
25722
|
-
[(ngModel)]="selectedValue"
|
|
25723
|
-
(ngModelChange)="onFilterChange($event)"
|
|
25724
|
-
>
|
|
25725
|
-
@if (placeholder()) {
|
|
25726
|
-
<option [value]="null" disabled>{{ placeholder() }}</option>
|
|
25727
|
-
}
|
|
25728
|
-
@for (option of options(); track option.key) {
|
|
25729
|
-
<option [value]="option.value">
|
|
25730
|
-
{{
|
|
25731
|
-
option.label[langCode()] || option.label['en'] || option.key
|
|
25732
|
-
}}
|
|
25733
|
-
</option>
|
|
25734
|
-
}
|
|
25735
|
-
</select>
|
|
25736
|
-
}
|
|
25737
|
-
@case ('multiSelect') {
|
|
25738
|
-
<div class="multi-select-container">
|
|
25739
|
-
<!-- Simplified multi-select -->
|
|
25740
|
-
<select
|
|
25741
|
-
class="filter-select"
|
|
25742
|
-
multiple
|
|
25743
|
-
[(ngModel)]="selectedValues"
|
|
25744
|
-
(ngModelChange)="onMultiFilterChange($event)"
|
|
25745
|
-
>
|
|
25746
|
-
@for (option of options(); track option.key) {
|
|
25747
|
-
<option [value]="option.value">
|
|
25748
|
-
{{
|
|
25749
|
-
option.label[langCode()] || option.label['en'] || option.key
|
|
25750
|
-
}}
|
|
25751
|
-
</option>
|
|
25752
|
-
}
|
|
25753
|
-
</select>
|
|
25754
|
-
</div>
|
|
25755
|
-
}
|
|
25756
|
-
@case ('dateRange') {
|
|
25757
|
-
<div class="date-range-container">
|
|
25758
|
-
<input
|
|
25759
|
-
type="date"
|
|
25760
|
-
class="filter-date"
|
|
25761
|
-
[(ngModel)]="startDate"
|
|
25762
|
-
(ngModelChange)="onDateChange()"
|
|
25763
|
-
/>
|
|
25764
|
-
<span class="date-separator">-</span>
|
|
25765
|
-
<input
|
|
25766
|
-
type="date"
|
|
25767
|
-
class="filter-date"
|
|
25768
|
-
[(ngModel)]="endDate"
|
|
25769
|
-
(ngModelChange)="onDateChange()"
|
|
25770
|
-
/>
|
|
25771
|
-
</div>
|
|
25772
|
-
}
|
|
25773
|
-
}
|
|
25774
|
-
</div>
|
|
25546
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardFilterComponent, isStandalone: true, selector: "mt-card-filter", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange" }, ngImport: i0, template: `
|
|
25547
|
+
<div class="card-filter" *transloco="let t; prefix: 'dashboard'">
|
|
25548
|
+
@switch (filterType()) {
|
|
25549
|
+
@case ('select') {
|
|
25550
|
+
<select
|
|
25551
|
+
class="filter-select"
|
|
25552
|
+
[(ngModel)]="selectedValue"
|
|
25553
|
+
(ngModelChange)="onFilterChange($event)"
|
|
25554
|
+
>
|
|
25555
|
+
@if (placeholder()) {
|
|
25556
|
+
<option [value]="null" disabled>{{ placeholder() }}</option>
|
|
25557
|
+
}
|
|
25558
|
+
@for (option of options(); track option.key) {
|
|
25559
|
+
<option [value]="option.value">
|
|
25560
|
+
{{
|
|
25561
|
+
option.label[langCode()] || option.label['en'] || option.key
|
|
25562
|
+
}}
|
|
25563
|
+
</option>
|
|
25564
|
+
}
|
|
25565
|
+
</select>
|
|
25566
|
+
}
|
|
25567
|
+
@case ('multiSelect') {
|
|
25568
|
+
<div class="multi-select-container">
|
|
25569
|
+
<!-- Simplified multi-select -->
|
|
25570
|
+
<select
|
|
25571
|
+
class="filter-select"
|
|
25572
|
+
multiple
|
|
25573
|
+
[(ngModel)]="selectedValues"
|
|
25574
|
+
(ngModelChange)="onMultiFilterChange($event)"
|
|
25575
|
+
>
|
|
25576
|
+
@for (option of options(); track option.key) {
|
|
25577
|
+
<option [value]="option.value">
|
|
25578
|
+
{{
|
|
25579
|
+
option.label[langCode()] || option.label['en'] || option.key
|
|
25580
|
+
}}
|
|
25581
|
+
</option>
|
|
25582
|
+
}
|
|
25583
|
+
</select>
|
|
25584
|
+
</div>
|
|
25585
|
+
}
|
|
25586
|
+
@case ('dateRange') {
|
|
25587
|
+
<div class="date-range-container">
|
|
25588
|
+
<input
|
|
25589
|
+
type="date"
|
|
25590
|
+
class="filter-date"
|
|
25591
|
+
[(ngModel)]="startDate"
|
|
25592
|
+
(ngModelChange)="onDateChange()"
|
|
25593
|
+
/>
|
|
25594
|
+
<span class="date-separator">-</span>
|
|
25595
|
+
<input
|
|
25596
|
+
type="date"
|
|
25597
|
+
class="filter-date"
|
|
25598
|
+
[(ngModel)]="endDate"
|
|
25599
|
+
(ngModelChange)="onDateChange()"
|
|
25600
|
+
/>
|
|
25601
|
+
</div>
|
|
25602
|
+
}
|
|
25603
|
+
}
|
|
25604
|
+
</div>
|
|
25775
25605
|
`, isInline: true, styles: [".card-filter{display:flex;align-items:center;gap:.5rem}.filter-select{padding:.375rem .75rem;border:1px solid #e0e0e0;border-radius:.375rem;font-size:.875rem;background:#fff;color:#333;min-width:120px;cursor:pointer;transition:border-color .15s ease}.filter-select:focus{outline:none;border-color:#4caf50}.filter-select:hover{border-color:#bbb}.multi-select-container{position:relative}.date-range-container{display:flex;align-items:center;gap:.25rem}.filter-date{padding:.375rem .5rem;border:1px solid #e0e0e0;border-radius:.375rem;font-size:.875rem;background:#fff;color:#333}.filter-date:focus{outline:none;border-color:#4caf50}.date-separator{color:#999;font-size:.875rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
25776
25606
|
}
|
|
25777
25607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardFilterComponent, decorators: [{
|
|
25778
25608
|
type: Component,
|
|
25779
|
-
args: [{ selector: 'mt-card-filter', standalone: true, imports: [CommonModule, FormsModule, TranslocoDirective], template: `
|
|
25780
|
-
<div class="card-filter" *transloco="let t; prefix: 'dashboard'">
|
|
25781
|
-
@switch (filterType()) {
|
|
25782
|
-
@case ('select') {
|
|
25783
|
-
<select
|
|
25784
|
-
class="filter-select"
|
|
25785
|
-
[(ngModel)]="selectedValue"
|
|
25786
|
-
(ngModelChange)="onFilterChange($event)"
|
|
25787
|
-
>
|
|
25788
|
-
@if (placeholder()) {
|
|
25789
|
-
<option [value]="null" disabled>{{ placeholder() }}</option>
|
|
25790
|
-
}
|
|
25791
|
-
@for (option of options(); track option.key) {
|
|
25792
|
-
<option [value]="option.value">
|
|
25793
|
-
{{
|
|
25794
|
-
option.label[langCode()] || option.label['en'] || option.key
|
|
25795
|
-
}}
|
|
25796
|
-
</option>
|
|
25797
|
-
}
|
|
25798
|
-
</select>
|
|
25799
|
-
}
|
|
25800
|
-
@case ('multiSelect') {
|
|
25801
|
-
<div class="multi-select-container">
|
|
25802
|
-
<!-- Simplified multi-select -->
|
|
25803
|
-
<select
|
|
25804
|
-
class="filter-select"
|
|
25805
|
-
multiple
|
|
25806
|
-
[(ngModel)]="selectedValues"
|
|
25807
|
-
(ngModelChange)="onMultiFilterChange($event)"
|
|
25808
|
-
>
|
|
25809
|
-
@for (option of options(); track option.key) {
|
|
25810
|
-
<option [value]="option.value">
|
|
25811
|
-
{{
|
|
25812
|
-
option.label[langCode()] || option.label['en'] || option.key
|
|
25813
|
-
}}
|
|
25814
|
-
</option>
|
|
25815
|
-
}
|
|
25816
|
-
</select>
|
|
25817
|
-
</div>
|
|
25818
|
-
}
|
|
25819
|
-
@case ('dateRange') {
|
|
25820
|
-
<div class="date-range-container">
|
|
25821
|
-
<input
|
|
25822
|
-
type="date"
|
|
25823
|
-
class="filter-date"
|
|
25824
|
-
[(ngModel)]="startDate"
|
|
25825
|
-
(ngModelChange)="onDateChange()"
|
|
25826
|
-
/>
|
|
25827
|
-
<span class="date-separator">-</span>
|
|
25828
|
-
<input
|
|
25829
|
-
type="date"
|
|
25830
|
-
class="filter-date"
|
|
25831
|
-
[(ngModel)]="endDate"
|
|
25832
|
-
(ngModelChange)="onDateChange()"
|
|
25833
|
-
/>
|
|
25834
|
-
</div>
|
|
25835
|
-
}
|
|
25836
|
-
}
|
|
25837
|
-
</div>
|
|
25609
|
+
args: [{ selector: 'mt-card-filter', standalone: true, imports: [CommonModule, FormsModule, TranslocoDirective], template: `
|
|
25610
|
+
<div class="card-filter" *transloco="let t; prefix: 'dashboard'">
|
|
25611
|
+
@switch (filterType()) {
|
|
25612
|
+
@case ('select') {
|
|
25613
|
+
<select
|
|
25614
|
+
class="filter-select"
|
|
25615
|
+
[(ngModel)]="selectedValue"
|
|
25616
|
+
(ngModelChange)="onFilterChange($event)"
|
|
25617
|
+
>
|
|
25618
|
+
@if (placeholder()) {
|
|
25619
|
+
<option [value]="null" disabled>{{ placeholder() }}</option>
|
|
25620
|
+
}
|
|
25621
|
+
@for (option of options(); track option.key) {
|
|
25622
|
+
<option [value]="option.value">
|
|
25623
|
+
{{
|
|
25624
|
+
option.label[langCode()] || option.label['en'] || option.key
|
|
25625
|
+
}}
|
|
25626
|
+
</option>
|
|
25627
|
+
}
|
|
25628
|
+
</select>
|
|
25629
|
+
}
|
|
25630
|
+
@case ('multiSelect') {
|
|
25631
|
+
<div class="multi-select-container">
|
|
25632
|
+
<!-- Simplified multi-select -->
|
|
25633
|
+
<select
|
|
25634
|
+
class="filter-select"
|
|
25635
|
+
multiple
|
|
25636
|
+
[(ngModel)]="selectedValues"
|
|
25637
|
+
(ngModelChange)="onMultiFilterChange($event)"
|
|
25638
|
+
>
|
|
25639
|
+
@for (option of options(); track option.key) {
|
|
25640
|
+
<option [value]="option.value">
|
|
25641
|
+
{{
|
|
25642
|
+
option.label[langCode()] || option.label['en'] || option.key
|
|
25643
|
+
}}
|
|
25644
|
+
</option>
|
|
25645
|
+
}
|
|
25646
|
+
</select>
|
|
25647
|
+
</div>
|
|
25648
|
+
}
|
|
25649
|
+
@case ('dateRange') {
|
|
25650
|
+
<div class="date-range-container">
|
|
25651
|
+
<input
|
|
25652
|
+
type="date"
|
|
25653
|
+
class="filter-date"
|
|
25654
|
+
[(ngModel)]="startDate"
|
|
25655
|
+
(ngModelChange)="onDateChange()"
|
|
25656
|
+
/>
|
|
25657
|
+
<span class="date-separator">-</span>
|
|
25658
|
+
<input
|
|
25659
|
+
type="date"
|
|
25660
|
+
class="filter-date"
|
|
25661
|
+
[(ngModel)]="endDate"
|
|
25662
|
+
(ngModelChange)="onDateChange()"
|
|
25663
|
+
/>
|
|
25664
|
+
</div>
|
|
25665
|
+
}
|
|
25666
|
+
}
|
|
25667
|
+
</div>
|
|
25838
25668
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".card-filter{display:flex;align-items:center;gap:.5rem}.filter-select{padding:.375rem .75rem;border:1px solid #e0e0e0;border-radius:.375rem;font-size:.875rem;background:#fff;color:#333;min-width:120px;cursor:pointer;transition:border-color .15s ease}.filter-select:focus{outline:none;border-color:#4caf50}.filter-select:hover{border-color:#bbb}.multi-select-container{position:relative}.date-range-container{display:flex;align-items:center;gap:.25rem}.filter-date{padding:.375rem .5rem;border:1px solid #e0e0e0;border-radius:.375rem;font-size:.875rem;background:#fff;color:#333}.filter-date:focus{outline:none;border-color:#4caf50}.date-separator{color:#999;font-size:.875rem}\n"] }]
|
|
25839
25669
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }] } });
|
|
25840
25670
|
|
|
@@ -27745,30 +27575,30 @@ class CardInfoComponent {
|
|
|
27745
27575
|
return typeof info.value === 'string' ? info.value : '';
|
|
27746
27576
|
}, ...(ngDevMode ? [{ debugName: "tooltipContent" }] : /* istanbul ignore next */ []));
|
|
27747
27577
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27748
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardInfoComponent, isStandalone: true, selector: "mt-card-info", inputs: { cardInfo: { classPropertyName: "cardInfo", publicName: "cardInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
27749
|
-
@if (showInfo()) {
|
|
27750
|
-
<span
|
|
27751
|
-
class="card-info-icon"
|
|
27752
|
-
[mtTooltip]="tooltipContent()"
|
|
27753
|
-
tooltipPosition="bottom"
|
|
27754
|
-
>
|
|
27755
|
-
<i class="pi pi-info-circle"></i>
|
|
27756
|
-
</span>
|
|
27757
|
-
}
|
|
27578
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: CardInfoComponent, isStandalone: true, selector: "mt-card-info", inputs: { cardInfo: { classPropertyName: "cardInfo", publicName: "cardInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
27579
|
+
@if (showInfo()) {
|
|
27580
|
+
<span
|
|
27581
|
+
class="card-info-icon"
|
|
27582
|
+
[mtTooltip]="tooltipContent()"
|
|
27583
|
+
tooltipPosition="bottom"
|
|
27584
|
+
>
|
|
27585
|
+
<i class="pi pi-info-circle"></i>
|
|
27586
|
+
</span>
|
|
27587
|
+
}
|
|
27758
27588
|
`, isInline: true, styles: [".card-info-icon{display:inline-flex;align-items:center;justify-content:center;cursor:help;color:#666;font-size:1rem;transition:color .15s ease}.card-info-icon:hover{color:#333}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: Tooltip$1, selector: "[mtTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
27759
27589
|
}
|
|
27760
27590
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CardInfoComponent, decorators: [{
|
|
27761
27591
|
type: Component,
|
|
27762
|
-
args: [{ selector: 'mt-card-info', standalone: true, imports: [CommonModule, Tooltip$1], template: `
|
|
27763
|
-
@if (showInfo()) {
|
|
27764
|
-
<span
|
|
27765
|
-
class="card-info-icon"
|
|
27766
|
-
[mtTooltip]="tooltipContent()"
|
|
27767
|
-
tooltipPosition="bottom"
|
|
27768
|
-
>
|
|
27769
|
-
<i class="pi pi-info-circle"></i>
|
|
27770
|
-
</span>
|
|
27771
|
-
}
|
|
27592
|
+
args: [{ selector: 'mt-card-info', standalone: true, imports: [CommonModule, Tooltip$1], template: `
|
|
27593
|
+
@if (showInfo()) {
|
|
27594
|
+
<span
|
|
27595
|
+
class="card-info-icon"
|
|
27596
|
+
[mtTooltip]="tooltipContent()"
|
|
27597
|
+
tooltipPosition="bottom"
|
|
27598
|
+
>
|
|
27599
|
+
<i class="pi pi-info-circle"></i>
|
|
27600
|
+
</span>
|
|
27601
|
+
}
|
|
27772
27602
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".card-info-icon{display:inline-flex;align-items:center;justify-content:center;cursor:help;color:#666;font-size:1rem;transition:color .15s ease}.card-info-icon:hover{color:#333}\n"] }]
|
|
27773
27603
|
}], propDecorators: { cardInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardInfo", required: false }] }] } });
|
|
27774
27604
|
|
|
@@ -27790,15 +27620,21 @@ function hasPointTooltip(tooltip) {
|
|
|
27790
27620
|
function pointTooltipHtml(tooltip, moreLabel) {
|
|
27791
27621
|
if (!hasPointTooltip(tooltip))
|
|
27792
27622
|
return '';
|
|
27623
|
+
const lines = pointTooltipLines(tooltip, moreLabel).map(escapeHtml);
|
|
27624
|
+
return `<div style="margin-top:6px;padding-top:6px;border-top:1px solid rgba(128,128,128,.25);font-size:12px;line-height:1.5">${lines.join('<br/>')}</div>`;
|
|
27625
|
+
}
|
|
27626
|
+
function pointTooltipLines(tooltip, moreLabel) {
|
|
27627
|
+
if (!hasPointTooltip(tooltip))
|
|
27628
|
+
return [];
|
|
27793
27629
|
const records = tooltip.records ?? [];
|
|
27794
|
-
const field = (f) => `${
|
|
27630
|
+
const field = (f) => `${f.label || f.key || ''}: ${String(f.displayValue ?? f.value ?? '–')}`;
|
|
27795
27631
|
const lines = records.length === 1
|
|
27796
27632
|
? (records[0].fields ?? []).map(field)
|
|
27797
27633
|
: records.map((record) => (record.fields ?? []).map(field).join(' · '));
|
|
27798
27634
|
const remaining = Number(tooltip.remainingCount) || 0;
|
|
27799
27635
|
if (remaining > 0)
|
|
27800
|
-
lines.push(
|
|
27801
|
-
return
|
|
27636
|
+
lines.push(moreLabel(remaining));
|
|
27637
|
+
return lines;
|
|
27802
27638
|
}
|
|
27803
27639
|
|
|
27804
27640
|
/**
|
|
@@ -29360,373 +29196,445 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
29360
29196
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%;min-height:0;position:relative}.chart-wrapper{width:100%;height:96%;display:flex;justify-content:center;align-items:center;position:relative;min-height:0}.chart-wrapper.in-group-with-header{height:86%}.scroll-wrapper{width:100%;height:96%;overflow-x:auto;overflow-y:hidden;position:relative;min-height:0}.scroll-wrapper.in-group-with-header{height:86%}.chart{width:100%;height:100%;min-height:0}.chart-scroll{width:100%;height:100%;min-height:0;overflow-y:hidden}.custom-legend{position:absolute;bottom:10px;left:0;right:0;z-index:1000;background:transparent;padding:4px 8px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:4px;width:100%;max-width:100%}.custom-legend.has-scroll{bottom:25px}.custom-legend.custom-legend--top{top:10px;bottom:auto}.custom-legend.custom-legend--left{top:0;bottom:0;right:auto;width:auto;max-width:45%;flex-direction:column;justify-content:center;align-items:flex-start}.custom-legend.custom-legend--right{top:0;bottom:0;left:auto;width:auto;max-width:45%;flex-direction:column;justify-content:center;align-items:flex-start}.legend-item{display:flex;align-items:center;gap:3px;padding:2px 4px;border-radius:3px;cursor:pointer;transition:all .2s ease;-webkit-user-select:none;user-select:none;font-size:11px;white-space:nowrap;background:transparent;line-height:1.2;flex-direction:row}.legend-item:hover{background-color:#0000000d}.legend-item.disabled{opacity:.5}.legend-item.disabled .legend-text{text-decoration:line-through}.legend-icon{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-text{font-family:inherit}\n"] }]
|
|
29361
29197
|
}], ctorParameters: () => [], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], chartConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartConfig", required: false }] }], configurationItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurationItem", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], headerHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerHidden", required: false }] }], chartClick: [{ type: i0.Output, args: ["chartClick"] }], chartDblClick: [{ type: i0.Output, args: ["chartDblClick"] }] } });
|
|
29362
29198
|
|
|
29363
|
-
|
|
29364
|
-
|
|
29365
|
-
|
|
29366
|
-
|
|
29367
|
-
|
|
29368
|
-
|
|
29369
|
-
|
|
29370
|
-
|
|
29371
|
-
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
'
|
|
29376
|
-
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
|
|
29384
|
-
|
|
29385
|
-
function
|
|
29386
|
-
const
|
|
29387
|
-
const
|
|
29388
|
-
|
|
29389
|
-
|
|
29390
|
-
|
|
29391
|
-
|
|
29392
|
-
|
|
29393
|
-
|
|
29394
|
-
|
|
29395
|
-
|
|
29199
|
+
const OPEN_FREE_MAP = 'https://tiles.openfreemap.org';
|
|
29200
|
+
const RASTER_STYLE = {
|
|
29201
|
+
version: 8,
|
|
29202
|
+
sources: {
|
|
29203
|
+
osm: {
|
|
29204
|
+
type: 'raster',
|
|
29205
|
+
tiles: ['https://tile.openstreetmap.org/{z}/{x}/{y}.png'],
|
|
29206
|
+
tileSize: 256,
|
|
29207
|
+
maxzoom: 19,
|
|
29208
|
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>',
|
|
29209
|
+
},
|
|
29210
|
+
},
|
|
29211
|
+
layers: [{ id: 'osm', type: 'raster', source: 'osm' }],
|
|
29212
|
+
};
|
|
29213
|
+
let vectorStyle;
|
|
29214
|
+
function loadVectorStyle() {
|
|
29215
|
+
return (vectorStyle ??= fetchVectorStyle().then((style) => {
|
|
29216
|
+
if (!style)
|
|
29217
|
+
vectorStyle = undefined;
|
|
29218
|
+
return style;
|
|
29219
|
+
}));
|
|
29220
|
+
}
|
|
29221
|
+
async function fetchVectorStyle() {
|
|
29222
|
+
const controller = new AbortController();
|
|
29223
|
+
const timeout = setTimeout(() => controller.abort(), 4000);
|
|
29224
|
+
try {
|
|
29225
|
+
const response = await fetch(`${OPEN_FREE_MAP}/styles/liberty`, {
|
|
29226
|
+
signal: controller.signal,
|
|
29227
|
+
});
|
|
29228
|
+
if (!response.ok)
|
|
29229
|
+
return null;
|
|
29230
|
+
const style = (await response.json());
|
|
29231
|
+
return style?.version === 8 && style.sources && Array.isArray(style.layers)
|
|
29232
|
+
? style
|
|
29233
|
+
: null;
|
|
29234
|
+
}
|
|
29235
|
+
catch {
|
|
29236
|
+
return null;
|
|
29237
|
+
}
|
|
29238
|
+
finally {
|
|
29239
|
+
clearTimeout(timeout);
|
|
29240
|
+
}
|
|
29241
|
+
}
|
|
29242
|
+
function placeLabelLayers(style) {
|
|
29243
|
+
return style.layers
|
|
29244
|
+
.filter((layer) => layer.type === 'symbol' &&
|
|
29245
|
+
JSON.stringify(layer.layout?.['text-field'] ?? '').includes('name'))
|
|
29246
|
+
.map((layer) => layer.id);
|
|
29247
|
+
}
|
|
29248
|
+
function placeName(arabic) {
|
|
29249
|
+
// Liberty also uses OpenMapTiles' underscore spelling for English names.
|
|
29250
|
+
return arabic
|
|
29251
|
+
? ['coalesce', ['get', 'name:ar'], ['get', 'name']]
|
|
29252
|
+
: [
|
|
29253
|
+
'coalesce',
|
|
29254
|
+
['get', 'name:en'],
|
|
29255
|
+
['get', 'name_en'],
|
|
29256
|
+
['get', 'name:latin'],
|
|
29257
|
+
['get', 'name'],
|
|
29258
|
+
];
|
|
29259
|
+
}
|
|
29260
|
+
function isVectorBasemapError(error) {
|
|
29261
|
+
const url = error.url ?? error.message;
|
|
29262
|
+
return url.includes(OPEN_FREE_MAP) && !url.includes('/fonts/');
|
|
29263
|
+
}
|
|
29264
|
+
|
|
29396
29265
|
function plottableGroups(groups) {
|
|
29397
|
-
return
|
|
29398
|
-
.filter((group) => !!group)
|
|
29266
|
+
return groups
|
|
29399
29267
|
.map((group) => ({
|
|
29400
29268
|
...group,
|
|
29401
|
-
|
|
29402
|
-
|
|
29269
|
+
points: group.points.filter(({ lat, lon }) => Number.isFinite(lat) &&
|
|
29270
|
+
Number.isFinite(lon) &&
|
|
29271
|
+
Math.abs(lat) <= 90 &&
|
|
29272
|
+
Math.abs(lon) <= 180),
|
|
29403
29273
|
}))
|
|
29404
29274
|
.filter((group) => group.points.length > 0);
|
|
29405
29275
|
}
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29421
|
-
|
|
29422
|
-
|
|
29423
|
-
|
|
29424
|
-
|
|
29425
|
-
|
|
29426
|
-
|
|
29427
|
-
|
|
29428
|
-
|
|
29429
|
-
|
|
29430
|
-
function geoLayout(legend) {
|
|
29431
|
-
if (!legend.show)
|
|
29432
|
-
return { layoutCenter: ['50%', '50%'], layoutSize: '100%' };
|
|
29433
|
-
switch (legend.position) {
|
|
29434
|
-
case 'top':
|
|
29435
|
-
return { layoutCenter: ['50%', '56%'], layoutSize: '88%' };
|
|
29436
|
-
case 'left':
|
|
29437
|
-
return { layoutCenter: ['58%', '50%'], layoutSize: '88%' };
|
|
29438
|
-
case 'right':
|
|
29439
|
-
return { layoutCenter: ['42%', '50%'], layoutSize: '88%' };
|
|
29440
|
-
case 'bottom':
|
|
29441
|
-
default:
|
|
29442
|
-
return { layoutCenter: ['50%', '44%'], layoutSize: '88%' };
|
|
29443
|
-
}
|
|
29444
|
-
}
|
|
29445
|
-
/**
|
|
29446
|
-
* Longitude degrees shrink with latitude. ECharts' default `aspectScale`
|
|
29447
|
-
* (0.75) suits ~41°; near the equator it draws countries too narrow.
|
|
29448
|
-
*/
|
|
29449
|
-
function aspectScaleAt(latitude) {
|
|
29450
|
-
return Math.cos((latitude * Math.PI) / 180);
|
|
29451
|
-
}
|
|
29452
|
-
/**
|
|
29453
|
-
* The ECharts option for a Map Chart.
|
|
29454
|
-
*
|
|
29455
|
-
* Returns `null` when nothing is plottable, so the caller can show its own
|
|
29456
|
-
* empty state instead of an ECharts canvas with an invisible scatter series.
|
|
29457
|
-
*/
|
|
29458
|
-
function buildMapChartOption(groups, region, legend, font = {}) {
|
|
29459
|
-
const usable = plottableGroups(groups);
|
|
29460
|
-
if (!usable.length)
|
|
29461
|
-
return null;
|
|
29462
|
-
const legendNames = [];
|
|
29463
|
-
const series = usable.map((group, index) => {
|
|
29464
|
-
const color = group.color || MAP_FALLBACK_COLORS[index % MAP_FALLBACK_COLORS.length];
|
|
29465
|
-
// An ungrouped map is one unnamed group, with nothing to list.
|
|
29466
|
-
if (group.groupName)
|
|
29467
|
-
legendNames.push(group.groupName);
|
|
29468
|
-
return {
|
|
29469
|
-
name: group.groupName,
|
|
29470
|
-
type: 'scatter',
|
|
29471
|
-
coordinateSystem: 'geo',
|
|
29472
|
-
symbol: MAP_MARKER_PATH,
|
|
29473
|
-
symbolSize: 16,
|
|
29474
|
-
// ECharts centres a symbol on its coordinate, but this pin points with
|
|
29475
|
-
// its bottom tip. Lifting it by half its height puts the tip, not the
|
|
29476
|
-
// pin's middle, on the location.
|
|
29477
|
-
symbolOffset: [0, '-50%'],
|
|
29478
|
-
itemStyle: { color },
|
|
29479
|
-
data: group.points.map((point) => ({
|
|
29480
|
-
name: point.displayName || '',
|
|
29481
|
-
// ECharts geo wants [lon, lat]; the third slot rides along for tooltips.
|
|
29482
|
-
value: [Number(point.lon), Number(point.lat), point.displayName || ''],
|
|
29483
|
-
extraValues: point.extraValues,
|
|
29484
|
-
pointTooltip: point.tooltip,
|
|
29485
|
-
})),
|
|
29486
|
-
label: {
|
|
29487
|
-
show: true,
|
|
29488
|
-
position: 'bottom',
|
|
29489
|
-
distance: 8,
|
|
29490
|
-
color: '#333',
|
|
29491
|
-
fontFamily: font.fontFamily,
|
|
29492
|
-
fontSize: font.labelSize ?? 10,
|
|
29493
|
-
fontWeight: 'normal',
|
|
29494
|
-
formatter: (params) => params?.data?.name ?? '',
|
|
29495
|
-
},
|
|
29496
|
-
// Records in the same city sit a few pixels apart, and their labels then
|
|
29497
|
-
// print on top of each other. ECharts drops the colliding ones rather
|
|
29498
|
-
// than stacking them; the marker itself always stays visible, and
|
|
29499
|
-
// hovering shows the name in the tooltip.
|
|
29500
|
-
labelLayout: { hideOverlap: true },
|
|
29501
|
-
emphasis: {
|
|
29502
|
-
itemStyle: { color, shadowBlur: 10, shadowColor: 'rgba(0,0,0,0.3)' },
|
|
29503
|
-
label: { fontWeight: 'bold' },
|
|
29504
|
-
},
|
|
29505
|
-
zlevel: 2,
|
|
29506
|
-
};
|
|
29507
|
-
});
|
|
29508
|
-
const legendShown = legend.show && legendNames.length > 0;
|
|
29509
|
-
return {
|
|
29510
|
-
tooltip: {
|
|
29511
|
-
trigger: 'item',
|
|
29512
|
-
// A pin's Tooltip Properties are added by mt-echart, as for every
|
|
29513
|
-
// chart; adding them here as well listed each field twice (#1842).
|
|
29514
|
-
formatter: (params) => params?.seriesName
|
|
29515
|
-
? `${params.name}<br/>${params.seriesName}`
|
|
29516
|
-
: (params?.name ?? ''),
|
|
29517
|
-
},
|
|
29518
|
-
geo: {
|
|
29519
|
-
map: region.echartsName,
|
|
29520
|
-
roam: true,
|
|
29521
|
-
center: region.center,
|
|
29522
|
-
zoom: region.zoom,
|
|
29523
|
-
...geoLayout({ ...legend, show: legendShown }),
|
|
29524
|
-
aspectScale: aspectScaleAt(region.center[1]),
|
|
29525
|
-
// The boundaries are backdrop only. Interactive regions took the hover
|
|
29526
|
-
// and click away from the pins drawn over them (no pin tooltip, no click
|
|
29527
|
-
// dialog) and printed their own region name on top of the pin labels.
|
|
29528
|
-
// No `tooltip: { show: false }` here: a pin builds its tooltip from
|
|
29529
|
-
// item, series, then its coordinate system (this geo), so that hid
|
|
29530
|
-
// every pin's tooltip as well (#1847). `silent` already keeps the
|
|
29531
|
-
// regions quiet.
|
|
29532
|
-
silent: true,
|
|
29533
|
-
itemStyle: {
|
|
29534
|
-
areaColor: '#f5f5f5',
|
|
29535
|
-
borderColor: '#ccc',
|
|
29536
|
-
borderWidth: 1.5,
|
|
29276
|
+
const MAP_POINTS_SOURCE = 'dashboard-map-points';
|
|
29277
|
+
const CLUSTERS_LAYER = 'dashboard-map-clusters';
|
|
29278
|
+
const PINS_LAYER = 'dashboard-map-pins';
|
|
29279
|
+
const PIN_IMAGE = 'dashboard-map-pin';
|
|
29280
|
+
const PIN_RATIO = 2;
|
|
29281
|
+
const POINTS_SOURCE = {
|
|
29282
|
+
type: 'geojson',
|
|
29283
|
+
data: { type: 'FeatureCollection', features: [] },
|
|
29284
|
+
cluster: true,
|
|
29285
|
+
clusterRadius: 40,
|
|
29286
|
+
clusterMaxZoom: 14,
|
|
29287
|
+
};
|
|
29288
|
+
function pointLayers(clusterFont) {
|
|
29289
|
+
return [
|
|
29290
|
+
{
|
|
29291
|
+
id: CLUSTERS_LAYER,
|
|
29292
|
+
type: 'circle',
|
|
29293
|
+
source: MAP_POINTS_SOURCE,
|
|
29294
|
+
filter: ['has', 'point_count'],
|
|
29295
|
+
paint: {
|
|
29296
|
+
'circle-color': '#1a73e8',
|
|
29297
|
+
'circle-radius': ['step', ['get', 'point_count'], 16, 10, 20, 50, 26],
|
|
29298
|
+
'circle-stroke-color': '#fff',
|
|
29299
|
+
'circle-stroke-width': 2,
|
|
29537
29300
|
},
|
|
29538
|
-
emphasis: { disabled: true },
|
|
29539
|
-
label: { show: false },
|
|
29540
29301
|
},
|
|
29541
|
-
|
|
29542
|
-
|
|
29543
|
-
|
|
29544
|
-
|
|
29545
|
-
|
|
29546
|
-
|
|
29547
|
-
|
|
29548
|
-
|
|
29549
|
-
|
|
29550
|
-
|
|
29302
|
+
{
|
|
29303
|
+
id: 'dashboard-map-cluster-count',
|
|
29304
|
+
type: 'symbol',
|
|
29305
|
+
source: MAP_POINTS_SOURCE,
|
|
29306
|
+
filter: ['has', 'point_count'],
|
|
29307
|
+
layout: {
|
|
29308
|
+
'text-field': ['get', 'point_count_abbreviated'],
|
|
29309
|
+
'text-font': clusterFont,
|
|
29310
|
+
'text-size': 12,
|
|
29311
|
+
'text-allow-overlap': true,
|
|
29312
|
+
'text-ignore-placement': true,
|
|
29551
29313
|
},
|
|
29314
|
+
paint: { 'text-color': '#fff' },
|
|
29552
29315
|
},
|
|
29553
|
-
|
|
29554
|
-
|
|
29316
|
+
{
|
|
29317
|
+
id: PINS_LAYER,
|
|
29318
|
+
type: 'symbol',
|
|
29319
|
+
source: MAP_POINTS_SOURCE,
|
|
29320
|
+
filter: ['!', ['has', 'point_count']],
|
|
29321
|
+
layout: {
|
|
29322
|
+
'icon-image': PIN_IMAGE,
|
|
29323
|
+
'icon-anchor': 'bottom',
|
|
29324
|
+
'icon-allow-overlap': true,
|
|
29325
|
+
'icon-ignore-placement': true,
|
|
29326
|
+
},
|
|
29327
|
+
},
|
|
29328
|
+
];
|
|
29329
|
+
}
|
|
29330
|
+
const PIN_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 0 28 40">' +
|
|
29331
|
+
'<path d="M14 1C6.8 1 1 6.7 1 13.8 1 23.4 14 39 14 39s13-15.6 13-25.2C27 6.7 21.2 1 14 1z" ' +
|
|
29332
|
+
'fill="#1a73e8" stroke="#0b4fb3" stroke-width="1.5"/><circle cx="14" cy="13.8" r="5" fill="#fff"/></svg>';
|
|
29333
|
+
let pinImage;
|
|
29334
|
+
function loadPinImage() {
|
|
29335
|
+
return (pinImage ??= new Promise((resolve, reject) => {
|
|
29336
|
+
const image = new Image();
|
|
29337
|
+
image.onload = () => {
|
|
29338
|
+
const canvas = document.createElement('canvas');
|
|
29339
|
+
canvas.width = image.width * PIN_RATIO;
|
|
29340
|
+
canvas.height = image.height * PIN_RATIO;
|
|
29341
|
+
const context = canvas.getContext('2d');
|
|
29342
|
+
if (!context) {
|
|
29343
|
+
reject(new Error('Map pin canvas is unavailable'));
|
|
29344
|
+
return;
|
|
29345
|
+
}
|
|
29346
|
+
context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
29347
|
+
resolve(context.getImageData(0, 0, canvas.width, canvas.height));
|
|
29348
|
+
};
|
|
29349
|
+
image.onerror = () => reject(new Error('Map pin image could not be loaded'));
|
|
29350
|
+
image.src = 'data:image/svg+xml,' + encodeURIComponent(PIN_SVG);
|
|
29351
|
+
}).catch((error) => {
|
|
29352
|
+
pinImage = undefined;
|
|
29353
|
+
throw error;
|
|
29354
|
+
}));
|
|
29555
29355
|
}
|
|
29556
29356
|
|
|
29557
|
-
|
|
29558
|
-
|
|
29559
|
-
*
|
|
29560
|
-
* The widget draws boundaries from GeoJSON registered with ECharts rather than
|
|
29561
|
-
* fetching raster tiles, so it needs no network, no API key and no third-party
|
|
29562
|
-
* usage policy — the same approach the legacy dashboardBuilder app used.
|
|
29563
|
-
*
|
|
29564
|
-
* Each region's GeoJSON is lazy-loaded: the files are a few hundred KB and only
|
|
29565
|
-
* a dashboard containing a Map Chart should pay for them.
|
|
29566
|
-
*/
|
|
29567
|
-
/**
|
|
29568
|
-
* Keyed by the lowercased persisted `clientConfig.map` value.
|
|
29569
|
-
*
|
|
29570
|
-
* `riyadhgovernorate` is the name the legacy ECharts handler used for the same
|
|
29571
|
-
* region, so configs written by either side resolve.
|
|
29572
|
-
*/
|
|
29357
|
+
const SAUDI_ARABIA = { center: [45, 24], zoom: 4 };
|
|
29358
|
+
const RIYADH = { center: [46.6753, 24.7136], zoom: 8 };
|
|
29573
29359
|
const MAP_REGIONS = {
|
|
29574
|
-
saudiarabia:
|
|
29575
|
-
|
|
29576
|
-
|
|
29577
|
-
zoom: 1.45,
|
|
29578
|
-
load: () => import('./masterteam-dashboard-builder-saudi.geo-C_9VzPCF.mjs').then((m) => m.saudiGeoJson),
|
|
29579
|
-
},
|
|
29580
|
-
riyadh: {
|
|
29581
|
-
echartsName: 'RiyadhGovernorate',
|
|
29582
|
-
center: [46.6753, 24.7136],
|
|
29583
|
-
zoom: 0.72,
|
|
29584
|
-
load: () => import('./masterteam-dashboard-builder-riyadh.geo-CE3Amxoa.mjs').then((m) => m.riyadhGeoJson),
|
|
29585
|
-
},
|
|
29586
|
-
riyadhgovernorate: {
|
|
29587
|
-
echartsName: 'RiyadhGovernorate',
|
|
29588
|
-
center: [46.6753, 24.7136],
|
|
29589
|
-
zoom: 0.72,
|
|
29590
|
-
load: () => import('./masterteam-dashboard-builder-riyadh.geo-CE3Amxoa.mjs').then((m) => m.riyadhGeoJson),
|
|
29591
|
-
},
|
|
29360
|
+
saudiarabia: SAUDI_ARABIA,
|
|
29361
|
+
riyadh: RIYADH,
|
|
29362
|
+
riyadhgovernorate: RIYADH,
|
|
29592
29363
|
};
|
|
29593
29364
|
const DEFAULT_MAP_REGION_KEY = 'saudiarabia';
|
|
29594
|
-
/** Attribution for the bundled boundaries. Rendered by the widget; keep it. */
|
|
29595
|
-
const MAP_DATA_ATTRIBUTION = '© OpenStreetMap contributors (ODbL)';
|
|
29596
29365
|
function resolveMapRegion(value) {
|
|
29597
29366
|
const key = String(value ?? '')
|
|
29598
29367
|
.trim()
|
|
29599
29368
|
.toLowerCase();
|
|
29600
|
-
return MAP_REGIONS
|
|
29369
|
+
return Object.hasOwn(MAP_REGIONS, key) ? MAP_REGIONS[key] : SAUDI_ARABIA;
|
|
29370
|
+
}
|
|
29371
|
+
|
|
29372
|
+
let mapLibre;
|
|
29373
|
+
function loadMapLibre() {
|
|
29374
|
+
return (mapLibre ??= import('maplibre-gl')
|
|
29375
|
+
.then((module) => {
|
|
29376
|
+
module.setWorkerUrl(new URL('assets/map/maplibre-gl-worker.mjs', document.baseURI).href);
|
|
29377
|
+
return module;
|
|
29378
|
+
})
|
|
29379
|
+
.catch((error) => {
|
|
29380
|
+
mapLibre = undefined;
|
|
29381
|
+
throw error;
|
|
29382
|
+
}));
|
|
29601
29383
|
}
|
|
29602
29384
|
|
|
29603
|
-
/**
|
|
29604
|
-
* Map View Component
|
|
29605
|
-
*
|
|
29606
|
-
* Renderer for the `Map Chart` widget. `MapChartHandler.handleLeafletMap`
|
|
29607
|
-
* groups the records by the configured grouping property and resolves each
|
|
29608
|
-
* record's location property into `{ lat, lon }`; this component plots those
|
|
29609
|
-
* groups over the region's boundaries.
|
|
29610
|
-
*
|
|
29611
|
-
* The boundaries are GeoJSON bundled with the package and registered with
|
|
29612
|
-
* ECharts (`echarts.registerMap`) — the same approach the legacy
|
|
29613
|
-
* dashboardBuilder app used. Nothing is fetched at runtime, so the widget has
|
|
29614
|
-
* no API key, no third-party usage policy and no dependency on the browser
|
|
29615
|
-
* reaching a tile host; it renders identically offline.
|
|
29616
|
-
*
|
|
29617
|
-
* Registration has to happen before ECharts is handed an option naming the map,
|
|
29618
|
-
* so the option stays `null` until the GeoJSON is in the registry.
|
|
29619
|
-
*/
|
|
29620
|
-
/**
|
|
29621
|
-
* ECharts' map registry is global and registration is idempotent, so the names
|
|
29622
|
-
* already registered are tracked once per module rather than per component.
|
|
29623
|
-
*/
|
|
29624
|
-
const registeredRegions = new Set();
|
|
29625
29385
|
class MapViewComponent {
|
|
29626
|
-
/** Grouped records from `MapChartHandler.handleLeafletMap`. */
|
|
29627
29386
|
groups = input([], ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
29628
|
-
/** Persisted Style Studio map controls. */
|
|
29629
29387
|
config = input({}, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
29630
|
-
/** Hide the group legend when the widget's legend control is off. */
|
|
29631
29388
|
showLegend = input(true, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
29632
|
-
/** Where the widget's legend control puts the legend. */
|
|
29633
29389
|
legendPosition = input('bottom', ...(ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []));
|
|
29634
|
-
|
|
29635
|
-
legendIcon = input(undefined, ...(ngDevMode ? [{ debugName: "legendIcon" }] : /* istanbul ignore next */ []));
|
|
29636
|
-
/** Forwarded to `mt-echart` so it keys its chart instance per widget. */
|
|
29390
|
+
legendIcon = input(...(ngDevMode ? [undefined, { debugName: "legendIcon" }] : /* istanbul ignore next */ []));
|
|
29637
29391
|
dashboardId = input('', ...(ngDevMode ? [{ debugName: "dashboardId" }] : /* istanbul ignore next */ []));
|
|
29638
29392
|
configurationItem = input(null, ...(ngDevMode ? [{ debugName: "configurationItem" }] : /* istanbul ignore next */ []));
|
|
29639
29393
|
inGroup = input(false, ...(ngDevMode ? [{ debugName: "inGroup" }] : /* istanbul ignore next */ []));
|
|
29640
|
-
/** Emitted when a marker is clicked, for the widget's row actions. */
|
|
29641
29394
|
pointClick = output();
|
|
29642
|
-
/** Emitted when a marker is double-clicked. */
|
|
29643
29395
|
pointDblClick = output();
|
|
29644
|
-
|
|
29645
|
-
|
|
29646
|
-
|
|
29647
|
-
|
|
29648
|
-
|
|
29649
|
-
|
|
29650
|
-
|
|
29651
|
-
|
|
29652
|
-
|
|
29653
|
-
|
|
29654
|
-
|
|
29655
|
-
|
|
29656
|
-
|
|
29657
|
-
|
|
29658
|
-
|
|
29659
|
-
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29663
|
-
|
|
29664
|
-
|
|
29665
|
-
|
|
29666
|
-
|
|
29396
|
+
document = inject(DOCUMENT);
|
|
29397
|
+
destroyRef = inject(DestroyRef);
|
|
29398
|
+
zone = inject(NgZone);
|
|
29399
|
+
transloco = inject(TranslocoService);
|
|
29400
|
+
container = viewChild.required('map');
|
|
29401
|
+
language = toSignal(this.transloco.langChanges$);
|
|
29402
|
+
arabic = computed(() => this.language()?.split('-')[0] === 'ar' ||
|
|
29403
|
+
this.document.documentElement.dir === 'rtl', ...(ngDevMode ? [{ debugName: "arabic" }] : /* istanbul ignore next */ []));
|
|
29404
|
+
region = computed(() => resolveMapRegion(this.config().mapRegion), ...(ngDevMode ? [{ debugName: "region" }] : /* istanbul ignore next */ []));
|
|
29405
|
+
hiddenGroups = signal(new Set(), ...(ngDevMode ? [{ debugName: "hiddenGroups" }] : /* istanbul ignore next */ []));
|
|
29406
|
+
usableGroups = computed(() => plottableGroups(this.groups()), ...(ngDevMode ? [{ debugName: "usableGroups" }] : /* istanbul ignore next */ []));
|
|
29407
|
+
visiblePoints = computed(() => {
|
|
29408
|
+
const showLegend = this.showLegend();
|
|
29409
|
+
const hidden = this.hiddenGroups();
|
|
29410
|
+
return this.usableGroups().flatMap((group) => showLegend && hidden.has(group.groupName)
|
|
29411
|
+
? []
|
|
29412
|
+
: group.points.map((point) => ({ point, groupName: group.groupName })));
|
|
29413
|
+
}, ...(ngDevMode ? [{ debugName: "visiblePoints" }] : /* istanbul ignore next */ []));
|
|
29414
|
+
legendGroups = computed(() => this.usableGroups().filter((group) => group.groupName), ...(ngDevMode ? [{ debugName: "legendGroups" }] : /* istanbul ignore next */ []));
|
|
29415
|
+
noLocations = computed(() => this.usableGroups().length === 0, ...(ngDevMode ? [{ debugName: "noLocations" }] : /* istanbul ignore next */ []));
|
|
29416
|
+
status = signal('loading', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
29417
|
+
map;
|
|
29418
|
+
popup;
|
|
29419
|
+
observer;
|
|
29420
|
+
labels = [];
|
|
29421
|
+
nextPointId = 0;
|
|
29422
|
+
pointsById = new Map();
|
|
29423
|
+
fitPending = false;
|
|
29667
29424
|
constructor() {
|
|
29425
|
+
afterNextRender(() => this.zone.runOutsideAngular(() => void this.mountMap()));
|
|
29668
29426
|
effect(() => {
|
|
29427
|
+
if (this.status() !== 'ready')
|
|
29428
|
+
return;
|
|
29429
|
+
const points = this.visiblePoints();
|
|
29669
29430
|
const region = this.region();
|
|
29670
|
-
|
|
29431
|
+
this.zone.runOutsideAngular(() => this.updatePoints(points, region));
|
|
29432
|
+
});
|
|
29433
|
+
effect(() => {
|
|
29434
|
+
const arabic = this.arabic();
|
|
29435
|
+
if (this.status() !== 'ready')
|
|
29436
|
+
return;
|
|
29437
|
+
this.zone.runOutsideAngular(() => this.updateLabels(arabic));
|
|
29438
|
+
});
|
|
29439
|
+
this.destroyRef.onDestroy(() => {
|
|
29440
|
+
this.zone.runOutsideAngular(() => {
|
|
29441
|
+
this.observer?.disconnect();
|
|
29442
|
+
this.popup?.remove();
|
|
29443
|
+
this.map?.remove();
|
|
29444
|
+
this.map = undefined;
|
|
29445
|
+
});
|
|
29671
29446
|
});
|
|
29672
29447
|
}
|
|
29673
|
-
|
|
29674
|
-
|
|
29675
|
-
|
|
29676
|
-
|
|
29677
|
-
|
|
29678
|
-
|
|
29679
|
-
|
|
29680
|
-
|
|
29681
|
-
|
|
29682
|
-
|
|
29683
|
-
|
|
29448
|
+
isGroupVisible(name) {
|
|
29449
|
+
return !this.hiddenGroups().has(name);
|
|
29450
|
+
}
|
|
29451
|
+
toggleGroup(name) {
|
|
29452
|
+
this.hiddenGroups.update((hidden) => {
|
|
29453
|
+
const next = new Set(hidden);
|
|
29454
|
+
if (!next.delete(name))
|
|
29455
|
+
next.add(name);
|
|
29456
|
+
return next;
|
|
29457
|
+
});
|
|
29458
|
+
}
|
|
29459
|
+
async mountMap() {
|
|
29684
29460
|
try {
|
|
29685
|
-
const [
|
|
29686
|
-
|
|
29687
|
-
|
|
29461
|
+
const [mapLibre, vector, pin] = await Promise.all([
|
|
29462
|
+
loadMapLibre(),
|
|
29463
|
+
loadVectorStyle(),
|
|
29464
|
+
loadPinImage(),
|
|
29688
29465
|
]);
|
|
29689
|
-
|
|
29690
|
-
|
|
29691
|
-
this.
|
|
29466
|
+
if (this.destroyRef.destroyed)
|
|
29467
|
+
return;
|
|
29468
|
+
const container = this.container().nativeElement;
|
|
29469
|
+
let style = vector ?? RASTER_STYLE;
|
|
29470
|
+
this.labels = placeLabelLayers(style);
|
|
29471
|
+
const map = new mapLibre.Map({
|
|
29472
|
+
container,
|
|
29473
|
+
style,
|
|
29474
|
+
...this.region(),
|
|
29475
|
+
attributionControl: { compact: true },
|
|
29476
|
+
doubleClickZoom: false,
|
|
29477
|
+
dragRotate: false,
|
|
29478
|
+
trackResize: false,
|
|
29479
|
+
});
|
|
29480
|
+
this.map = map;
|
|
29481
|
+
map.addControl(new mapLibre.NavigationControl({ showCompass: false }), this.arabic() ? 'top-left' : 'top-right');
|
|
29482
|
+
map.on('style.load', () => {
|
|
29483
|
+
if (!map.hasImage(PIN_IMAGE)) {
|
|
29484
|
+
map.addImage(PIN_IMAGE, pin, { pixelRatio: PIN_RATIO });
|
|
29485
|
+
}
|
|
29486
|
+
if (!map.getSource(MAP_POINTS_SOURCE)) {
|
|
29487
|
+
map.addSource(MAP_POINTS_SOURCE, POINTS_SOURCE);
|
|
29488
|
+
const font = style.glyphs
|
|
29489
|
+
? ['Noto Sans Regular']
|
|
29490
|
+
: ['Arial', 'sans-serif'];
|
|
29491
|
+
for (const layer of pointLayers(font))
|
|
29492
|
+
map.addLayer(layer);
|
|
29493
|
+
}
|
|
29494
|
+
this.status.set('ready');
|
|
29495
|
+
});
|
|
29496
|
+
map.on('error', ({ error }) => {
|
|
29497
|
+
if (style === RASTER_STYLE || !isVectorBasemapError(error))
|
|
29498
|
+
return;
|
|
29499
|
+
style = RASTER_STYLE;
|
|
29500
|
+
this.labels = [];
|
|
29501
|
+
this.status.set('loading');
|
|
29502
|
+
this.popup?.remove();
|
|
29503
|
+
map.setStyle(style, { diff: false });
|
|
29504
|
+
});
|
|
29505
|
+
map.on('click', CLUSTERS_LAYER, (event) => void this.zoomToCluster(map, event));
|
|
29506
|
+
map.on('click', PINS_LAYER, (event) => this.openPoint(mapLibre, map, event));
|
|
29507
|
+
map.on('dblclick', PINS_LAYER, (event) => {
|
|
29508
|
+
const entry = this.pointAt(event);
|
|
29509
|
+
if (entry)
|
|
29510
|
+
this.zone.run(() => this.pointDblClick.emit(entry.point));
|
|
29511
|
+
});
|
|
29512
|
+
for (const layer of [CLUSTERS_LAYER, PINS_LAYER]) {
|
|
29513
|
+
map.on('mouseenter', layer, () => (map.getCanvas().style.cursor = 'pointer'));
|
|
29514
|
+
map.on('mouseleave', layer, () => (map.getCanvas().style.cursor = ''));
|
|
29515
|
+
}
|
|
29516
|
+
this.observer = new ResizeObserver(() => {
|
|
29517
|
+
if (!container.clientWidth || !container.clientHeight)
|
|
29518
|
+
return;
|
|
29519
|
+
map.resize();
|
|
29520
|
+
if (this.fitPending)
|
|
29521
|
+
this.fitPoints();
|
|
29522
|
+
});
|
|
29523
|
+
this.observer.observe(container);
|
|
29692
29524
|
}
|
|
29693
|
-
catch
|
|
29694
|
-
|
|
29525
|
+
catch {
|
|
29526
|
+
if (!this.destroyRef.destroyed)
|
|
29527
|
+
this.status.set('unavailable');
|
|
29695
29528
|
}
|
|
29696
29529
|
}
|
|
29697
|
-
|
|
29698
|
-
|
|
29699
|
-
|
|
29700
|
-
|
|
29701
|
-
onChartClick(event) {
|
|
29702
|
-
const point = this.toPoint(event?.data);
|
|
29703
|
-
if (point)
|
|
29704
|
-
this.pointClick.emit(point);
|
|
29530
|
+
updateLabels(arabic) {
|
|
29531
|
+
for (const layer of this.labels) {
|
|
29532
|
+
this.map?.setLayoutProperty(layer, 'text-field', placeName(arabic));
|
|
29533
|
+
}
|
|
29705
29534
|
}
|
|
29706
|
-
|
|
29707
|
-
const
|
|
29708
|
-
if (
|
|
29709
|
-
|
|
29535
|
+
updatePoints(points, region) {
|
|
29536
|
+
const source = this.map?.getSource(MAP_POINTS_SOURCE);
|
|
29537
|
+
if (!source)
|
|
29538
|
+
return;
|
|
29539
|
+
this.popup?.remove();
|
|
29540
|
+
this.pointsById.clear();
|
|
29541
|
+
const features = points.map((entry) => {
|
|
29542
|
+
const id = this.nextPointId++;
|
|
29543
|
+
this.pointsById.set(id, entry);
|
|
29544
|
+
return {
|
|
29545
|
+
type: 'Feature',
|
|
29546
|
+
geometry: {
|
|
29547
|
+
type: 'Point',
|
|
29548
|
+
coordinates: [entry.point.lon, entry.point.lat],
|
|
29549
|
+
},
|
|
29550
|
+
properties: { id },
|
|
29551
|
+
};
|
|
29552
|
+
});
|
|
29553
|
+
void source.setData({ type: 'FeatureCollection', features });
|
|
29554
|
+
if (points.length) {
|
|
29555
|
+
this.fitPoints();
|
|
29556
|
+
}
|
|
29557
|
+
else {
|
|
29558
|
+
this.fitPending = false;
|
|
29559
|
+
this.map?.jumpTo(region);
|
|
29560
|
+
}
|
|
29710
29561
|
}
|
|
29711
|
-
|
|
29712
|
-
|
|
29713
|
-
|
|
29714
|
-
|
|
29715
|
-
|
|
29716
|
-
|
|
29717
|
-
|
|
29718
|
-
|
|
29719
|
-
|
|
29720
|
-
|
|
29721
|
-
|
|
29562
|
+
fitPoints() {
|
|
29563
|
+
const map = this.map;
|
|
29564
|
+
if (!map)
|
|
29565
|
+
return;
|
|
29566
|
+
const container = map.getContainer();
|
|
29567
|
+
const size = Math.min(container.clientWidth, container.clientHeight);
|
|
29568
|
+
this.fitPending = size === 0;
|
|
29569
|
+
if (this.fitPending)
|
|
29570
|
+
return;
|
|
29571
|
+
const coordinates = Array.from(this.pointsById.values(), ({ point }) => [point.lon, point.lat]);
|
|
29572
|
+
if (coordinates.length === 1) {
|
|
29573
|
+
map.jumpTo({ center: coordinates[0], zoom: 15 });
|
|
29574
|
+
}
|
|
29575
|
+
else if (coordinates.length > 1) {
|
|
29576
|
+
const bounds = coordinates.reduce(([west, south, east, north], [lon, lat]) => [
|
|
29577
|
+
Math.min(west, lon),
|
|
29578
|
+
Math.min(south, lat),
|
|
29579
|
+
Math.max(east, lon),
|
|
29580
|
+
Math.max(north, lat),
|
|
29581
|
+
], [180, 90, -180, -90]);
|
|
29582
|
+
map.fitBounds(bounds, {
|
|
29583
|
+
padding: Math.min(48, size / 4),
|
|
29584
|
+
maxZoom: 15,
|
|
29585
|
+
duration: 0,
|
|
29586
|
+
});
|
|
29587
|
+
}
|
|
29588
|
+
}
|
|
29589
|
+
async zoomToCluster(map, event) {
|
|
29590
|
+
const feature = event.features?.[0];
|
|
29591
|
+
const source = map.getSource(MAP_POINTS_SOURCE);
|
|
29592
|
+
if (!source || feature?.geometry.type !== 'Point')
|
|
29593
|
+
return;
|
|
29594
|
+
try {
|
|
29595
|
+
const zoom = await source.getClusterExpansionZoom(feature.properties['cluster_id']);
|
|
29596
|
+
if (this.map !== map || map.getSource(MAP_POINTS_SOURCE) !== source)
|
|
29597
|
+
return;
|
|
29598
|
+
const [lon, lat] = feature.geometry.coordinates;
|
|
29599
|
+
map.easeTo({ center: [lon, lat], zoom });
|
|
29600
|
+
}
|
|
29601
|
+
catch {
|
|
29602
|
+
// A cluster can disappear while a new points input is being indexed.
|
|
29603
|
+
}
|
|
29604
|
+
}
|
|
29605
|
+
pointAt(event) {
|
|
29606
|
+
return this.pointsById.get(event.features?.[0]?.properties['id']);
|
|
29607
|
+
}
|
|
29608
|
+
openPoint(mapLibre, map, event) {
|
|
29609
|
+
const entry = this.pointAt(event);
|
|
29610
|
+
if (!entry)
|
|
29611
|
+
return;
|
|
29612
|
+
const { point, groupName } = entry;
|
|
29613
|
+
const content = this.document.createElement('div');
|
|
29614
|
+
content.dir = 'auto';
|
|
29615
|
+
const title = this.document.createElement('strong');
|
|
29616
|
+
title.textContent = point.displayName;
|
|
29617
|
+
content.append(title);
|
|
29618
|
+
const lines = pointTooltipLines(point.tooltip, (count) => this.arabic() ? `+${count} أخرى` : `+${count} more`);
|
|
29619
|
+
for (const text of [groupName, ...lines].filter(Boolean)) {
|
|
29620
|
+
const line = this.document.createElement('div');
|
|
29621
|
+
line.textContent = text;
|
|
29622
|
+
content.append(line);
|
|
29623
|
+
}
|
|
29624
|
+
this.popup?.remove();
|
|
29625
|
+
this.popup = new mapLibre.Popup({ offset: [0, -36], maxWidth: '260px' })
|
|
29626
|
+
.setLngLat([point.lon, point.lat])
|
|
29627
|
+
.setDOMContent(content)
|
|
29628
|
+
.addTo(map);
|
|
29629
|
+
this.zone.run(() => this.pointClick.emit(point));
|
|
29722
29630
|
}
|
|
29723
29631
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MapViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
29724
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MapViewComponent, isStandalone: true, selector: "mt-map-view", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendPosition: { classPropertyName: "legendPosition", publicName: "legendPosition", isSignal: true, isRequired: false, transformFunction: null }, legendIcon: { classPropertyName: "legendIcon", publicName: "legendIcon", isSignal: true, isRequired: false, transformFunction: null }, dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, configurationItem: { classPropertyName: "configurationItem", publicName: "configurationItem", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClick: "pointClick", pointDblClick: "pointDblClick" }, host: { classAttribute: "mt-map-view" }, ngImport: i0, template: "<div
|
|
29632
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: MapViewComponent, isStandalone: true, selector: "mt-map-view", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendPosition: { classPropertyName: "legendPosition", publicName: "legendPosition", isSignal: true, isRequired: false, transformFunction: null }, legendIcon: { classPropertyName: "legendIcon", publicName: "legendIcon", isSignal: true, isRequired: false, transformFunction: null }, dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: false, transformFunction: null }, configurationItem: { classPropertyName: "configurationItem", publicName: "configurationItem", isSignal: true, isRequired: false, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pointClick: "pointClick", pointDblClick: "pointDblClick" }, host: { classAttribute: "mt-map-view" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["map"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"map-layout\" [attr.data-legend-position]=\"legendPosition()\">\r\n <div class=\"map-surface\">\r\n <div\r\n #map\r\n class=\"map-canvas\"\r\n role=\"region\"\r\n [attr.aria-label]=\"'dashboardBuilder.map.title' | transloco\"\r\n ></div>\r\n @if (status() === \"loading\") {\r\n <span class=\"map-status\" role=\"status\">{{\r\n \"dashboardBuilder.map.loadingBoundaries\" | transloco\r\n }}</span>\r\n } @else if (status() === \"unavailable\") {\r\n <span class=\"map-status\" role=\"status\">{{\r\n \"dashboardBuilder.map.unavailable\" | transloco\r\n }}</span>\r\n } @else if (noLocations()) {\r\n <span class=\"map-status\">{{\r\n \"dashboardBuilder.map.noLocations\" | transloco\r\n }}</span>\r\n }\r\n </div>\r\n\r\n @if (showLegend() && legendGroups().length) {\r\n <div class=\"map-legend\">\r\n @for (group of legendGroups(); track $index) {\r\n <button\r\n type=\"button\"\r\n [attr.aria-pressed]=\"isGroupVisible(group.groupName)\"\r\n (click)=\"toggleGroup(group.groupName)\"\r\n >\r\n <span\r\n class=\"map-legend-marker\"\r\n aria-hidden=\"true\"\r\n [attr.data-shape]=\"legendIcon()\"\r\n [style.background-color]=\"group.color || '#1a73e8'\"\r\n ></span>\r\n {{ group.groupName }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.map-layout{display:flex;flex-direction:column;width:100%;height:100%}.map-layout[data-legend-position=top]{flex-direction:column-reverse}.map-layout[data-legend-position=left],.map-layout[data-legend-position=right]{flex-direction:row}.map-layout[data-legend-position=left] .map-legend{order:-1}.map-layout:dir(rtl)[data-legend-position=left],.map-layout:dir(rtl)[data-legend-position=right]{flex-direction:row-reverse}.map-surface{position:relative;flex:1;min-width:0;min-height:0;background:var(--p-surface-100, #f1f5f9)}@media(max-width:768px){.map-surface{min-height:14rem}}.map-canvas{position:absolute;inset:0}.map-status{position:absolute;inset-block-start:.5rem;inset-inline-start:50%;translate:-50% 0;max-width:60%;padding:.25rem .5rem;border-radius:.375rem;background:var(--p-surface-0, #fff);color:var(--p-text-muted-color, #475569);font-size:.75rem;text-align:center;pointer-events:none}.map-status:dir(rtl){translate:50% 0}.map-legend{display:flex;align-items:center;justify-content:safe center;max-height:35%;overflow:auto;padding:.125rem}.map-layout[data-legend-position=left] .map-legend,.map-layout[data-legend-position=right] .map-legend{flex-direction:column;align-items:flex-start;max-width:35%;max-height:100%}.map-legend button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem;border:0;background:transparent;color:inherit;font:inherit;font-size:.75rem;text-align:start;cursor:pointer}.map-legend button[aria-pressed=false]{opacity:.55;text-decoration:line-through}.map-legend-marker{flex:0 0 auto;width:.625rem;height:.625rem;border-radius:50%}.map-legend-marker[data-shape=rect],.map-legend-marker[data-shape=diamond],.map-legend-marker[data-shape=triangle]{border-radius:0}.map-legend-marker[data-shape=roundRect]{border-radius:.2rem}.map-legend-marker[data-shape=diamond]{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.map-legend-marker[data-shape=triangle]{clip-path:polygon(50% 0,100% 100%,0 100%)}\n"], dependencies: [{ kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29725
29633
|
}
|
|
29726
29634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: MapViewComponent, decorators: [{
|
|
29727
29635
|
type: Component,
|
|
29728
|
-
args: [{ selector: 'mt-map-view',
|
|
29729
|
-
}], ctorParameters: () => [], propDecorators: { groups: [{ type: i0.Input, args: [{ isSignal: true, alias: "groups", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendPosition", required: false }] }], legendIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendIcon", required: false }] }], dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], configurationItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurationItem", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], pointClick: [{ type: i0.Output, args: ["pointClick"] }], pointDblClick: [{ type: i0.Output, args: ["pointDblClick"] }] } });
|
|
29636
|
+
args: [{ selector: 'mt-map-view', imports: [TranslocoPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'mt-map-view' }, template: "<div class=\"map-layout\" [attr.data-legend-position]=\"legendPosition()\">\r\n <div class=\"map-surface\">\r\n <div\r\n #map\r\n class=\"map-canvas\"\r\n role=\"region\"\r\n [attr.aria-label]=\"'dashboardBuilder.map.title' | transloco\"\r\n ></div>\r\n @if (status() === \"loading\") {\r\n <span class=\"map-status\" role=\"status\">{{\r\n \"dashboardBuilder.map.loadingBoundaries\" | transloco\r\n }}</span>\r\n } @else if (status() === \"unavailable\") {\r\n <span class=\"map-status\" role=\"status\">{{\r\n \"dashboardBuilder.map.unavailable\" | transloco\r\n }}</span>\r\n } @else if (noLocations()) {\r\n <span class=\"map-status\">{{\r\n \"dashboardBuilder.map.noLocations\" | transloco\r\n }}</span>\r\n }\r\n </div>\r\n\r\n @if (showLegend() && legendGroups().length) {\r\n <div class=\"map-legend\">\r\n @for (group of legendGroups(); track $index) {\r\n <button\r\n type=\"button\"\r\n [attr.aria-pressed]=\"isGroupVisible(group.groupName)\"\r\n (click)=\"toggleGroup(group.groupName)\"\r\n >\r\n <span\r\n class=\"map-legend-marker\"\r\n aria-hidden=\"true\"\r\n [attr.data-shape]=\"legendIcon()\"\r\n [style.background-color]=\"group.color || '#1a73e8'\"\r\n ></span>\r\n {{ group.groupName }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%;min-height:0}.map-layout{display:flex;flex-direction:column;width:100%;height:100%}.map-layout[data-legend-position=top]{flex-direction:column-reverse}.map-layout[data-legend-position=left],.map-layout[data-legend-position=right]{flex-direction:row}.map-layout[data-legend-position=left] .map-legend{order:-1}.map-layout:dir(rtl)[data-legend-position=left],.map-layout:dir(rtl)[data-legend-position=right]{flex-direction:row-reverse}.map-surface{position:relative;flex:1;min-width:0;min-height:0;background:var(--p-surface-100, #f1f5f9)}@media(max-width:768px){.map-surface{min-height:14rem}}.map-canvas{position:absolute;inset:0}.map-status{position:absolute;inset-block-start:.5rem;inset-inline-start:50%;translate:-50% 0;max-width:60%;padding:.25rem .5rem;border-radius:.375rem;background:var(--p-surface-0, #fff);color:var(--p-text-muted-color, #475569);font-size:.75rem;text-align:center;pointer-events:none}.map-status:dir(rtl){translate:50% 0}.map-legend{display:flex;align-items:center;justify-content:safe center;max-height:35%;overflow:auto;padding:.125rem}.map-layout[data-legend-position=left] .map-legend,.map-layout[data-legend-position=right] .map-legend{flex-direction:column;align-items:flex-start;max-width:35%;max-height:100%}.map-legend button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem;border:0;background:transparent;color:inherit;font:inherit;font-size:.75rem;text-align:start;cursor:pointer}.map-legend button[aria-pressed=false]{opacity:.55;text-decoration:line-through}.map-legend-marker{flex:0 0 auto;width:.625rem;height:.625rem;border-radius:50%}.map-legend-marker[data-shape=rect],.map-legend-marker[data-shape=diamond],.map-legend-marker[data-shape=triangle]{border-radius:0}.map-legend-marker[data-shape=roundRect]{border-radius:.2rem}.map-legend-marker[data-shape=diamond]{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}.map-legend-marker[data-shape=triangle]{clip-path:polygon(50% 0,100% 100%,0 100%)}\n"] }]
|
|
29637
|
+
}], ctorParameters: () => [], propDecorators: { groups: [{ type: i0.Input, args: [{ isSignal: true, alias: "groups", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendPosition", required: false }] }], legendIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendIcon", required: false }] }], dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: false }] }], configurationItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurationItem", required: false }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], pointClick: [{ type: i0.Output, args: ["pointClick"] }], pointDblClick: [{ type: i0.Output, args: ["pointDblClick"] }], container: [{ type: i0.ViewChild, args: ['map', { isSignal: true }] }] } });
|
|
29730
29638
|
|
|
29731
29639
|
/** How long a click waits for a second one when Double Click is configured. */
|
|
29732
29640
|
const DOUBLE_CLICK_WINDOW_MS = 250;
|
|
@@ -29906,9 +29814,8 @@ class ChartCardComponent {
|
|
|
29906
29814
|
}, ...(ngDevMode ? [{ debugName: "componentViewMode" }] : /* istanbul ignore next */ []));
|
|
29907
29815
|
/* ---------- Map view helpers ---------- */
|
|
29908
29816
|
/**
|
|
29909
|
-
* `MapChartHandler.handleLeafletMap` returns
|
|
29910
|
-
*
|
|
29911
|
-
* widget is rendered by `mt-map-view` instead of `mt-echart`.
|
|
29817
|
+
* `MapChartHandler.handleLeafletMap` returns the grouped records consumed
|
|
29818
|
+
* by `mt-map-view`.
|
|
29912
29819
|
*/
|
|
29913
29820
|
mapGroups = computed(() => {
|
|
29914
29821
|
const data = this.dataHandled();
|
|
@@ -30858,1728 +30765,6 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ng
|
|
|
30858
30765
|
], 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
30766
|
}], 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
30767
|
|
|
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
30768
|
/**
|
|
32584
30769
|
* Statistic Card Component
|
|
32585
30770
|
*
|
|
@@ -32860,11 +31045,11 @@ class ListStatisticCardComponent {
|
|
|
32860
31045
|
this.onAction.emit({ type, data: body });
|
|
32861
31046
|
}
|
|
32862
31047
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ListStatisticCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32863
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: ListStatisticCardComponent, isStandalone: true, selector: "mt-list-statistic-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"flex h-full w-full justify-between\">\n <mt-statistic-card\n [config]=\"dataHandled()\"\n [style.width]=\"dataHandled()?.width\"\n [styleConfig]=\"styleConfig()\"\n [configurationItem]=\"configurationItem()\"\n (cardClick)=\"doActions($event, 'click')\"\n />\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: StatisticCardComponent, selector: "mt-statistic-card", inputs: ["config", "styleConfig", "configurationItem"], outputs: ["cardClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
31048
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: ListStatisticCardComponent, isStandalone: true, selector: "mt-list-statistic-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<div class=\"flex h-full w-full justify-between\">\r\n <mt-statistic-card\r\n [config]=\"dataHandled()\"\r\n [style.width]=\"dataHandled()?.width\"\r\n [styleConfig]=\"styleConfig()\"\r\n [configurationItem]=\"configurationItem()\"\r\n (cardClick)=\"doActions($event, 'click')\"\r\n />\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: StatisticCardComponent, selector: "mt-statistic-card", inputs: ["config", "styleConfig", "configurationItem"], outputs: ["cardClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32864
31049
|
}
|
|
32865
31050
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ListStatisticCardComponent, decorators: [{
|
|
32866
31051
|
type: Component,
|
|
32867
|
-
args: [{ selector: 'mt-list-statistic-card', standalone: true, imports: [CommonModule, StatisticCardComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex h-full w-full justify-between\">\n <mt-statistic-card\n [config]=\"dataHandled()\"\n [style.width]=\"dataHandled()?.width\"\n [styleConfig]=\"styleConfig()\"\n [configurationItem]=\"configurationItem()\"\n (cardClick)=\"doActions($event, 'click')\"\n />\n</div>\n" }]
|
|
31052
|
+
args: [{ selector: 'mt-list-statistic-card', standalone: true, imports: [CommonModule, StatisticCardComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex h-full w-full justify-between\">\r\n <mt-statistic-card\r\n [config]=\"dataHandled()\"\r\n [style.width]=\"dataHandled()?.width\"\r\n [styleConfig]=\"styleConfig()\"\r\n [configurationItem]=\"configurationItem()\"\r\n (cardClick)=\"doActions($event, 'click')\"\r\n />\r\n</div>\r\n" }]
|
|
32868
31053
|
}], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], onAction: [{ type: i0.Output, args: ["onAction"] }] } });
|
|
32869
31054
|
|
|
32870
31055
|
/**
|
|
@@ -33256,34 +31441,34 @@ class SkeletonCardComponent {
|
|
|
33256
31441
|
}
|
|
33257
31442
|
}
|
|
33258
31443
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SkeletonCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
33259
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SkeletonCardComponent, isStandalone: true, selector: "mt-skeleton-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
33260
|
-
<div class="skeleton-container">
|
|
33261
|
-
@for (skeleton of skeletons(); track $index) {
|
|
33262
|
-
<div
|
|
33263
|
-
class="skeleton-item"
|
|
33264
|
-
[style.width]="skeleton.width"
|
|
33265
|
-
[style.height]="skeleton.height"
|
|
33266
|
-
>
|
|
33267
|
-
<div class="skeleton-animation"></div>
|
|
33268
|
-
</div>
|
|
33269
|
-
}
|
|
33270
|
-
</div>
|
|
31444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SkeletonCardComponent, isStandalone: true, selector: "mt-skeleton-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
31445
|
+
<div class="skeleton-container">
|
|
31446
|
+
@for (skeleton of skeletons(); track $index) {
|
|
31447
|
+
<div
|
|
31448
|
+
class="skeleton-item"
|
|
31449
|
+
[style.width]="skeleton.width"
|
|
31450
|
+
[style.height]="skeleton.height"
|
|
31451
|
+
>
|
|
31452
|
+
<div class="skeleton-animation"></div>
|
|
31453
|
+
</div>
|
|
31454
|
+
}
|
|
31455
|
+
</div>
|
|
33271
31456
|
`, isInline: true, styles: [".skeleton-container{display:flex;flex-wrap:wrap;gap:1rem;width:100%;padding:1rem}.skeleton-item{background:#f5f5f5;border-radius:.5rem;overflow:hidden;position:relative}.skeleton-animation{position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:shimmer 1.5s infinite}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
33272
31457
|
}
|
|
33273
31458
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SkeletonCardComponent, decorators: [{
|
|
33274
31459
|
type: Component,
|
|
33275
|
-
args: [{ selector: 'mt-skeleton-card', standalone: true, imports: [CommonModule], template: `
|
|
33276
|
-
<div class="skeleton-container">
|
|
33277
|
-
@for (skeleton of skeletons(); track $index) {
|
|
33278
|
-
<div
|
|
33279
|
-
class="skeleton-item"
|
|
33280
|
-
[style.width]="skeleton.width"
|
|
33281
|
-
[style.height]="skeleton.height"
|
|
33282
|
-
>
|
|
33283
|
-
<div class="skeleton-animation"></div>
|
|
33284
|
-
</div>
|
|
33285
|
-
}
|
|
33286
|
-
</div>
|
|
31460
|
+
args: [{ selector: 'mt-skeleton-card', standalone: true, imports: [CommonModule], template: `
|
|
31461
|
+
<div class="skeleton-container">
|
|
31462
|
+
@for (skeleton of skeletons(); track $index) {
|
|
31463
|
+
<div
|
|
31464
|
+
class="skeleton-item"
|
|
31465
|
+
[style.width]="skeleton.width"
|
|
31466
|
+
[style.height]="skeleton.height"
|
|
31467
|
+
>
|
|
31468
|
+
<div class="skeleton-animation"></div>
|
|
31469
|
+
</div>
|
|
31470
|
+
}
|
|
31471
|
+
</div>
|
|
33287
31472
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".skeleton-container{display:flex;flex-wrap:wrap;gap:1rem;width:100%;padding:1rem}.skeleton-item{background:#f5f5f5;border-radius:.5rem;overflow:hidden;position:relative}.skeleton-animation{position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);animation:shimmer 1.5s infinite}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}\n"] }]
|
|
33288
31473
|
}], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }] } });
|
|
33289
31474
|
|
|
@@ -33957,7 +32142,7 @@ class PropertiesCardComponent {
|
|
|
33957
32142
|
return '';
|
|
33958
32143
|
}
|
|
33959
32144
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PropertiesCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
33960
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PropertiesCardComponent, isStandalone: true, selector: "mt-properties-card, mt-entities-preview-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<mt-card-content\n [inGroup]=\"inGroup()\"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [density]=\"configurationItem()?.clientConfig?.configAsType?.['density']\"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n [title]=\"title()\"\n>\n <ng-container body>\n <ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n @if (showTabs()) {\n <div class=\"mb-3\">\n <mt-tabs\n [(active)]=\"tabSelected\"\n [options]=\"tabOptions()\"\n size=\"small\"\n />\n </div>\n }\n\n <div\n class=\"overflow-y-auto overflow-x-hidden\"\n [style.max-height]=\"inGroup() ? '500px' : null\"\n >\n @if (currentTabCards().length === 0) {\n <div class=\"py-6 text-center text-sm text-gray-400\">\n {{ t(\"noData\") }}\n </div>\n } @else {\n <div\n class=\"db-cards-grid\"\n [class.db-cards-grid--gallery]=\"galleryMode()\"\n >\n @for (cardView of currentTabCards(); track cardView.trackId) {\n <div\n class=\"mb-2 cursor-pointer p-2\"\n (click)=\"onCardClick(cardView.card)\"\n >\n <div class=\"rounded-lg bg-white p-3 shadow-sm\">\n @defer (on viewport) {\n <ng-container>\n @if (cardView.entities.length > 0) {\n <mt-entities-preview\n [entities]=\"cardView.entities\"\n [stackOnNarrow]=\"false\"\n />\n } @else {\n <div class=\"py-6 text-center text-sm text-gray-400\">\n {{ t(\"noData\") }}\n </div>\n }\n </ng-container>\n } @placeholder {\n <div class=\"min-h-24 p-2\">\n <div class=\"flex animate-pulse flex-col gap-3\">\n <div class=\"h-4 w-2/3 rounded bg-surface-200\"></div>\n <div class=\"h-4 w-full rounded bg-surface-100\"></div>\n <div class=\"h-4 w-5/6 rounded bg-surface-100\"></div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n </ng-container>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.db-cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:.25rem}.db-cards-grid--gallery{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [EntitiesPreview]] });
|
|
32145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: PropertiesCardComponent, isStandalone: true, selector: "mt-properties-card, mt-entities-preview-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<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>\r\n <ng-container body>\r\n <ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n @if (showTabs()) {\r\n <div class=\"mb-3\">\r\n <mt-tabs\r\n [(active)]=\"tabSelected\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n />\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"overflow-y-auto overflow-x-hidden\"\r\n [style.max-height]=\"inGroup() ? '500px' : null\"\r\n >\r\n @if (currentTabCards().length === 0) {\r\n <div class=\"py-6 text-center text-sm text-gray-400\">\r\n {{ t(\"noData\") }}\r\n </div>\r\n } @else {\r\n <div\r\n class=\"db-cards-grid\"\r\n [class.db-cards-grid--gallery]=\"galleryMode()\"\r\n >\r\n @for (cardView of currentTabCards(); track cardView.trackId) {\r\n <div\r\n class=\"mb-2 cursor-pointer p-2\"\r\n (click)=\"onCardClick(cardView.card)\"\r\n >\r\n <div class=\"rounded-lg bg-white p-3 shadow-sm\">\r\n @defer (on viewport) {\r\n <ng-container>\r\n @if (cardView.entities.length > 0) {\r\n <mt-entities-preview\r\n [entities]=\"cardView.entities\"\r\n [stackOnNarrow]=\"false\"\r\n />\r\n } @else {\r\n <div class=\"py-6 text-center text-sm text-gray-400\">\r\n {{ t(\"noData\") }}\r\n </div>\r\n }\r\n </ng-container>\r\n } @placeholder {\r\n <div class=\"min-h-24 p-2\">\r\n <div class=\"flex animate-pulse flex-col gap-3\">\r\n <div class=\"h-4 w-2/3 rounded bg-surface-200\"></div>\r\n <div class=\"h-4 w-full rounded bg-surface-100\"></div>\r\n <div class=\"h-4 w-5/6 rounded bg-surface-100\"></div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.db-cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:.25rem}.db-cards-grid--gallery{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [EntitiesPreview]] });
|
|
33961
32146
|
}
|
|
33962
32147
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: PropertiesCardComponent, decorators: [{
|
|
33963
32148
|
type: Component,
|
|
@@ -33967,7 +32152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
33967
32152
|
Tabs,
|
|
33968
32153
|
EntitiesPreview,
|
|
33969
32154
|
CardContentComponent,
|
|
33970
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-card-content\n [inGroup]=\"inGroup()\"\n [headerConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\n \"\n [styleConfig]=\"\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\n \"\n [cardStyleConfig]=\"\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\n \"\n [density]=\"configurationItem()?.clientConfig?.configAsType?.['density']\"\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\n [title]=\"title()\"\n>\n <ng-container body>\n <ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n @if (showTabs()) {\n <div class=\"mb-3\">\n <mt-tabs\n [(active)]=\"tabSelected\"\n [options]=\"tabOptions()\"\n size=\"small\"\n />\n </div>\n }\n\n <div\n class=\"overflow-y-auto overflow-x-hidden\"\n [style.max-height]=\"inGroup() ? '500px' : null\"\n >\n @if (currentTabCards().length === 0) {\n <div class=\"py-6 text-center text-sm text-gray-400\">\n {{ t(\"noData\") }}\n </div>\n } @else {\n <div\n class=\"db-cards-grid\"\n [class.db-cards-grid--gallery]=\"galleryMode()\"\n >\n @for (cardView of currentTabCards(); track cardView.trackId) {\n <div\n class=\"mb-2 cursor-pointer p-2\"\n (click)=\"onCardClick(cardView.card)\"\n >\n <div class=\"rounded-lg bg-white p-3 shadow-sm\">\n @defer (on viewport) {\n <ng-container>\n @if (cardView.entities.length > 0) {\n <mt-entities-preview\n [entities]=\"cardView.entities\"\n [stackOnNarrow]=\"false\"\n />\n } @else {\n <div class=\"py-6 text-center text-sm text-gray-400\">\n {{ t(\"noData\") }}\n </div>\n }\n </ng-container>\n } @placeholder {\n <div class=\"min-h-24 p-2\">\n <div class=\"flex animate-pulse flex-col gap-3\">\n <div class=\"h-4 w-2/3 rounded bg-surface-200\"></div>\n <div class=\"h-4 w-full rounded bg-surface-100\"></div>\n <div class=\"h-4 w-5/6 rounded bg-surface-100\"></div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n </div>\n </ng-container>\n </ng-container>\n</mt-card-content>\n", styles: [":host{display:block;height:100%}.db-cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:.25rem}.db-cards-grid--gallery{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}\n"] }]
|
|
32155
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<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>\r\n <ng-container body>\r\n <ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n @if (showTabs()) {\r\n <div class=\"mb-3\">\r\n <mt-tabs\r\n [(active)]=\"tabSelected\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n />\r\n </div>\r\n }\r\n\r\n <div\r\n class=\"overflow-y-auto overflow-x-hidden\"\r\n [style.max-height]=\"inGroup() ? '500px' : null\"\r\n >\r\n @if (currentTabCards().length === 0) {\r\n <div class=\"py-6 text-center text-sm text-gray-400\">\r\n {{ t(\"noData\") }}\r\n </div>\r\n } @else {\r\n <div\r\n class=\"db-cards-grid\"\r\n [class.db-cards-grid--gallery]=\"galleryMode()\"\r\n >\r\n @for (cardView of currentTabCards(); track cardView.trackId) {\r\n <div\r\n class=\"mb-2 cursor-pointer p-2\"\r\n (click)=\"onCardClick(cardView.card)\"\r\n >\r\n <div class=\"rounded-lg bg-white p-3 shadow-sm\">\r\n @defer (on viewport) {\r\n <ng-container>\r\n @if (cardView.entities.length > 0) {\r\n <mt-entities-preview\r\n [entities]=\"cardView.entities\"\r\n [stackOnNarrow]=\"false\"\r\n />\r\n } @else {\r\n <div class=\"py-6 text-center text-sm text-gray-400\">\r\n {{ t(\"noData\") }}\r\n </div>\r\n }\r\n </ng-container>\r\n } @placeholder {\r\n <div class=\"min-h-24 p-2\">\r\n <div class=\"flex animate-pulse flex-col gap-3\">\r\n <div class=\"h-4 w-2/3 rounded bg-surface-200\"></div>\r\n <div class=\"h-4 w-full rounded bg-surface-100\"></div>\r\n <div class=\"h-4 w-5/6 rounded bg-surface-100\"></div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.db-cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:.25rem}.db-cards-grid--gallery{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}\n"] }]
|
|
33971
32156
|
}], ctorParameters: () => [], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }] } });
|
|
33972
32157
|
|
|
33973
32158
|
/**
|
|
@@ -35515,26 +33700,26 @@ class DashboardItem {
|
|
|
35515
33700
|
return merged;
|
|
35516
33701
|
}
|
|
35517
33702
|
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 });
|
|
33703
|
+
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-CKAm_KXn.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs').then(m => m.TableCardComponent)], () => [import('./masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs').then(m => m.TableCardComponent)]] });
|
|
35519
33704
|
}
|
|
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
|
-
|
|
33705
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.2.8", ngImport: i0, type: DashboardItem, resolveDeferredDeps: () => [import('./masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs').then(m => m.TableCardComponent)], resolveMetadata: TableCardComponent => ({ decorators: [{
|
|
33706
|
+
type: Component,
|
|
33707
|
+
args: [{ selector: 'mt-dashboard-item', standalone: true, imports: [
|
|
33708
|
+
CommonModule,
|
|
33709
|
+
TranslocoDirective,
|
|
33710
|
+
Button,
|
|
33711
|
+
Icon,
|
|
33712
|
+
ChartCardComponent,
|
|
33713
|
+
TableCardComponent,
|
|
33714
|
+
ListStatisticCardComponent,
|
|
33715
|
+
HeaderCardComponent,
|
|
33716
|
+
TopbarCardComponent,
|
|
33717
|
+
SkeletonCardComponent,
|
|
33718
|
+
PropertiesCardComponent,
|
|
33719
|
+
EntityPreviewCardComponent,
|
|
33720
|
+
LastHistoryLevelCardComponent,
|
|
33721
|
+
], 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"] }]
|
|
33722
|
+
}], 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
33723
|
|
|
35539
33724
|
/**
|
|
35540
33725
|
* Chart Viewer Component
|
|
@@ -37869,7 +36054,7 @@ class StyleStudioDrawer {
|
|
|
37869
36054
|
return out === full ? fallback : out;
|
|
37870
36055
|
}
|
|
37871
36056
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
37872
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleStudioDrawer, isStandalone: true, selector: "mt-style-studio-drawer", viewQueries: [{ propertyName: "scrollPane", first: true, predicate: ["scrollPane"], descendants: true, isSignal: true }, { propertyName: "previewViewer", first: true, predicate: ChartViewer, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"modal.contentClass + ' db-style-studio flex h-full min-h-0 flex-col'\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <!-- Header -->\n <div\n class=\"flex flex-wrap items-center gap-3 border-b border-surface-200 bg-surface-0 px-4 py-3\"\n >\n <span\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"chartIcon()\" class=\"text-lg\" />\n </span>\n <div class=\"mr-auto min-w-0\">\n <h3 class=\"truncate text-sm font-semibold text-color\">\n {{ t(\"styleStudio.title\") }}\n </h3>\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\n {{ chartName() }}\n </p>\n </div>\n\n <mt-segmented-field\n [options]=\"scopeOptions()\"\n [value]=\"scope()\"\n [ariaLabel]=\"t('styleStudio.detailLevel')\"\n (valueChange)=\"onScopeChange($event)\"\n />\n\n <mt-text-field\n class=\"w-56 self-center\"\n icon=\"general.search-md\"\n iconPosition=\"start\"\n [placeholder]=\"t('styleStudio.findSetting')\"\n [field]=\"false\"\n [formControl]=\"searchControl\"\n />\n </div>\n\n <!-- Body -->\n <div class=\"flex min-h-0 flex-1\">\n <!-- Left rail (sections grouped under category headers) -->\n <nav\n class=\"db-style-studio__rail hidden w-52 shrink-0 flex-col gap-1 overflow-y-auto border-r border-surface-200 bg-surface-50 p-2 md:flex\"\n >\n @for (group of navGroups(); track group.label) {\n <div class=\"mt-2 first:mt-0\">\n <p\n class=\"px-3 pb-1 pt-1 text-[0.65rem] font-semibold uppercase tracking-wider text-muted-color\"\n >\n {{ group.label }}\n </p>\n @for (section of group.sections; track section.key) {\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-sm font-medium transition-colors duration-200\"\n [class.bg-surface-0]=\"activeSection() === section.key\"\n [class.text-primary-600]=\"activeSection() === section.key\"\n [class.shadow-sm]=\"activeSection() === section.key\"\n [class.text-muted-color]=\"activeSection() !== section.key\"\n [class.hover:bg-surface-100]=\"activeSection() !== section.key\"\n (click)=\"scrollTo(section)\"\n >\n <mt-icon [icon]=\"section.icon\" class=\"text-base\" />\n <span class=\"truncate\" mtTruncateTooltip>{{\n section.label\n }}</span>\n </button>\n }\n </div>\n }\n </nav>\n\n <!-- Settings pane -->\n <div\n #scrollPane\n class=\"min-w-0 flex-1 overflow-y-auto p-4\"\n (scroll)=\"onScroll()\"\n >\n <mt-style-settings-renderer\n [visibleSections]=\"navSections()\"\n [persisted]=\"itemConfig()\"\n [capability]=\"capability()\"\n [scope]=\"scope()\"\n [legendItems]=\"legendItems()\"\n (patch)=\"onPatch($event)\"\n (requestScope)=\"scope.set($event)\"\n />\n </div>\n\n <!-- Resizable splitter (config \u2194 preview) -->\n <div\n class=\"db-style-studio__splitter hidden w-1.5 shrink-0 cursor-col-resize touch-none bg-surface-200 transition-colors hover:bg-primary-400 lg:block\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\n (pointerdown)=\"startResize($event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"endResize()\"\n (pointercancel)=\"endResize()\"\n ></div>\n\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\n <div\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\n [style.width.px]=\"previewWidth()\"\n >\n <div\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\n >\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\n </div>\n <div class=\"min-h-0 flex-1 overflow-auto\">\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\n not a card header \u2014 is what the \"Dialog header\" section edits.\n Both wrappers collapse to `contents` for every other widget, so\n the ordinary preview layout is untouched. -->\n <div [class]=\"previewFrameClass()\">\n @if (isDialogPreview()) {\n <div\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\n >\n @if (dialogHeaderPreview().icon) {\n <mt-icon\n [icon]=\"$any(dialogHeaderPreview().icon)\"\n class=\"shrink-0 text-lg\"\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\n />\n }\n <span\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\n mtTruncateTooltip\n >{{\n dialogHeaderPreview().title ||\n t(\"styleStudio.messages.untitledDialog\")\n }}</span\n >\n <span\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\n </span>\n </div>\n }\n <div [class]=\"previewBodyClass()\">\n <mt-chart-viewer\n [config]=\"previewConfig()\"\n [chartTypeId]=\"previewChartTypeId()\"\n [hideHeader]=\"isDialogPreview()\"\n [useCachedDataOnly]=\"true\"\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\n<div\n [class]=\"\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\n \"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <mt-button\n [label]=\"t('styleStudio.resetAll')\"\n icon=\"arrow.refresh-ccw-01\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"mr-auto\"\n (onClick)=\"resetAll()\"\n />\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\n</div>\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: StyleSettingsRenderer, selector: "mt-style-settings-renderer", inputs: ["visibleSections", "persisted", "capability", "scope", "legendItems"], outputs: ["patch", "requestScope"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ChartViewer, selector: "mt-chart-viewer", inputs: ["config", "chartTypeId", "hideHeader", "useCachedDataOnly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
36057
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleStudioDrawer, isStandalone: true, selector: "mt-style-studio-drawer", viewQueries: [{ propertyName: "scrollPane", first: true, predicate: ["scrollPane"], descendants: true, isSignal: true }, { propertyName: "previewViewer", first: true, predicate: ChartViewer, descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"modal.contentClass + ' db-style-studio flex h-full min-h-0 flex-col'\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <!-- Header -->\r\n <div\r\n class=\"flex flex-wrap items-center gap-3 border-b border-surface-200 bg-surface-0 px-4 py-3\"\r\n >\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"chartIcon()\" class=\"text-lg\" />\r\n </span>\r\n <div class=\"mr-auto min-w-0\">\r\n <h3 class=\"truncate text-sm font-semibold text-color\">\r\n {{ t(\"styleStudio.title\") }}\r\n </h3>\r\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\r\n {{ chartName() }}\r\n </p>\r\n </div>\r\n\r\n <mt-segmented-field\r\n [options]=\"scopeOptions()\"\r\n [value]=\"scope()\"\r\n [ariaLabel]=\"t('styleStudio.detailLevel')\"\r\n (valueChange)=\"onScopeChange($event)\"\r\n />\r\n\r\n <mt-text-field\r\n class=\"w-56 self-center\"\r\n icon=\"general.search-md\"\r\n iconPosition=\"start\"\r\n [placeholder]=\"t('styleStudio.findSetting')\"\r\n [field]=\"false\"\r\n [formControl]=\"searchControl\"\r\n />\r\n </div>\r\n\r\n <!-- Body -->\r\n <div class=\"flex min-h-0 flex-1\">\r\n <!-- Left rail (sections grouped under category headers) -->\r\n <nav\r\n class=\"db-style-studio__rail hidden w-52 shrink-0 flex-col gap-1 overflow-y-auto border-r border-surface-200 bg-surface-50 p-2 md:flex\"\r\n >\r\n @for (group of navGroups(); track group.label) {\r\n <div class=\"mt-2 first:mt-0\">\r\n <p\r\n class=\"px-3 pb-1 pt-1 text-[0.65rem] font-semibold uppercase tracking-wider text-muted-color\"\r\n >\r\n {{ group.label }}\r\n </p>\r\n @for (section of group.sections; track section.key) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-sm font-medium transition-colors duration-200\"\r\n [class.bg-surface-0]=\"activeSection() === section.key\"\r\n [class.text-primary-600]=\"activeSection() === section.key\"\r\n [class.shadow-sm]=\"activeSection() === section.key\"\r\n [class.text-muted-color]=\"activeSection() !== section.key\"\r\n [class.hover:bg-surface-100]=\"activeSection() !== section.key\"\r\n (click)=\"scrollTo(section)\"\r\n >\r\n <mt-icon [icon]=\"section.icon\" class=\"text-base\" />\r\n <span class=\"truncate\" mtTruncateTooltip>{{\r\n section.label\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </nav>\r\n\r\n <!-- Settings pane -->\r\n <div\r\n #scrollPane\r\n class=\"min-w-0 flex-1 overflow-y-auto p-4\"\r\n (scroll)=\"onScroll()\"\r\n >\r\n <mt-style-settings-renderer\r\n [visibleSections]=\"navSections()\"\r\n [persisted]=\"itemConfig()\"\r\n [capability]=\"capability()\"\r\n [scope]=\"scope()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n (requestScope)=\"scope.set($event)\"\r\n />\r\n </div>\r\n\r\n <!-- Resizable splitter (config \u2194 preview) -->\r\n <div\r\n class=\"db-style-studio__splitter hidden w-1.5 shrink-0 cursor-col-resize touch-none bg-surface-200 transition-colors hover:bg-primary-400 lg:block\"\r\n role=\"separator\"\r\n aria-orientation=\"vertical\"\r\n [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\r\n not a card header \u2014 is what the \"Dialog header\" section edits.\r\n Both wrappers collapse to `contents` for every other widget, so\r\n the ordinary preview layout is untouched. -->\r\n <div [class]=\"previewFrameClass()\">\r\n @if (isDialogPreview()) {\r\n <div\r\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\r\n >\r\n @if (dialogHeaderPreview().icon) {\r\n <mt-icon\r\n [icon]=\"$any(dialogHeaderPreview().icon)\"\r\n class=\"shrink-0 text-lg\"\r\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\r\n mtTruncateTooltip\r\n >{{\r\n dialogHeaderPreview().title ||\r\n t(\"styleStudio.messages.untitledDialog\")\r\n }}</span\r\n >\r\n <span\r\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\r\n </span>\r\n </div>\r\n }\r\n <div [class]=\"previewBodyClass()\">\r\n <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n [hideHeader]=\"isDialogPreview()\"\r\n [useCachedDataOnly]=\"true\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\r\n<div\r\n [class]=\"\r\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\r\n \"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <mt-button\r\n [label]=\"t('styleStudio.resetAll')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n class=\"mr-auto\"\r\n (onClick)=\"resetAll()\"\r\n />\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: StyleSettingsRenderer, selector: "mt-style-settings-renderer", inputs: ["visibleSections", "persisted", "capability", "scope", "legendItems"], outputs: ["patch", "requestScope"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ChartViewer, selector: "mt-chart-viewer", inputs: ["config", "chartTypeId", "hideHeader", "useCachedDataOnly"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
37873
36058
|
}
|
|
37874
36059
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, decorators: [{
|
|
37875
36060
|
type: Component,
|
|
@@ -37884,7 +36069,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
37884
36069
|
StyleSettingsRenderer,
|
|
37885
36070
|
SegmentedField,
|
|
37886
36071
|
ChartViewer,
|
|
37887
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n [class]=\"modal.contentClass + ' db-style-studio flex h-full min-h-0 flex-col'\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <!-- Header -->\n <div\n class=\"flex flex-wrap items-center gap-3 border-b border-surface-200 bg-surface-0 px-4 py-3\"\n >\n <span\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"chartIcon()\" class=\"text-lg\" />\n </span>\n <div class=\"mr-auto min-w-0\">\n <h3 class=\"truncate text-sm font-semibold text-color\">\n {{ t(\"styleStudio.title\") }}\n </h3>\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\n {{ chartName() }}\n </p>\n </div>\n\n <mt-segmented-field\n [options]=\"scopeOptions()\"\n [value]=\"scope()\"\n [ariaLabel]=\"t('styleStudio.detailLevel')\"\n (valueChange)=\"onScopeChange($event)\"\n />\n\n <mt-text-field\n class=\"w-56 self-center\"\n icon=\"general.search-md\"\n iconPosition=\"start\"\n [placeholder]=\"t('styleStudio.findSetting')\"\n [field]=\"false\"\n [formControl]=\"searchControl\"\n />\n </div>\n\n <!-- Body -->\n <div class=\"flex min-h-0 flex-1\">\n <!-- Left rail (sections grouped under category headers) -->\n <nav\n class=\"db-style-studio__rail hidden w-52 shrink-0 flex-col gap-1 overflow-y-auto border-r border-surface-200 bg-surface-50 p-2 md:flex\"\n >\n @for (group of navGroups(); track group.label) {\n <div class=\"mt-2 first:mt-0\">\n <p\n class=\"px-3 pb-1 pt-1 text-[0.65rem] font-semibold uppercase tracking-wider text-muted-color\"\n >\n {{ group.label }}\n </p>\n @for (section of group.sections; track section.key) {\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-sm font-medium transition-colors duration-200\"\n [class.bg-surface-0]=\"activeSection() === section.key\"\n [class.text-primary-600]=\"activeSection() === section.key\"\n [class.shadow-sm]=\"activeSection() === section.key\"\n [class.text-muted-color]=\"activeSection() !== section.key\"\n [class.hover:bg-surface-100]=\"activeSection() !== section.key\"\n (click)=\"scrollTo(section)\"\n >\n <mt-icon [icon]=\"section.icon\" class=\"text-base\" />\n <span class=\"truncate\" mtTruncateTooltip>{{\n section.label\n }}</span>\n </button>\n }\n </div>\n }\n </nav>\n\n <!-- Settings pane -->\n <div\n #scrollPane\n class=\"min-w-0 flex-1 overflow-y-auto p-4\"\n (scroll)=\"onScroll()\"\n >\n <mt-style-settings-renderer\n [visibleSections]=\"navSections()\"\n [persisted]=\"itemConfig()\"\n [capability]=\"capability()\"\n [scope]=\"scope()\"\n [legendItems]=\"legendItems()\"\n (patch)=\"onPatch($event)\"\n (requestScope)=\"scope.set($event)\"\n />\n </div>\n\n <!-- Resizable splitter (config \u2194 preview) -->\n <div\n class=\"db-style-studio__splitter hidden w-1.5 shrink-0 cursor-col-resize touch-none bg-surface-200 transition-colors hover:bg-primary-400 lg:block\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\n (pointerdown)=\"startResize($event)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"endResize()\"\n (pointercancel)=\"endResize()\"\n ></div>\n\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\n <div\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\n [style.width.px]=\"previewWidth()\"\n >\n <div\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\n >\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\n </div>\n <div class=\"min-h-0 flex-1 overflow-auto\">\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\n not a card header \u2014 is what the \"Dialog header\" section edits.\n Both wrappers collapse to `contents` for every other widget, so\n the ordinary preview layout is untouched. -->\n <div [class]=\"previewFrameClass()\">\n @if (isDialogPreview()) {\n <div\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\n >\n @if (dialogHeaderPreview().icon) {\n <mt-icon\n [icon]=\"$any(dialogHeaderPreview().icon)\"\n class=\"shrink-0 text-lg\"\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\n />\n }\n <span\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\n mtTruncateTooltip\n >{{\n dialogHeaderPreview().title ||\n t(\"styleStudio.messages.untitledDialog\")\n }}</span\n >\n <span\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\n </span>\n </div>\n }\n <div [class]=\"previewBodyClass()\">\n <mt-chart-viewer\n [config]=\"previewConfig()\"\n [chartTypeId]=\"previewChartTypeId()\"\n [hideHeader]=\"isDialogPreview()\"\n [useCachedDataOnly]=\"true\"\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\n<div\n [class]=\"\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\n \"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <mt-button\n [label]=\"t('styleStudio.resetAll')\"\n icon=\"arrow.refresh-ccw-01\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"mr-auto\"\n (onClick)=\"resetAll()\"\n />\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\n</div>\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"] }]
|
|
36072
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n [class]=\"modal.contentClass + ' db-style-studio flex h-full min-h-0 flex-col'\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <!-- Header -->\r\n <div\r\n class=\"flex flex-wrap items-center gap-3 border-b border-surface-200 bg-surface-0 px-4 py-3\"\r\n >\r\n <span\r\n class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"chartIcon()\" class=\"text-lg\" />\r\n </span>\r\n <div class=\"mr-auto min-w-0\">\r\n <h3 class=\"truncate text-sm font-semibold text-color\">\r\n {{ t(\"styleStudio.title\") }}\r\n </h3>\r\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\r\n {{ chartName() }}\r\n </p>\r\n </div>\r\n\r\n <mt-segmented-field\r\n [options]=\"scopeOptions()\"\r\n [value]=\"scope()\"\r\n [ariaLabel]=\"t('styleStudio.detailLevel')\"\r\n (valueChange)=\"onScopeChange($event)\"\r\n />\r\n\r\n <mt-text-field\r\n class=\"w-56 self-center\"\r\n icon=\"general.search-md\"\r\n iconPosition=\"start\"\r\n [placeholder]=\"t('styleStudio.findSetting')\"\r\n [field]=\"false\"\r\n [formControl]=\"searchControl\"\r\n />\r\n </div>\r\n\r\n <!-- Body -->\r\n <div class=\"flex min-h-0 flex-1\">\r\n <!-- Left rail (sections grouped under category headers) -->\r\n <nav\r\n class=\"db-style-studio__rail hidden w-52 shrink-0 flex-col gap-1 overflow-y-auto border-r border-surface-200 bg-surface-50 p-2 md:flex\"\r\n >\r\n @for (group of navGroups(); track group.label) {\r\n <div class=\"mt-2 first:mt-0\">\r\n <p\r\n class=\"px-3 pb-1 pt-1 text-[0.65rem] font-semibold uppercase tracking-wider text-muted-color\"\r\n >\r\n {{ group.label }}\r\n </p>\r\n @for (section of group.sections; track section.key) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full items-center gap-2 rounded-lg px-3 py-1.5 text-left text-sm font-medium transition-colors duration-200\"\r\n [class.bg-surface-0]=\"activeSection() === section.key\"\r\n [class.text-primary-600]=\"activeSection() === section.key\"\r\n [class.shadow-sm]=\"activeSection() === section.key\"\r\n [class.text-muted-color]=\"activeSection() !== section.key\"\r\n [class.hover:bg-surface-100]=\"activeSection() !== section.key\"\r\n (click)=\"scrollTo(section)\"\r\n >\r\n <mt-icon [icon]=\"section.icon\" class=\"text-base\" />\r\n <span class=\"truncate\" mtTruncateTooltip>{{\r\n section.label\r\n }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </nav>\r\n\r\n <!-- Settings pane -->\r\n <div\r\n #scrollPane\r\n class=\"min-w-0 flex-1 overflow-y-auto p-4\"\r\n (scroll)=\"onScroll()\"\r\n >\r\n <mt-style-settings-renderer\r\n [visibleSections]=\"navSections()\"\r\n [persisted]=\"itemConfig()\"\r\n [capability]=\"capability()\"\r\n [scope]=\"scope()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n (requestScope)=\"scope.set($event)\"\r\n />\r\n </div>\r\n\r\n <!-- Resizable splitter (config \u2194 preview) -->\r\n <div\r\n class=\"db-style-studio__splitter hidden w-1.5 shrink-0 cursor-col-resize touch-none bg-surface-200 transition-colors hover:bg-primary-400 lg:block\"\r\n role=\"separator\"\r\n aria-orientation=\"vertical\"\r\n [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\r\n not a card header \u2014 is what the \"Dialog header\" section edits.\r\n Both wrappers collapse to `contents` for every other widget, so\r\n the ordinary preview layout is untouched. -->\r\n <div [class]=\"previewFrameClass()\">\r\n @if (isDialogPreview()) {\r\n <div\r\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\r\n >\r\n @if (dialogHeaderPreview().icon) {\r\n <mt-icon\r\n [icon]=\"$any(dialogHeaderPreview().icon)\"\r\n class=\"shrink-0 text-lg\"\r\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\r\n mtTruncateTooltip\r\n >{{\r\n dialogHeaderPreview().title ||\r\n t(\"styleStudio.messages.untitledDialog\")\r\n }}</span\r\n >\r\n <span\r\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\r\n </span>\r\n </div>\r\n }\r\n <div [class]=\"previewBodyClass()\">\r\n <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n [hideHeader]=\"isDialogPreview()\"\r\n [useCachedDataOnly]=\"true\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\r\n<div\r\n [class]=\"\r\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\r\n \"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <mt-button\r\n [label]=\"t('styleStudio.resetAll')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n class=\"mr-auto\"\r\n (onClick)=\"resetAll()\"\r\n />\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"] }]
|
|
37888
36073
|
}], ctorParameters: () => [], propDecorators: { scrollPane: [{ type: i0.ViewChild, args: ['scrollPane', { isSignal: true }] }], previewViewer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ChartViewer), { isSignal: true }] }] } });
|
|
37889
36074
|
|
|
37890
36075
|
/**
|
|
@@ -38808,7 +36993,7 @@ class CustomApiConfiguration {
|
|
|
38808
36993
|
useExisting: forwardRef(() => CustomApiConfiguration),
|
|
38809
36994
|
multi: true,
|
|
38810
36995
|
},
|
|
38811
|
-
], ngImport: i0, template: "<mt-card\n [title]=\"t('customApi')\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <div class=\"flex flex-col gap-4\">\n <p class=\"text-sm text-muted-color\">\n {{ t(\"customApiDescription\") }}\n </p>\n\n <div class=\"grid grid-cols-12 gap-4\">\n <!-- HTTP Method -->\n <div class=\"col-span-3\">\n <mt-select-field\n [label]=\"t('httpMethod')\"\n [options]=\"methodOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"method()\"\n (ngModelChange)=\"onMethodChange($event)\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <!-- Custom API URL -->\n <div class=\"col-span-9\">\n <mt-text-field\n [label]=\"t('customApiUrl')\"\n [placeholder]=\"t('customApiUrlPlaceholder')\"\n [ngModel]=\"customApiUrl()\"\n (ngModelChange)=\"onUrlChange($event)\"\n [disabled]=\"disabled()\"\n />\n </div>\n </div>\n </div>\n</mt-card>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
36996
|
+
], ngImport: i0, template: "<mt-card\r\n [title]=\"t('customApi')\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div class=\"flex flex-col gap-4\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"customApiDescription\") }}\r\n </p>\r\n\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <!-- HTTP Method -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('httpMethod')\"\r\n [options]=\"methodOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"method()\"\r\n (ngModelChange)=\"onMethodChange($event)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n\r\n <!-- Custom API URL -->\r\n <div class=\"col-span-9\">\r\n <mt-text-field\r\n [label]=\"t('customApiUrl')\"\r\n [placeholder]=\"t('customApiUrlPlaceholder')\"\r\n [ngModel]=\"customApiUrl()\"\r\n (ngModelChange)=\"onUrlChange($event)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n</mt-card>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
38812
36997
|
}
|
|
38813
36998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: CustomApiConfiguration, decorators: [{
|
|
38814
36999
|
type: Component,
|
|
@@ -38825,7 +37010,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
38825
37010
|
useExisting: forwardRef(() => CustomApiConfiguration),
|
|
38826
37011
|
multi: true,
|
|
38827
37012
|
},
|
|
38828
|
-
], template: "<mt-card\n [title]=\"t('customApi')\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <div class=\"flex flex-col gap-4\">\n <p class=\"text-sm text-muted-color\">\n {{ t(\"customApiDescription\") }}\n </p>\n\n <div class=\"grid grid-cols-12 gap-4\">\n <!-- HTTP Method -->\n <div class=\"col-span-3\">\n <mt-select-field\n [label]=\"t('httpMethod')\"\n [options]=\"methodOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"method()\"\n (ngModelChange)=\"onMethodChange($event)\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <!-- Custom API URL -->\n <div class=\"col-span-9\">\n <mt-text-field\n [label]=\"t('customApiUrl')\"\n [placeholder]=\"t('customApiUrlPlaceholder')\"\n [ngModel]=\"customApiUrl()\"\n (ngModelChange)=\"onUrlChange($event)\"\n [disabled]=\"disabled()\"\n />\n </div>\n </div>\n </div>\n</mt-card>\n" }]
|
|
37013
|
+
], template: "<mt-card\r\n [title]=\"t('customApi')\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div class=\"flex flex-col gap-4\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"customApiDescription\") }}\r\n </p>\r\n\r\n <div class=\"grid grid-cols-12 gap-4\">\r\n <!-- HTTP Method -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('httpMethod')\"\r\n [options]=\"methodOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"method()\"\r\n (ngModelChange)=\"onMethodChange($event)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n\r\n <!-- Custom API URL -->\r\n <div class=\"col-span-9\">\r\n <mt-text-field\r\n [label]=\"t('customApiUrl')\"\r\n [placeholder]=\"t('customApiUrlPlaceholder')\"\r\n [ngModel]=\"customApiUrl()\"\r\n (ngModelChange)=\"onUrlChange($event)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n</mt-card>\r\n" }]
|
|
38829
37014
|
}] });
|
|
38830
37015
|
|
|
38831
37016
|
const NUMERIC_VIEW_TYPES = new Set(['number', 'percentage', 'currency']);
|
|
@@ -40376,7 +38561,7 @@ class TimelineQuery {
|
|
|
40376
38561
|
useExisting: forwardRef(() => TimelineQuery),
|
|
40377
38562
|
multi: true,
|
|
40378
38563
|
},
|
|
40379
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- Pivot Property -->\n <mt-select-field\n [label]=\"t('pivotProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().pivotProperty\"\n (ngModelChange)=\"updateField('pivotProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Lookup Property -->\n <mt-select-field\n [label]=\"t('lookupProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().lookupProperty\"\n (ngModelChange)=\"updateField('lookupProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Time Frame -->\n <mt-select-field\n [label]=\"t('timeFrame')\"\n [options]=\"timeFrameOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"t('selectTimeFrame')\"\n [ngModel]=\"query().timeFrame\"\n (ngModelChange)=\"updateField('timeFrame', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Start Point Time Property -->\n <mt-select-field\n [label]=\"t('startPointTimeProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().startPoint_timeProperty\"\n (ngModelChange)=\"updateField('startPoint_timeProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- End Point Time Property -->\n <mt-select-field\n [label]=\"t('endPointTimeProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().endPoint_timeProperty\"\n (ngModelChange)=\"updateField('endPoint_timeProperty', $event)\"\n [disabled]=\"disabled\"\n />\n </div>\n\n <!-- Extra Properties -->\n <div class=\"w-full\">\n <mt-multi-select-field\n [label]=\"t('extraProperties')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperties')\"\n [ngModel]=\"query().extraProperties\"\n (ngModelChange)=\"updateField('extraProperties', $event)\"\n [disabled]=\"disabled\"\n />\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
38564
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <!-- Pivot Property -->\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().pivotProperty\"\r\n (ngModelChange)=\"updateField('pivotProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Lookup Property -->\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().lookupProperty\"\r\n (ngModelChange)=\"updateField('lookupProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Time Frame -->\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectTimeFrame')\"\r\n [ngModel]=\"query().timeFrame\"\r\n (ngModelChange)=\"updateField('timeFrame', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Start Point Time Property -->\r\n <mt-select-field\r\n [label]=\"t('startPointTimeProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().startPoint_timeProperty\"\r\n (ngModelChange)=\"updateField('startPoint_timeProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- End Point Time Property -->\r\n <mt-select-field\r\n [label]=\"t('endPointTimeProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().endPoint_timeProperty\"\r\n (ngModelChange)=\"updateField('endPoint_timeProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- Extra Properties -->\r\n <div class=\"w-full\">\r\n <mt-multi-select-field\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"query().extraProperties\"\r\n (ngModelChange)=\"updateField('extraProperties', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
40380
38565
|
}
|
|
40381
38566
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TimelineQuery, decorators: [{
|
|
40382
38567
|
type: Component,
|
|
@@ -40392,7 +38577,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
40392
38577
|
useExisting: forwardRef(() => TimelineQuery),
|
|
40393
38578
|
multi: true,
|
|
40394
38579
|
},
|
|
40395
|
-
], template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- Pivot Property -->\n <mt-select-field\n [label]=\"t('pivotProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().pivotProperty\"\n (ngModelChange)=\"updateField('pivotProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Lookup Property -->\n <mt-select-field\n [label]=\"t('lookupProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().lookupProperty\"\n (ngModelChange)=\"updateField('lookupProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Time Frame -->\n <mt-select-field\n [label]=\"t('timeFrame')\"\n [options]=\"timeFrameOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"t('selectTimeFrame')\"\n [ngModel]=\"query().timeFrame\"\n (ngModelChange)=\"updateField('timeFrame', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- Start Point Time Property -->\n <mt-select-field\n [label]=\"t('startPointTimeProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().startPoint_timeProperty\"\n (ngModelChange)=\"updateField('startPoint_timeProperty', $event)\"\n [disabled]=\"disabled\"\n />\n\n <!-- End Point Time Property -->\n <mt-select-field\n [label]=\"t('endPointTimeProperty')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperty')\"\n [ngModel]=\"query().endPoint_timeProperty\"\n (ngModelChange)=\"updateField('endPoint_timeProperty', $event)\"\n [disabled]=\"disabled\"\n />\n </div>\n\n <!-- Extra Properties -->\n <div class=\"w-full\">\n <mt-multi-select-field\n [label]=\"t('extraProperties')\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [filter]=\"true\"\n [placeholder]=\"t('selectProperties')\"\n [ngModel]=\"query().extraProperties\"\n (ngModelChange)=\"updateField('extraProperties', $event)\"\n [disabled]=\"disabled\"\n />\n </div>\n</div>\n" }]
|
|
38580
|
+
], template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <!-- Pivot Property -->\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().pivotProperty\"\r\n (ngModelChange)=\"updateField('pivotProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Lookup Property -->\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().lookupProperty\"\r\n (ngModelChange)=\"updateField('lookupProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Time Frame -->\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectTimeFrame')\"\r\n [ngModel]=\"query().timeFrame\"\r\n (ngModelChange)=\"updateField('timeFrame', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- Start Point Time Property -->\r\n <mt-select-field\r\n [label]=\"t('startPointTimeProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().startPoint_timeProperty\"\r\n (ngModelChange)=\"updateField('startPoint_timeProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n\r\n <!-- End Point Time Property -->\r\n <mt-select-field\r\n [label]=\"t('endPointTimeProperty')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [ngModel]=\"query().endPoint_timeProperty\"\r\n (ngModelChange)=\"updateField('endPoint_timeProperty', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- Extra Properties -->\r\n <div class=\"w-full\">\r\n <mt-multi-select-field\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"query().extraProperties\"\r\n (ngModelChange)=\"updateField('extraProperties', $event)\"\r\n [disabled]=\"disabled\"\r\n />\r\n </div>\r\n</div>\r\n" }]
|
|
40396
38581
|
}], propDecorators: { propertiesFlat: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesFlat", required: false }] }], propertiesGrouped: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesGrouped", required: false }] }] } });
|
|
40397
38582
|
|
|
40398
38583
|
/**
|
|
@@ -42851,7 +41036,7 @@ class GeneralSettings {
|
|
|
42851
41036
|
return labels[category] || category;
|
|
42852
41037
|
}
|
|
42853
41038
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: GeneralSettings, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42854
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: GeneralSettings, isStandalone: true, selector: "mt-general-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, isDialog: { classPropertyName: "isDialog", publicName: "isDialog", isSignal: true, isRequired: false, transformFunction: null }, hasPreselectedType: { classPropertyName: "hasPreselectedType", publicName: "hasPreselectedType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", chartTypeChange: "chartTypeChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <!-- Basic Info Card -->\n <mt-card [title]=\"t('basicInfo')\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- English Title -->\n <mt-text-field\n [label]=\"t('titleEn')\"\n [ngModel]=\"config()?.clientConfig?.title?.en || ''\"\n (ngModelChange)=\"updateTitle('en', $event)\"\n [placeholder]=\"t('enterTitleEn')\"\n />\n\n <!-- Arabic Title -->\n <mt-text-field\n [label]=\"t('titleAr')\"\n [ngModel]=\"config()?.clientConfig?.title?.ar || ''\"\n (ngModelChange)=\"updateTitle('ar', $event)\"\n [placeholder]=\"t('enterTitleAr')\"\n dir=\"rtl\"\n />\n\n <!-- Component Name (readonly info) -->\n @if (selectedChartType(); as chartType) {\n <div class=\"md:col-span-2\">\n <div class=\"text-sm text-muted-color mb-1\">\n {{ t(\"selectedType\") }}\n </div>\n <div\n class=\"flex items-center gap-2 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <mt-icon\n [icon]=\"chartType.icon\"\n class=\"text-lg text-primary-500\"\n ></mt-icon>\n <span class=\"font-medium\">{{ chartType.name }}</span>\n <span class=\"text-sm text-muted-color\"\n >({{ chartType.serviceType }})</span\n >\n </div>\n </div>\n }\n </div>\n </mt-card>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
41039
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: GeneralSettings, isStandalone: true, selector: "mt-general-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, isDialog: { classPropertyName: "isDialog", publicName: "isDialog", isSignal: true, isRequired: false, transformFunction: null }, hasPreselectedType: { classPropertyName: "hasPreselectedType", publicName: "hasPreselectedType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { configChange: "configChange", chartTypeChange: "chartTypeChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Basic Info Card -->\r\n <mt-card [title]=\"t('basicInfo')\">\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <!-- English Title -->\r\n <mt-text-field\r\n [label]=\"t('titleEn')\"\r\n [ngModel]=\"config()?.clientConfig?.title?.en || ''\"\r\n (ngModelChange)=\"updateTitle('en', $event)\"\r\n [placeholder]=\"t('enterTitleEn')\"\r\n />\r\n\r\n <!-- Arabic Title -->\r\n <mt-text-field\r\n [label]=\"t('titleAr')\"\r\n [ngModel]=\"config()?.clientConfig?.title?.ar || ''\"\r\n (ngModelChange)=\"updateTitle('ar', $event)\"\r\n [placeholder]=\"t('enterTitleAr')\"\r\n dir=\"rtl\"\r\n />\r\n\r\n <!-- Component Name (readonly info) -->\r\n @if (selectedChartType(); as chartType) {\r\n <div class=\"md:col-span-2\">\r\n <div class=\"text-sm text-muted-color mb-1\">\r\n {{ t(\"selectedType\") }}\r\n </div>\r\n <div\r\n class=\"flex items-center gap-2 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-icon\r\n [icon]=\"chartType.icon\"\r\n class=\"text-lg text-primary-500\"\r\n ></mt-icon>\r\n <span class=\"font-medium\">{{ chartType.name }}</span>\r\n <span class=\"text-sm text-muted-color\"\r\n >({{ chartType.serviceType }})</span\r\n >\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </mt-card>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
42855
41040
|
}
|
|
42856
41041
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: GeneralSettings, decorators: [{
|
|
42857
41042
|
type: Component,
|
|
@@ -42863,7 +41048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
42863
41048
|
Card,
|
|
42864
41049
|
TooltipModule,
|
|
42865
41050
|
Icon,
|
|
42866
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <!-- Basic Info Card -->\n <mt-card [title]=\"t('basicInfo')\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <!-- English Title -->\n <mt-text-field\n [label]=\"t('titleEn')\"\n [ngModel]=\"config()?.clientConfig?.title?.en || ''\"\n (ngModelChange)=\"updateTitle('en', $event)\"\n [placeholder]=\"t('enterTitleEn')\"\n />\n\n <!-- Arabic Title -->\n <mt-text-field\n [label]=\"t('titleAr')\"\n [ngModel]=\"config()?.clientConfig?.title?.ar || ''\"\n (ngModelChange)=\"updateTitle('ar', $event)\"\n [placeholder]=\"t('enterTitleAr')\"\n dir=\"rtl\"\n />\n\n <!-- Component Name (readonly info) -->\n @if (selectedChartType(); as chartType) {\n <div class=\"md:col-span-2\">\n <div class=\"text-sm text-muted-color mb-1\">\n {{ t(\"selectedType\") }}\n </div>\n <div\n class=\"flex items-center gap-2 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <mt-icon\n [icon]=\"chartType.icon\"\n class=\"text-lg text-primary-500\"\n ></mt-icon>\n <span class=\"font-medium\">{{ chartType.name }}</span>\n <span class=\"text-sm text-muted-color\"\n >({{ chartType.serviceType }})</span\n >\n </div>\n </div>\n }\n </div>\n </mt-card>\n</div>\n" }]
|
|
41051
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Basic Info Card -->\r\n <mt-card [title]=\"t('basicInfo')\">\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <!-- English Title -->\r\n <mt-text-field\r\n [label]=\"t('titleEn')\"\r\n [ngModel]=\"config()?.clientConfig?.title?.en || ''\"\r\n (ngModelChange)=\"updateTitle('en', $event)\"\r\n [placeholder]=\"t('enterTitleEn')\"\r\n />\r\n\r\n <!-- Arabic Title -->\r\n <mt-text-field\r\n [label]=\"t('titleAr')\"\r\n [ngModel]=\"config()?.clientConfig?.title?.ar || ''\"\r\n (ngModelChange)=\"updateTitle('ar', $event)\"\r\n [placeholder]=\"t('enterTitleAr')\"\r\n dir=\"rtl\"\r\n />\r\n\r\n <!-- Component Name (readonly info) -->\r\n @if (selectedChartType(); as chartType) {\r\n <div class=\"md:col-span-2\">\r\n <div class=\"text-sm text-muted-color mb-1\">\r\n {{ t(\"selectedType\") }}\r\n </div>\r\n <div\r\n class=\"flex items-center gap-2 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-icon\r\n [icon]=\"chartType.icon\"\r\n class=\"text-lg text-primary-500\"\r\n ></mt-icon>\r\n <span class=\"font-medium\">{{ chartType.name }}</span>\r\n <span class=\"text-sm text-muted-color\"\r\n >({{ chartType.serviceType }})</span\r\n >\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </mt-card>\r\n</div>\r\n" }]
|
|
42867
41052
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], isDialog: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDialog", required: false }] }], hasPreselectedType: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasPreselectedType", required: false }] }], configChange: [{ type: i0.Output, args: ["configChange"] }], chartTypeChange: [{ type: i0.Output, args: ["chartTypeChange"] }] } });
|
|
42868
41053
|
|
|
42869
41054
|
/**
|
|
@@ -47700,6 +45885,339 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
47700
45885
|
* preserved.
|
|
47701
45886
|
*/
|
|
47702
45887
|
|
|
45888
|
+
/**
|
|
45889
|
+
* Entity Info Component
|
|
45890
|
+
*
|
|
45891
|
+
* Renders property values based on their viewType.
|
|
45892
|
+
* Matches old app-entity-info behavior with viewType-based rendering.
|
|
45893
|
+
*
|
|
45894
|
+
* Supported viewTypes:
|
|
45895
|
+
* - text, float, title, phasegate → text display
|
|
45896
|
+
* - longtext → rich-text HTML display
|
|
45897
|
+
* - number → formatted number
|
|
45898
|
+
* - date, datetime → date display
|
|
45899
|
+
* - currency → currency display
|
|
45900
|
+
* - time → time display
|
|
45901
|
+
* - lookup, lookupmatrix → lookup display with color indicator
|
|
45902
|
+
* - checkbox → checkbox display
|
|
45903
|
+
* - status, request_status → status display with color
|
|
45904
|
+
* - percentage → percentage with progress bar
|
|
45905
|
+
* - slider → slider/progress display
|
|
45906
|
+
* - user → user avatar display
|
|
45907
|
+
* - lookupmultiselect → multi-select tags
|
|
45908
|
+
* - multiuser → multiple user avatars
|
|
45909
|
+
* - dynamiclist → list of properties
|
|
45910
|
+
* - api → API fetched value
|
|
45911
|
+
* - integrated → integrated value display
|
|
45912
|
+
*/
|
|
45913
|
+
function resolveEntityUserPhoto(value) {
|
|
45914
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
45915
|
+
return '';
|
|
45916
|
+
const user = value;
|
|
45917
|
+
for (const key of ['photoUrl', 'image', 'avatar']) {
|
|
45918
|
+
const candidate = user[key];
|
|
45919
|
+
if (typeof candidate === 'string' && candidate.trim()) {
|
|
45920
|
+
return candidate.trim();
|
|
45921
|
+
}
|
|
45922
|
+
}
|
|
45923
|
+
return '';
|
|
45924
|
+
}
|
|
45925
|
+
/**
|
|
45926
|
+
* The dashboard backend sends a Checkbox value as text (`"True"` / `"False"`),
|
|
45927
|
+
* so `Boolean(value)` read every non-empty string, `"False"` included, as
|
|
45928
|
+
* checked. Parsed the same way as the table card's `toBooleanValue`.
|
|
45929
|
+
*/
|
|
45930
|
+
function resolveEntityCheckbox(value) {
|
|
45931
|
+
if (typeof value === 'boolean')
|
|
45932
|
+
return value;
|
|
45933
|
+
if (typeof value === 'number')
|
|
45934
|
+
return value === 1;
|
|
45935
|
+
if (typeof value === 'string') {
|
|
45936
|
+
const text = value.trim().toLowerCase();
|
|
45937
|
+
return text === 'true' || text === '1' || text === 'yes';
|
|
45938
|
+
}
|
|
45939
|
+
if (value && typeof value === 'object' && 'value' in value) {
|
|
45940
|
+
return resolveEntityCheckbox(value.value);
|
|
45941
|
+
}
|
|
45942
|
+
return false;
|
|
45943
|
+
}
|
|
45944
|
+
class EntityInfoComponent {
|
|
45945
|
+
transloco = inject(TranslocoService);
|
|
45946
|
+
httpContext = new HttpContext().set(REQUEST_CONTEXT, {
|
|
45947
|
+
useBaseUrl: true,
|
|
45948
|
+
});
|
|
45949
|
+
/** Entity data to display */
|
|
45950
|
+
data = input(null, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
45951
|
+
/** Display type: 'entity' shows label, 'inTable' shows value only */
|
|
45952
|
+
displayType = input('entity', ...(ngDevMode ? [{ debugName: "displayType" }] : /* istanbul ignore next */ []));
|
|
45953
|
+
/** Extra configuration */
|
|
45954
|
+
extraInfoData = input({}, ...(ngDevMode ? [{ debugName: "extraInfoData" }] : /* istanbul ignore next */ []));
|
|
45955
|
+
/** Whether to limit words with ellipsis */
|
|
45956
|
+
limitWords = input(false, ...(ngDevMode ? [{ debugName: "limitWords" }] : /* istanbul ignore next */ []));
|
|
45957
|
+
/** Custom CSS class */
|
|
45958
|
+
customClass = input('', ...(ngDevMode ? [{ debugName: "customClass" }] : /* istanbul ignore next */ []));
|
|
45959
|
+
/** Computed viewType in lowercase */
|
|
45960
|
+
viewTypeLower = computed(() => {
|
|
45961
|
+
return this.data()?.viewType?.toLowerCase() || 'text';
|
|
45962
|
+
}, ...(ngDevMode ? [{ debugName: "viewTypeLower" }] : /* istanbul ignore next */ []));
|
|
45963
|
+
// === Text values ===
|
|
45964
|
+
textValue = computed(() => {
|
|
45965
|
+
const value = this.data()?.value;
|
|
45966
|
+
if (value === null || value === undefined)
|
|
45967
|
+
return '';
|
|
45968
|
+
if (typeof value === 'object') {
|
|
45969
|
+
return value.displayName || value.display || value.name || String(value);
|
|
45970
|
+
}
|
|
45971
|
+
return String(value);
|
|
45972
|
+
}, ...(ngDevMode ? [{ debugName: "textValue" }] : /* istanbul ignore next */ []));
|
|
45973
|
+
// === Long text values ===
|
|
45974
|
+
/**
|
|
45975
|
+
* A `LongText` property stores rich-text HTML authored in the editor, so the
|
|
45976
|
+
* cell has to render it as markup — interpolating it printed the raw
|
|
45977
|
+
* `<p>…</p>` source into the table. Angular sanitizes `[innerHTML]`, and this
|
|
45978
|
+
* matches `mt-entity-long-text`, which is what the level-workspace table
|
|
45979
|
+
* renders the same property with.
|
|
45980
|
+
*/
|
|
45981
|
+
longTextHtml = computed(() => this.textValue(), ...(ngDevMode ? [{ debugName: "longTextHtml" }] : /* istanbul ignore next */ []));
|
|
45982
|
+
/** Tag-stripped text for the `title` tooltip — an attribute can't hold markup. */
|
|
45983
|
+
longTextTooltip = computed(() => {
|
|
45984
|
+
const text = TableValueResolver.stripHtml(this.longTextHtml());
|
|
45985
|
+
return typeof text === 'string' ? text : '';
|
|
45986
|
+
}, ...(ngDevMode ? [{ debugName: "longTextTooltip" }] : /* istanbul ignore next */ []));
|
|
45987
|
+
// === Number values ===
|
|
45988
|
+
numericValue = computed(() => {
|
|
45989
|
+
const value = this.data()?.value;
|
|
45990
|
+
if (value === null || value === undefined)
|
|
45991
|
+
return null;
|
|
45992
|
+
const num = parseFloat(value);
|
|
45993
|
+
return isNaN(num) ? null : num;
|
|
45994
|
+
}, ...(ngDevMode ? [{ debugName: "numericValue" }] : /* istanbul ignore next */ []));
|
|
45995
|
+
// === Date values ===
|
|
45996
|
+
dateDisplayValue = computed(() => {
|
|
45997
|
+
const value = this.data()?.value;
|
|
45998
|
+
if (!value)
|
|
45999
|
+
return '';
|
|
46000
|
+
if (typeof value === 'object') {
|
|
46001
|
+
return value.displayValue || value.display || '';
|
|
46002
|
+
}
|
|
46003
|
+
// Try to format as date
|
|
46004
|
+
try {
|
|
46005
|
+
const date = new Date(value);
|
|
46006
|
+
if (!isNaN(date.getTime())) {
|
|
46007
|
+
return date.toLocaleDateString();
|
|
46008
|
+
}
|
|
46009
|
+
}
|
|
46010
|
+
catch {
|
|
46011
|
+
// ignore
|
|
46012
|
+
}
|
|
46013
|
+
return String(value);
|
|
46014
|
+
}, ...(ngDevMode ? [{ debugName: "dateDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46015
|
+
// === Currency values ===
|
|
46016
|
+
currencyDisplayValue = computed(() => {
|
|
46017
|
+
const value = this.data()?.value;
|
|
46018
|
+
if (!value)
|
|
46019
|
+
return '';
|
|
46020
|
+
if (typeof value === 'object') {
|
|
46021
|
+
return value.display || this.formatCurrency(value.value);
|
|
46022
|
+
}
|
|
46023
|
+
return this.formatCurrency(value);
|
|
46024
|
+
}, ...(ngDevMode ? [{ debugName: "currencyDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46025
|
+
// === Time values ===
|
|
46026
|
+
timeDisplayValue = computed(() => {
|
|
46027
|
+
const value = this.data()?.value;
|
|
46028
|
+
if (!value)
|
|
46029
|
+
return '';
|
|
46030
|
+
if (typeof value === 'object') {
|
|
46031
|
+
return value.displayValue || value.display || '';
|
|
46032
|
+
}
|
|
46033
|
+
return String(value);
|
|
46034
|
+
}, ...(ngDevMode ? [{ debugName: "timeDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46035
|
+
// === Lookup values ===
|
|
46036
|
+
lookupName = computed(() => {
|
|
46037
|
+
const value = this.data()?.value;
|
|
46038
|
+
if (!value)
|
|
46039
|
+
return '';
|
|
46040
|
+
if (typeof value === 'object') {
|
|
46041
|
+
return value.name || value.display?.name || value.display || '';
|
|
46042
|
+
}
|
|
46043
|
+
return String(value);
|
|
46044
|
+
}, ...(ngDevMode ? [{ debugName: "lookupName" }] : /* istanbul ignore next */ []));
|
|
46045
|
+
lookupColor = computed(() => {
|
|
46046
|
+
const value = this.data()?.value;
|
|
46047
|
+
if (!value || typeof value !== 'object')
|
|
46048
|
+
return '';
|
|
46049
|
+
return value.details?.color || value.color || '';
|
|
46050
|
+
}, ...(ngDevMode ? [{ debugName: "lookupColor" }] : /* istanbul ignore next */ []));
|
|
46051
|
+
// === Checkbox values ===
|
|
46052
|
+
checkboxValue = computed(() => resolveEntityCheckbox(this.data()?.value), ...(ngDevMode ? [{ debugName: "checkboxValue" }] : /* istanbul ignore next */ []));
|
|
46053
|
+
checkboxLabel = computed(() => this.transloco.translate(this.checkboxValue() ? 'dashboardBuilder.yes' : 'dashboardBuilder.no'), ...(ngDevMode ? [{ debugName: "checkboxLabel" }] : /* istanbul ignore next */ []));
|
|
46054
|
+
// === Status values ===
|
|
46055
|
+
statusName = computed(() => {
|
|
46056
|
+
const value = this.data()?.value;
|
|
46057
|
+
if (!value)
|
|
46058
|
+
return '';
|
|
46059
|
+
if (typeof value === 'object') {
|
|
46060
|
+
const languageCode = document.dir === 'rtl' ? 'ar' : 'en';
|
|
46061
|
+
const display = typeof value.display === 'object'
|
|
46062
|
+
? value.display?.[languageCode] ||
|
|
46063
|
+
value.display?.en ||
|
|
46064
|
+
value.display?.ar ||
|
|
46065
|
+
value.display?.name ||
|
|
46066
|
+
value.display?.displayName ||
|
|
46067
|
+
value.display?.label
|
|
46068
|
+
: value.display;
|
|
46069
|
+
return (value.displayName ||
|
|
46070
|
+
value.name ||
|
|
46071
|
+
display ||
|
|
46072
|
+
value[languageCode] ||
|
|
46073
|
+
value.en ||
|
|
46074
|
+
value.ar ||
|
|
46075
|
+
value.label ||
|
|
46076
|
+
value.key ||
|
|
46077
|
+
'');
|
|
46078
|
+
}
|
|
46079
|
+
return String(value);
|
|
46080
|
+
}, ...(ngDevMode ? [{ debugName: "statusName" }] : /* istanbul ignore next */ []));
|
|
46081
|
+
statusColor = computed(() => {
|
|
46082
|
+
const value = this.data()?.value;
|
|
46083
|
+
if (!value || typeof value !== 'object')
|
|
46084
|
+
return '';
|
|
46085
|
+
return value.details?.color || value.color || '';
|
|
46086
|
+
}, ...(ngDevMode ? [{ debugName: "statusColor" }] : /* istanbul ignore next */ []));
|
|
46087
|
+
// === Percentage values ===
|
|
46088
|
+
percentageValue = computed(() => {
|
|
46089
|
+
let value = this.data()?.value;
|
|
46090
|
+
if (value === null || value === undefined)
|
|
46091
|
+
return null;
|
|
46092
|
+
// Unwrap nested { value: { value: N } } / { value: "49%" } shapes (up to a
|
|
46093
|
+
// couple of levels) so the progress-bar fill width parses correctly.
|
|
46094
|
+
for (let i = 0; i < 3 && value && typeof value === 'object'; i++) {
|
|
46095
|
+
value =
|
|
46096
|
+
value.value ??
|
|
46097
|
+
value.actualValue ??
|
|
46098
|
+
value.displayValue ??
|
|
46099
|
+
value.display ??
|
|
46100
|
+
null;
|
|
46101
|
+
}
|
|
46102
|
+
if (value === null || value === undefined)
|
|
46103
|
+
return null;
|
|
46104
|
+
const num = parseFloat(String(value).replace('%', '').trim());
|
|
46105
|
+
return Number.isNaN(num) ? 0 : num;
|
|
46106
|
+
}, ...(ngDevMode ? [{ debugName: "percentageValue" }] : /* istanbul ignore next */ []));
|
|
46107
|
+
percentageColor = computed(() => {
|
|
46108
|
+
// "% status color": the table injects the row's status colour as
|
|
46109
|
+
// data().statusColor and sets extraInfoData.showPercentageStatus — prefer
|
|
46110
|
+
// it so the progress bar / dot reflects the row's status (Delayed -> red…).
|
|
46111
|
+
const statusColor = this.data()?.statusColor;
|
|
46112
|
+
if (this.extraInfoData()?.showPercentageStatus && statusColor) {
|
|
46113
|
+
return statusColor;
|
|
46114
|
+
}
|
|
46115
|
+
// Otherwise use any colour carried on the value (incl. one level of nesting).
|
|
46116
|
+
const value = this.data()?.value;
|
|
46117
|
+
if (!value || typeof value !== 'object')
|
|
46118
|
+
return '';
|
|
46119
|
+
return value.color || value.details?.color || value.value?.color || '';
|
|
46120
|
+
}, ...(ngDevMode ? [{ debugName: "percentageColor" }] : /* istanbul ignore next */ []));
|
|
46121
|
+
// === Slider values ===
|
|
46122
|
+
sliderValue = computed(() => {
|
|
46123
|
+
const value = this.data()?.value;
|
|
46124
|
+
if (!value)
|
|
46125
|
+
return 0;
|
|
46126
|
+
if (typeof value === 'object') {
|
|
46127
|
+
return parseFloat(value.value) || 0;
|
|
46128
|
+
}
|
|
46129
|
+
return parseFloat(value) || 0;
|
|
46130
|
+
}, ...(ngDevMode ? [{ debugName: "sliderValue" }] : /* istanbul ignore next */ []));
|
|
46131
|
+
// === User values ===
|
|
46132
|
+
userData = computed(() => {
|
|
46133
|
+
const value = this.data()?.value;
|
|
46134
|
+
if (!value || typeof value !== 'object')
|
|
46135
|
+
return null;
|
|
46136
|
+
return value;
|
|
46137
|
+
}, ...(ngDevMode ? [{ debugName: "userData" }] : /* istanbul ignore next */ []));
|
|
46138
|
+
userName = computed(() => {
|
|
46139
|
+
const user = this.userData();
|
|
46140
|
+
if (!user)
|
|
46141
|
+
return '';
|
|
46142
|
+
return user.displayName || user.name || user.fullName || '';
|
|
46143
|
+
}, ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
|
|
46144
|
+
userPhoto = computed(() => resolveEntityUserPhoto(this.userData()), ...(ngDevMode ? [{ debugName: "userPhoto" }] : /* istanbul ignore next */ []));
|
|
46145
|
+
userInitials = computed(() => {
|
|
46146
|
+
const name = this.userName();
|
|
46147
|
+
return this.getInitials(name);
|
|
46148
|
+
}, ...(ngDevMode ? [{ debugName: "userInitials" }] : /* istanbul ignore next */ []));
|
|
46149
|
+
// === Multiselect values ===
|
|
46150
|
+
multiselectValues = computed(() => {
|
|
46151
|
+
const value = this.data()?.value;
|
|
46152
|
+
if (!value)
|
|
46153
|
+
return [];
|
|
46154
|
+
return Array.isArray(value) ? value : [];
|
|
46155
|
+
}, ...(ngDevMode ? [{ debugName: "multiselectValues" }] : /* istanbul ignore next */ []));
|
|
46156
|
+
// === Multi user values ===
|
|
46157
|
+
multiUserValues = computed(() => {
|
|
46158
|
+
const value = this.data()?.value;
|
|
46159
|
+
if (!value)
|
|
46160
|
+
return [];
|
|
46161
|
+
return Array.isArray(value) ? value : [];
|
|
46162
|
+
}, ...(ngDevMode ? [{ debugName: "multiUserValues" }] : /* istanbul ignore next */ []));
|
|
46163
|
+
getUserPhoto(user) {
|
|
46164
|
+
return resolveEntityUserPhoto(user);
|
|
46165
|
+
}
|
|
46166
|
+
// === Dynamic list values ===
|
|
46167
|
+
dynamicListValues = computed(() => {
|
|
46168
|
+
const value = this.data()?.value;
|
|
46169
|
+
if (!value)
|
|
46170
|
+
return [];
|
|
46171
|
+
return Array.isArray(value) ? value : [];
|
|
46172
|
+
}, ...(ngDevMode ? [{ debugName: "dynamicListValues" }] : /* istanbul ignore next */ []));
|
|
46173
|
+
// === Location values ===
|
|
46174
|
+
locationDisplayValue = computed(() => {
|
|
46175
|
+
const value = this.data()?.value;
|
|
46176
|
+
if (!value)
|
|
46177
|
+
return '';
|
|
46178
|
+
if (typeof value === 'object') {
|
|
46179
|
+
return value.display_name || value.displayName || value.name || '';
|
|
46180
|
+
}
|
|
46181
|
+
return String(value);
|
|
46182
|
+
}, ...(ngDevMode ? [{ debugName: "locationDisplayValue" }] : /* istanbul ignore next */ []));
|
|
46183
|
+
/** Get initials from name */
|
|
46184
|
+
getInitials(name) {
|
|
46185
|
+
if (!name)
|
|
46186
|
+
return '?';
|
|
46187
|
+
const parts = name.split(' ').filter(Boolean);
|
|
46188
|
+
if (parts.length === 1) {
|
|
46189
|
+
return parts[0].charAt(0).toUpperCase();
|
|
46190
|
+
}
|
|
46191
|
+
return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
|
|
46192
|
+
}
|
|
46193
|
+
/** Format currency value */
|
|
46194
|
+
formatCurrency(value) {
|
|
46195
|
+
if (value === null || value === undefined || value === '')
|
|
46196
|
+
return '';
|
|
46197
|
+
const num = parseFloat(value);
|
|
46198
|
+
if (isNaN(num))
|
|
46199
|
+
return String(value);
|
|
46200
|
+
return num.toLocaleString(undefined, {
|
|
46201
|
+
minimumFractionDigits: 2,
|
|
46202
|
+
maximumFractionDigits: 2,
|
|
46203
|
+
});
|
|
46204
|
+
}
|
|
46205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46206
|
+
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 });
|
|
46207
|
+
}
|
|
46208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityInfoComponent, decorators: [{
|
|
46209
|
+
type: Component,
|
|
46210
|
+
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"] }]
|
|
46211
|
+
}], 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 }] }] } });
|
|
46212
|
+
|
|
46213
|
+
/**
|
|
46214
|
+
* The table card renders the data grid, so the package's main entry never imports it
|
|
46215
|
+
* statically: `DashboardItem` defers it, and other callers load it with this function.
|
|
46216
|
+
* A static import here would put the whole grid in every host bundle that imports
|
|
46217
|
+
* `@masterteam/dashboard-builder`.
|
|
46218
|
+
*/
|
|
46219
|
+
const loadTableCard = () => import('./masterteam-dashboard-builder-table-card.component-CKAm_KXn.mjs').then((m) => m.TableCardComponent);
|
|
46220
|
+
|
|
47703
46221
|
/**
|
|
47704
46222
|
* Dashboard Item Components Index
|
|
47705
46223
|
*
|
|
@@ -51848,11 +50366,11 @@ class DashboardList {
|
|
|
51848
50366
|
this.dashboards.reload();
|
|
51849
50367
|
}
|
|
51850
50368
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
51851
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, queries: [{ propertyName: "headerEnd", first: true, predicate: ["headerEnd"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\n <!-- Page mode -->\n @if (isPage()) {\n <mt-page\n [title]=\"pageTitle() || t('dashboards')\"\n [avatarIcon]=\"'chart.bar-chart-square-03'\"\n [avatarStyle]=\"{\n '--p-avatar-background': 'var(--p-cyan-100)',\n '--p-avatar-color': 'var(--p-cyan-700)',\n }\"\n >\n @if (headerEnd(); as hostActions) {\n <ng-template #headerEnd>\n <ng-container *ngTemplateOutlet=\"hostActions\" />\n </ng-template>\n }\n <!-- Content -->\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </mt-page>\n } @else {\n <!-- Non-page mode -->\n <div class=\"dashboard-list space-y-3\">\n <!-- Header -->\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\n {{ t(\"dashboards\") }}\n </h2>\n\n <!-- Content -->\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </div>\n }\n\n <!-- Reusable table content template -->\n <ng-template #tableContent>\n <!-- Custom cell templates -->\n <ng-template #nameTpl let-row>\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\n {{ getDashboardName(row) }}\n </span>\n </ng-template>\n\n <!-- Dashboard Table -->\n <mt-table\n [data]=\"dashboardList()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [loading]=\"isLoading()\"\n [showFilters]=\"true\"\n [generalSearch]=\"true\"\n dataKey=\"id\"\n storageKey=\"dashboard-list-table\"\n (cellChange)=\"onToggleChange($event)\"\n />\n </ng-template>\n</ng-container>\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: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
50369
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, queries: [{ propertyName: "headerEnd", first: true, predicate: ["headerEnd"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"pageTitle() || t('dashboards')\"\r\n [avatarIcon]=\"'chart.bar-chart-square-03'\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-cyan-100)',\r\n '--p-avatar-color': 'var(--p-cyan-700)',\r\n }\"\r\n >\r\n @if (headerEnd(); as hostActions) {\r\n <ng-template #headerEnd>\r\n <ng-container *ngTemplateOutlet=\"hostActions\" />\r\n </ng-template>\r\n }\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [actions]=\"tableActions()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "filterCloseOnOutsideClick", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "externalFiltersActive", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "filtersCleared", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
51852
50370
|
}
|
|
51853
50371
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, decorators: [{
|
|
51854
50372
|
type: Component,
|
|
51855
|
-
args: [{ selector: 'mt-dashboard-list', standalone: true, imports: [CommonModule, TranslocoDirective, Table, Page], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\n <!-- Page mode -->\n @if (isPage()) {\n <mt-page\n [title]=\"pageTitle() || t('dashboards')\"\n [avatarIcon]=\"'chart.bar-chart-square-03'\"\n [avatarStyle]=\"{\n '--p-avatar-background': 'var(--p-cyan-100)',\n '--p-avatar-color': 'var(--p-cyan-700)',\n }\"\n >\n @if (headerEnd(); as hostActions) {\n <ng-template #headerEnd>\n <ng-container *ngTemplateOutlet=\"hostActions\" />\n </ng-template>\n }\n <!-- Content -->\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </mt-page>\n } @else {\n <!-- Non-page mode -->\n <div class=\"dashboard-list space-y-3\">\n <!-- Header -->\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\n {{ t(\"dashboards\") }}\n </h2>\n\n <!-- Content -->\n <ng-container *ngTemplateOutlet=\"tableContent\" />\n </div>\n }\n\n <!-- Reusable table content template -->\n <ng-template #tableContent>\n <!-- Custom cell templates -->\n <ng-template #nameTpl let-row>\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\n {{ getDashboardName(row) }}\n </span>\n </ng-template>\n\n <!-- Dashboard Table -->\n <mt-table\n [data]=\"dashboardList()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [loading]=\"isLoading()\"\n [showFilters]=\"true\"\n [generalSearch]=\"true\"\n dataKey=\"id\"\n storageKey=\"dashboard-list-table\"\n (cellChange)=\"onToggleChange($event)\"\n />\n </ng-template>\n</ng-container>\n" }]
|
|
50373
|
+
args: [{ selector: 'mt-dashboard-list', standalone: true, imports: [CommonModule, TranslocoDirective, Table, Page], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"pageTitle() || t('dashboards')\"\r\n [avatarIcon]=\"'chart.bar-chart-square-03'\"\r\n [avatarStyle]=\"{\r\n '--p-avatar-background': 'var(--p-cyan-100)',\r\n '--p-avatar-color': 'var(--p-cyan-700)',\r\n }\"\r\n >\r\n @if (headerEnd(); as hostActions) {\r\n <ng-template #headerEnd>\r\n <ng-container *ngTemplateOutlet=\"hostActions\" />\r\n </ng-template>\r\n }\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [actions]=\"tableActions()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n" }]
|
|
51856
50374
|
}], propDecorators: { nameTpl: [{ type: i0.ViewChild, args: ['nameTpl', { isSignal: true }] }], headerEnd: [{ type: i0.ContentChild, args: ['headerEnd', { isSignal: true }] }], isPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPage", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], baseRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseRoute", required: false }] }], showCreateButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCreateButton", required: false }] }], showViewButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showViewButton", required: false }] }], showEditButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditButton", required: false }] }], dashboardAction: [{ type: i0.Output, args: ["dashboardAction"] }], dashboardCreated: [{ type: i0.Output, args: ["dashboardCreated"] }] } });
|
|
51857
50375
|
|
|
51858
50376
|
/**
|
|
@@ -54867,5 +53385,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
54867
53385
|
* Generated bundle index. Do not edit.
|
|
54868
53386
|
*/
|
|
54869
53387
|
|
|
54870
|
-
export {
|
|
54871
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
53388
|
+
export { StatisticCardComponent as $, getColorFromConditions as A, CardFilterComponent as B, ClickDispatcher as C, DashboardItemStoreService as D, EntityInfoComponent as E, FilterUtilsService as F, DynamicFiltersComponent as G, CardInfoComponent as H, ChartCardComponent as I, EChartComponent as J, resolveEntityUserPhoto as K, resolveEntityCheckbox as L, dateDisplayRawValue as M, normalizeDashboardCardEntityValue as N, mergePropertyAppearance as O, PropertiesCardComponent as P, EntityPreviewCardComponent as Q, HeaderCardComponent as R, StaticFiltersComponent as S, LastHistoryLevelCardComponent as T, ListStatisticCardComponent as U, MAP_REGIONS as V, DEFAULT_MAP_REGION_KEY as W, resolveMapRegion as X, MapViewComponent as Y, SkeletonCardComponent as Z, resolveStatisticIconPlacement as _, fillColorForPercentageProperty as a, StyleStudioDrawer as a$, loadTableCard as a0, TopbarCardComponent as a1, ChartDataService as a2, observeNearViewport as a3, loadImmediately as a4, DASHBOARD_ITEM_VISIBILITY as a5, BarChartHandler as a6, PieChartHandler as a7, StackBarChartHandler as a8, axisFormatters as a9, handleFilterForSnapshot as aA, applyBuiltInConditions as aB, DashboardList as aC, MODULE_CLASSIFICATION_LOG as aD, MODULE_CLASSIFICATION_LOG_NAME as aE, isLogClassification as aF, HTTPMethod as aG, DashboardBuilderService as aH, DashboardStoreService as aI, isManagePagesDeleteResult as aJ, ManagePages as aK, ManageBreadcrumb as aL, ManageFilterOnPage as aM, DynamicFiltersConfig as aN, ChartSettingsDrawer as aO, DisplaySettings as aP, DefaultControlUi as aQ, PieControlUi as aR, BarControlUi as aS, StackBarControlUi as aT, ManageItem as aU, CHART_TYPES as aV, ManageItemService as aW, GeneralSettings as aX, DataSourceSettings as aY, ActionsSettings as aZ, ChartViewer as a_, groupDatesByYearAndMonth as aa, GaugeChartHandler as ab, TableViewHandler as ac, OverviewCardHandler as ad, TimelineHandler as ae, LineChartHandler as af, SnapshotHandler as ag, ComparisonChartHandler as ah, SplitterChartHandler as ai, LevelCardHandler as aj, MapChartHandler as ak, RingGaugeChartHandler as al, SPlusChartHandler as am, PhaseGateStepperHandler as an, formatCurrency as ao, getCurrencySuffix as ap, formatPercentage as aq, formatNumber as ar, formatDate as as, createAxisFormatter as at, createTooltipFormatter as au, formatAxisLabel as av, formatWordsUnderBar as aw, formatXAxis as ax, handleFiltersForCustom as ay, handleFilterForCard as az, resolveLegendColorOverride as b, formatForEditor as b$, StyleSettingsRenderer as b0, expandResetPatches as b1, StyleField as b2, SegmentedField as b3, ColorListField as b4, ArrayBuilderField as b5, KeyValueMapField as b6, LegendOrderField as b7, ItemCardMenuComponent as b8, ChartFilterDrawer as b9, findDomain as bA, POPOVER_TABS as bB, POPOVER_TAB_SPECS as bC, titleToUi as bD, applyTitleToPersisted as bE, datasourceToUi as bF, fieldsToUi as bG, filtersToUi as bH, styleToUi as bI, applyStyleToPersisted as bJ, layoutToUi as bK, applyLayoutToPersisted as bL, labelLegendFormatToUi as bM, applyLabelLegendFormatToPersisted as bN, behaviorToUi as bO, applyBehaviorToPersisted as bP, applyFilterChipsToPersisted as bQ, persistedToUi as bR, buildAssembly as bS, STYLE_PRESETS as bT, presetsForCapability as bU, findPreset as bV, validate as bW, hasBlockingIssues as bX, groupIssuesByDomain as bY, parseAdvancedJson as bZ, deepMerge$1 as b_, ItemContextToolbarComponent as ba, ItemConfigPopoverComponent as bb, GuidedConfigDialogComponent as bc, FilterChipsBarComponent as bd, FilterBuilderComponent as be, DatasourcePanelComponent as bf, SchemaControlRendererComponent as bg, FilterByGroupPipe as bh, GetChartActionsPipe as bi, CHART_CAPABILITIES as bj, getCapabilityById as bk, resolveCapability as bl, toBackendChartType as bm, normalizeChartTypeForRequest as bn, normalizeFilterOperation as bo, normalizeAggregateFunction as bp, normalizeFilters as bq, selectorFromLegacy as br, moduleIdFromSelector as bs, toBackendSourceLink as bt, toFormSourceLink as bu, normalizeOnLoad as bv, normalizeBeforeSave as bw, normalizeBeforeRequest as bx, CONFIG_DOMAINS as by, domainsForCapability as bz, CardContentComponent as c, CUSTOM_COLOR_OPTION as c0, readByPath$1 as c1, setByPath as c2, applyControlPatchToPersisted as c3, applyControlPatchesToPersisted as c4, getControlSchema as c5, listControlSchemaIds as c6, listControlSchemas as c7, getFallbackControlSchema as c8, flattenSchema as c9, resolveDisplayFields as ca, buildDisplayFieldPredicate as cb, bindingKey as cc, getBinding as cd, listBindings as ce, listBindingsForChart as cf, readBoundValue as cg, ITEM_GUIDANCE_REGISTRY as ch, describeGuidance as ci, ItemGuidanceService as cj, 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 };
|
|
53389
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-2MrkLmtr.mjs.map
|