@masterteam/dashboard-builder 0.0.47 → 0.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dashboard-builder.css +1 -1
- package/assets/i18n/ar.json +1220 -1219
- package/assets/i18n/en.json +1220 -1219
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-Dx5y1IeV.mjs → masterteam-dashboard-builder-dashboard-dialog.component-DJqN3Sel.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-Dx5y1IeV.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-DJqN3Sel.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-DysRF9eN.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-78XZqtjp.mjs} +699 -258
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-78XZqtjp.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +3 -3
- package/types/masterteam-dashboard-builder.d.ts +101 -23
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-DysRF9eN.mjs.map +0 -1
|
@@ -45,8 +45,8 @@ import * as i6 from 'primeng/select';
|
|
|
45
45
|
import { SelectModule } from 'primeng/select';
|
|
46
46
|
import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
|
47
47
|
import { DynamicDrawerConfig, DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
48
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
49
48
|
import { Tooltip as Tooltip$1, TruncateTooltip } from '@masterteam/components/tooltip';
|
|
49
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
50
50
|
import * as mtIcons from '@masterteam/icons/assets/select-icons.json';
|
|
51
51
|
import { Avatar } from '@masterteam/components/avatar';
|
|
52
52
|
import { EntitiesPreview } from '@masterteam/components/entities';
|
|
@@ -1012,7 +1012,7 @@ function createDefaultFilterField() {
|
|
|
1012
1012
|
selection: [
|
|
1013
1013
|
{
|
|
1014
1014
|
id: 1,
|
|
1015
|
-
service:
|
|
1015
|
+
service: null,
|
|
1016
1016
|
selector: null,
|
|
1017
1017
|
selectorName: null,
|
|
1018
1018
|
moduleType: undefined,
|
|
@@ -3362,12 +3362,15 @@ class SelectionConfiguration {
|
|
|
3362
3362
|
// against the new data (then stay stable across CD passes again).
|
|
3363
3363
|
this.typeOptionsCache.clear();
|
|
3364
3364
|
this.moduleOptionsCache.clear();
|
|
3365
|
+
this.parentOptionsCache.clear();
|
|
3365
3366
|
// Build selector name map in service for global access.
|
|
3366
3367
|
this.dashboardService.buildSelectorNameMap(services);
|
|
3367
3368
|
if (services.length === 1) {
|
|
3368
3369
|
const serviceName = services[0].serviceName;
|
|
3369
3370
|
this.selectionsArray.controls.forEach((control) => {
|
|
3370
|
-
|
|
3371
|
+
const currentService = control.get('service')?.value;
|
|
3372
|
+
if (!currentService ||
|
|
3373
|
+
!services.some((service) => service.serviceName === currentService)) {
|
|
3371
3374
|
control.patchValue({ service: serviceName });
|
|
3372
3375
|
}
|
|
3373
3376
|
});
|
|
@@ -3431,6 +3434,7 @@ class SelectionConfiguration {
|
|
|
3431
3434
|
*/
|
|
3432
3435
|
typeOptionsCache = new Map();
|
|
3433
3436
|
moduleOptionsCache = new Map();
|
|
3437
|
+
parentOptionsCache = new Map();
|
|
3434
3438
|
/** Resolve the selected module (by type id) within a service. */
|
|
3435
3439
|
getModuleByType(serviceName, moduleTypeId) {
|
|
3436
3440
|
if (!serviceName || !moduleTypeId)
|
|
@@ -3467,6 +3471,39 @@ class SelectionConfiguration {
|
|
|
3467
3471
|
getModuleTypeValue(selectionIndex) {
|
|
3468
3472
|
return (this.selectionsArray.at(selectionIndex)?.get('moduleType')?.value ?? null);
|
|
3469
3473
|
}
|
|
3474
|
+
shouldShowParentWorkspace(selectionIndex) {
|
|
3475
|
+
if (this.chartWorkspace())
|
|
3476
|
+
return false;
|
|
3477
|
+
const selection = this.selectionsArray.at(selectionIndex);
|
|
3478
|
+
const module = this.getModuleByType(selection?.get('service')?.value, selection?.get('moduleType')?.value);
|
|
3479
|
+
return !!module && this.isHierarchicalModule(module);
|
|
3480
|
+
}
|
|
3481
|
+
getParentOptionsForSelection(selectionIndex) {
|
|
3482
|
+
const selection = this.selectionsArray.at(selectionIndex);
|
|
3483
|
+
const serviceName = selection?.get('service')?.value;
|
|
3484
|
+
const moduleTypeId = selection?.get('moduleType')?.value;
|
|
3485
|
+
const key = `${serviceName ?? ''}::${moduleTypeId ?? ''}::${this.workspaceId() ?? ''}`;
|
|
3486
|
+
let cached = this.parentOptionsCache.get(key);
|
|
3487
|
+
if (!cached) {
|
|
3488
|
+
cached = this.computeParentOptions(serviceName, moduleTypeId);
|
|
3489
|
+
this.parentOptionsCache.set(key, cached);
|
|
3490
|
+
}
|
|
3491
|
+
return cached;
|
|
3492
|
+
}
|
|
3493
|
+
computeParentOptions(serviceName, moduleTypeId) {
|
|
3494
|
+
const module = this.getModuleByType(serviceName, moduleTypeId);
|
|
3495
|
+
if (!module || !this.isHierarchicalModule(module))
|
|
3496
|
+
return [];
|
|
3497
|
+
const workspaceId = this.workspaceId();
|
|
3498
|
+
return (module.values || [])
|
|
3499
|
+
.filter((value) => this.matchesWorkspace(value, module.workspaceId, workspaceId))
|
|
3500
|
+
.map((value) => ({
|
|
3501
|
+
id: value.id,
|
|
3502
|
+
name: value.name,
|
|
3503
|
+
selector: value.selector,
|
|
3504
|
+
moduleTypeId: module.id,
|
|
3505
|
+
}));
|
|
3506
|
+
}
|
|
3470
3507
|
/**
|
|
3471
3508
|
* Module options for a selection, scoped to the selected type:
|
|
3472
3509
|
* - hierarchical type -> children of the chosen workspace (empty until chosen)
|
|
@@ -3476,7 +3513,7 @@ class SelectionConfiguration {
|
|
|
3476
3513
|
const selection = this.selectionsArray.at(selectionIndex);
|
|
3477
3514
|
// For hierarchical (Level) types the parent is the single chart-level
|
|
3478
3515
|
// workspace; flat types ignore it.
|
|
3479
|
-
return this.getModuleOptions(selection?.get('service')?.value, selection?.get('moduleType')?.value, this.chartWorkspace());
|
|
3516
|
+
return this.getModuleOptions(selection?.get('service')?.value, selection?.get('moduleType')?.value, this.chartWorkspace() ?? selection?.get('parentSelector')?.value ?? null);
|
|
3480
3517
|
}
|
|
3481
3518
|
getModuleOptions(serviceName, moduleTypeId, parentSelector) {
|
|
3482
3519
|
const key = `${serviceName ?? ''}::${moduleTypeId ?? ''}::${parentSelector ?? ''}::${this.workspaceId() ?? ''}`;
|
|
@@ -3686,6 +3723,16 @@ class SelectionConfiguration {
|
|
|
3686
3723
|
selectorName: null,
|
|
3687
3724
|
});
|
|
3688
3725
|
}
|
|
3726
|
+
onParentSelectorChange(selectionIndex) {
|
|
3727
|
+
if (this.structureLocked()) {
|
|
3728
|
+
return;
|
|
3729
|
+
}
|
|
3730
|
+
const selection = this.selectionsArray.at(selectionIndex);
|
|
3731
|
+
selection.patchValue({
|
|
3732
|
+
selector: null,
|
|
3733
|
+
selectorName: null,
|
|
3734
|
+
});
|
|
3735
|
+
}
|
|
3689
3736
|
/**
|
|
3690
3737
|
* Handle module selection change
|
|
3691
3738
|
*/
|
|
@@ -3699,7 +3746,7 @@ class SelectionConfiguration {
|
|
|
3699
3746
|
const selectionId = selection.get('id')?.value;
|
|
3700
3747
|
const serviceName = selection.get('service')?.value;
|
|
3701
3748
|
const moduleType = selection.get('moduleType')?.value;
|
|
3702
|
-
const parentSelector = selection.get('parentSelector')?.value;
|
|
3749
|
+
const parentSelector = this.chartWorkspace() ?? selection.get('parentSelector')?.value ?? null;
|
|
3703
3750
|
// Find the selected module name from the (type-scoped) options
|
|
3704
3751
|
const options = this.getModuleOptions(serviceName, moduleType, parentSelector);
|
|
3705
3752
|
const selectorName = options.find((item) => item.selector === selector)?.name ?? selector;
|
|
@@ -3729,7 +3776,7 @@ class SelectionConfiguration {
|
|
|
3729
3776
|
return;
|
|
3730
3777
|
}
|
|
3731
3778
|
const combinedSelector = this.combineSelectors(sameTypeSelectors);
|
|
3732
|
-
const selectorName = this.buildSelectorName(selection.get('service')?.value, sameTypeSelectors, selection.get('moduleType')?.value, selection.get('parentSelector')?.value);
|
|
3779
|
+
const selectorName = this.buildSelectorName(selection.get('service')?.value, sameTypeSelectors, selection.get('moduleType')?.value, this.chartWorkspace() ?? selection.get('parentSelector')?.value ?? null);
|
|
3733
3780
|
selection.patchValue({ selector: combinedSelector, selectorName }, { emitEvent: false });
|
|
3734
3781
|
this.emitValue();
|
|
3735
3782
|
this.moduleChange.emit({
|
|
@@ -3986,7 +4033,7 @@ class SelectionConfiguration {
|
|
|
3986
4033
|
useExisting: forwardRef(() => SelectionConfiguration),
|
|
3987
4034
|
multi: true,
|
|
3988
4035
|
},
|
|
3989
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <mt-card [title]=\"t('selections')\">\r\n <ng-template #cardEnd>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n (onClick)=\"addSelection()\"\r\n [disabled]=\"disabled || loadingTree()\"\r\n [pTooltip]=\"t('addSelection')\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Loading Skeleton State - Show for entire component while tree is loading -->\r\n @if (loadingTree()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Skeleton Selection Card -->\r\n <div class=\"p-4 rounded-lg border border-surface-200\">\r\n <!-- Skeleton Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <p-skeleton shape=\"circle\" width=\"24px\" height=\"24px\" />\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Module Selection -->\r\n <div class=\"grid grid-cols-1 gap-4 mb-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"60px\" height=\"14px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Filters Section -->\r\n <div class=\"border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <p-skeleton width=\"50px\" height=\"14px\" />\r\n <div class=\"flex gap-1\">\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n </div>\r\n </div>\r\n <div class=\"text-center py-4\">\r\n <p-skeleton width=\"150px\" height=\"14px\" styleClass=\"mx-auto\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-col gap-4\" [formGroup]=\"selectionsForm\">\r\n <div formArrayName=\"selections\">\r\n @for (\r\n selection of selectionsArray.controls;\r\n track trackBySelectionId($index, selection);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all mb-4 last:mb-0\"\r\n [class.border-red-500]=\"selection.invalid\"\r\n [class.border-surface-200]=\"!selection.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Selection Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full text-sm font-semibold\"\r\n [class.bg-primary-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.text-primary-600]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-100]=\"isFixedSelection(selection.value.id)\"\r\n [class.text-amber-600]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n >\r\n @if (isFixedSelection(selection.value.id)) {\r\n <i class=\"mti mti-lock-01 text-xs\"></i>\r\n } @else {\r\n {{ selection.value.id }}\r\n }\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">\r\n @if (isFixedSelection(selection.value.id)) {\r\n {{ t(\"fixedSelection\") }}\r\n } @else {\r\n {{ t(\"selection\") }}\r\n }\r\n </span>\r\n </div>\r\n @if (\r\n selectionsArray.length > 1 &&\r\n !isSelectionStructureLocked(selection.value.id)\r\n ) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeSelection(i)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Service (own row, only when multiple services) -->\r\n @if (!hasSingleService()) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('service')\"\r\n formControlName=\"service\"\r\n [options]=\"services()\"\r\n optionLabel=\"name\"\r\n optionValue=\"name\"\r\n [placeholder]=\"t('selectService')\"\r\n [loading]=\"loadingTree()\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onServiceChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Type (radio cards) \u2014 scopes Workspace + Module to one type -->\r\n @if (getTypeOptionsForSelection(i).length) {\r\n <div class=\"mb-4\">\r\n <mt-radio-cards-field\r\n [label]=\"t('type')\"\r\n formControlName=\"moduleType\"\r\n [options]=\"getTypeOptionsForSelection(i)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n size=\"small\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Module values (scoped to the selected type + chart workspace).\r\n The workspace is chosen once at the chart level, so there is\r\n no per-selection workspace picker here anymore. -->\r\n <div class=\"mb-4\">\r\n <mt-multi-select-field\r\n [label]=\"t('module')\"\r\n [ngModel]=\"getSelectorValues(i)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [options]=\"getModuleOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectModule')\"\r\n [filter]=\"true\"\r\n [virtualScroll]=\"true\"\r\n [virtualScrollItemSize]=\"38\"\r\n [showClear]=\"!isSelectionStructureLocked(selection.value.id)\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onModuleSelectionChange(i, $event)\"\r\n />\r\n </div>\r\n <!-- Hint: pick a type first -->\r\n @if (!getModuleTypeValue(i)) {\r\n <small class=\"text-muted-color mt-1 block mb-2\">{{\r\n t(\"selectTypeHint\")\r\n }}</small>\r\n }\r\n @if (\r\n selection.get(\"selector\")?.invalid &&\r\n selection.get(\"selector\")?.touched\r\n ) {\r\n <small class=\"text-red-500 mt-1 block mb-2\">{{\r\n t(\"moduleRequired\")\r\n }}</small>\r\n }\r\n\r\n <!-- Filters Section -->\r\n <div\r\n class=\"border border-surface-200 rounded-lg p-4\"\r\n [class.border-red-500]=\"getFilters(selection).invalid\"\r\n [class.border-amber-200]=\"isFixedSelection(selection.value.id)\"\r\n [class.bg-amber-50]=\"isFixedSelection(selection.value.id)\"\r\n >\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"filters\") }}</span>\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"flex items-center gap-1\">\r\n <mt-button\r\n icon=\"general.copy-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"\r\n disabled || getFilters(selection).length === 0\r\n \"\r\n (onClick)=\"copyFilters(i)\"\r\n [pTooltip]=\"t('copyFilters')\"\r\n />\r\n <mt-button\r\n icon=\"file.clipboard\"\r\n severity=\"help\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"togglePaste(i)\"\r\n [pTooltip]=\"t('pasteFilters')\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n } @else {\r\n <span class=\"text-xs text-amber-600 font-medium\">\r\n <i class=\"mti mti-lock-01 mr-1\"></i>\r\n {{ t(\"readOnly\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Paste JSON Area -->\r\n @if (selection.value.showPaste) {\r\n <div\r\n class=\"mb-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteFiltersJson')\"\r\n formControlName=\"filterJson\"\r\n [placeholder]=\"t('pasteFiltersJsonPlaceholder')\"\r\n [rows]=\"4\"\r\n />\r\n @if (selection.value.pasteError) {\r\n <small class=\"text-red-500 mt-1 block\">{{\r\n selection.value.pasteError\r\n }}</small>\r\n }\r\n <div class=\"flex justify-end gap-2 mt-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePaste(i)\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedFilters(i)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Filters List -->\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(selection).controls;\r\n track trackByFilterIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"flex flex-col gap-3 p-3 rounded-lg border\"\r\n [class.bg-surface-50]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.border-surface-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-25]=\"isFixedSelection(selection.value.id)\"\r\n [class.border-amber-100]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Row 1: Property, Operation, Logical -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Property Key -->\r\n <div class=\"col-span-5\">\r\n <mt-select-field\r\n [label]=\"t('property')\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"getPropertiesForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n (onChange)=\"onFilterPropertyChange(i, j, $event)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('operation')\"\r\n formControlName=\"operation\"\r\n [options]=\"operations\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"t('logical')\"\r\n formControlName=\"logical\"\r\n [options]=\"logicals\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter (hidden for fixed selections) -->\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"col-span-2 flex items-end justify-end\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n } @else {\r\n <div class=\"col-span-2\"></div>\r\n }\r\n </div>\r\n\r\n <!-- Row 2: Value, Level -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Value: unified select-or-write field. When the\r\n property exposes a fixed value list (lookup/status)\r\n the field surfaces it as a \"Values\" tab; otherwise\r\n a literal/token can be typed or picked. -->\r\n <div class=\"col-span-10\">\r\n <mt-filter-value-field\r\n [label]=\"t('value')\"\r\n formControlName=\"propertyValue\"\r\n [propertyKey]=\"filter.get('propertyKey')?.value\"\r\n [placeholder]=\"t('enterValue')\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation Level -->\r\n <div class=\"col-span-2\">\r\n <mt-number-field\r\n [label]=\"t('level')\"\r\n formControlName=\"operationLevel\"\r\n [min]=\"1\"\r\n [max]=\"10\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(selection).length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (selectionsArray.length === 0 && !loadingTree()) {\r\n <div class=\"text-center py-8 text-muted-color\">\r\n <i class=\"mti mti-database text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSelectionsConfigured\") }}</p>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSelection')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSelection()\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: RadioCardsField, selector: "mt-radio-cards-field", inputs: ["circle", "label", "hint", "readonly", "required", "color", "size", "optionLabel", "optionValue", "options"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: FilterValueField, selector: "mt-filter-value-field", inputs: ["label", "placeholder", "extraProperties", "propertyKey", "showPivotTokens", "readonly"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4036
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <mt-card [title]=\"t('selections')\">\r\n <ng-template #cardEnd>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n (onClick)=\"addSelection()\"\r\n [disabled]=\"disabled || loadingTree()\"\r\n [pTooltip]=\"t('addSelection')\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Loading Skeleton State - Show for entire component while tree is loading -->\r\n @if (loadingTree()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Skeleton Selection Card -->\r\n <div class=\"p-4 rounded-lg border border-surface-200\">\r\n <!-- Skeleton Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <p-skeleton shape=\"circle\" width=\"24px\" height=\"24px\" />\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Module Selection -->\r\n <div class=\"grid grid-cols-1 gap-4 mb-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"60px\" height=\"14px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Filters Section -->\r\n <div class=\"border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <p-skeleton width=\"50px\" height=\"14px\" />\r\n <div class=\"flex gap-1\">\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n </div>\r\n </div>\r\n <div class=\"text-center py-4\">\r\n <p-skeleton width=\"150px\" height=\"14px\" styleClass=\"mx-auto\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-col gap-4\" [formGroup]=\"selectionsForm\">\r\n <div formArrayName=\"selections\">\r\n @for (\r\n selection of selectionsArray.controls;\r\n track trackBySelectionId($index, selection);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all mb-4 last:mb-0\"\r\n [class.border-red-500]=\"selection.invalid\"\r\n [class.border-surface-200]=\"!selection.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Selection Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full text-sm font-semibold\"\r\n [class.bg-primary-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.text-primary-600]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-100]=\"isFixedSelection(selection.value.id)\"\r\n [class.text-amber-600]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n >\r\n @if (isFixedSelection(selection.value.id)) {\r\n <i class=\"mti mti-lock-01 text-xs\"></i>\r\n } @else {\r\n {{ selection.value.id }}\r\n }\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">\r\n @if (isFixedSelection(selection.value.id)) {\r\n {{ t(\"fixedSelection\") }}\r\n } @else {\r\n {{ t(\"selection\") }}\r\n }\r\n </span>\r\n </div>\r\n @if (\r\n selectionsArray.length > 1 &&\r\n !isSelectionStructureLocked(selection.value.id)\r\n ) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeSelection(i)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Service (own row, only when multiple services) -->\r\n @if (!hasSingleService()) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('service')\"\r\n formControlName=\"service\"\r\n [options]=\"services()\"\r\n optionLabel=\"name\"\r\n optionValue=\"name\"\r\n [placeholder]=\"t('selectService')\"\r\n [loading]=\"loadingTree()\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onServiceChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Type (radio cards) \u2014 scopes Workspace + Module to one type -->\r\n @if (getTypeOptionsForSelection(i).length) {\r\n <div class=\"mb-4\">\r\n <mt-radio-cards-field\r\n [label]=\"t('type')\"\r\n formControlName=\"moduleType\"\r\n [options]=\"getTypeOptionsForSelection(i)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n size=\"small\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (shouldShowParentWorkspace(i)) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('workspace')\"\r\n formControlName=\"parentSelector\"\r\n [options]=\"getParentOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onParentSelectorChange(i)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Module values (scoped to the selected type + chart workspace).\r\n When a parent workspace is not supplied by the caller, the\r\n local parentSelector fallback scopes hierarchical modules. -->\r\n <div class=\"mb-4\">\r\n <mt-multi-select-field\r\n [label]=\"t('module')\"\r\n [ngModel]=\"getSelectorValues(i)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [options]=\"getModuleOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectModule')\"\r\n [filter]=\"true\"\r\n [virtualScroll]=\"true\"\r\n [virtualScrollItemSize]=\"38\"\r\n [showClear]=\"!isSelectionStructureLocked(selection.value.id)\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onModuleSelectionChange(i, $event)\"\r\n />\r\n </div>\r\n <!-- Hint: pick a type first -->\r\n @if (!getModuleTypeValue(i)) {\r\n <small class=\"text-muted-color mt-1 block mb-2\">{{\r\n t(\"selectTypeHint\")\r\n }}</small>\r\n }\r\n @if (\r\n selection.get(\"selector\")?.invalid &&\r\n selection.get(\"selector\")?.touched\r\n ) {\r\n <small class=\"text-red-500 mt-1 block mb-2\">{{\r\n t(\"moduleRequired\")\r\n }}</small>\r\n }\r\n\r\n <!-- Filters Section -->\r\n <div\r\n class=\"border border-surface-200 rounded-lg p-4\"\r\n [class.border-red-500]=\"getFilters(selection).invalid\"\r\n [class.border-amber-200]=\"isFixedSelection(selection.value.id)\"\r\n [class.bg-amber-50]=\"isFixedSelection(selection.value.id)\"\r\n >\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"filters\") }}</span>\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"flex items-center gap-1\">\r\n <mt-button\r\n icon=\"general.copy-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"\r\n disabled || getFilters(selection).length === 0\r\n \"\r\n (onClick)=\"copyFilters(i)\"\r\n [pTooltip]=\"t('copyFilters')\"\r\n />\r\n <mt-button\r\n icon=\"file.clipboard\"\r\n severity=\"help\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"togglePaste(i)\"\r\n [pTooltip]=\"t('pasteFilters')\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n } @else {\r\n <span class=\"text-xs text-amber-600 font-medium\">\r\n <i class=\"mti mti-lock-01 mr-1\"></i>\r\n {{ t(\"readOnly\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Paste JSON Area -->\r\n @if (selection.value.showPaste) {\r\n <div\r\n class=\"mb-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteFiltersJson')\"\r\n formControlName=\"filterJson\"\r\n [placeholder]=\"t('pasteFiltersJsonPlaceholder')\"\r\n [rows]=\"4\"\r\n />\r\n @if (selection.value.pasteError) {\r\n <small class=\"text-red-500 mt-1 block\">{{\r\n selection.value.pasteError\r\n }}</small>\r\n }\r\n <div class=\"flex justify-end gap-2 mt-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePaste(i)\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedFilters(i)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Filters List -->\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(selection).controls;\r\n track trackByFilterIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"flex flex-col gap-3 p-3 rounded-lg border\"\r\n [class.bg-surface-50]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.border-surface-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-25]=\"isFixedSelection(selection.value.id)\"\r\n [class.border-amber-100]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Row 1: Property, Operation, Logical -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Property Key -->\r\n <div class=\"col-span-5\">\r\n <mt-select-field\r\n [label]=\"t('property')\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"getPropertiesForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n (onChange)=\"onFilterPropertyChange(i, j, $event)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('operation')\"\r\n formControlName=\"operation\"\r\n [options]=\"operations\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"t('logical')\"\r\n formControlName=\"logical\"\r\n [options]=\"logicals\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter (hidden for fixed selections) -->\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"col-span-2 flex items-end justify-end\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n } @else {\r\n <div class=\"col-span-2\"></div>\r\n }\r\n </div>\r\n\r\n <!-- Row 2: Value, Level -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Value: unified select-or-write field. When the\r\n property exposes a fixed value list (lookup/status)\r\n the field surfaces it as a \"Values\" tab; otherwise\r\n a literal/token can be typed or picked. -->\r\n <div class=\"col-span-10\">\r\n <mt-filter-value-field\r\n [label]=\"t('value')\"\r\n formControlName=\"propertyValue\"\r\n [propertyKey]=\"filter.get('propertyKey')?.value\"\r\n [placeholder]=\"t('enterValue')\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation Level -->\r\n <div class=\"col-span-2\">\r\n <mt-number-field\r\n [label]=\"t('level')\"\r\n formControlName=\"operationLevel\"\r\n [min]=\"1\"\r\n [max]=\"10\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(selection).length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (selectionsArray.length === 0 && !loadingTree()) {\r\n <div class=\"text-center py-8 text-muted-color\">\r\n <i class=\"mti mti-database text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSelectionsConfigured\") }}</p>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSelection')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSelection()\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: RadioCardsField, selector: "mt-radio-cards-field", inputs: ["circle", "label", "hint", "readonly", "required", "color", "size", "optionLabel", "optionValue", "options"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: FilterValueField, selector: "mt-filter-value-field", inputs: ["label", "placeholder", "extraProperties", "propertyKey", "showPivotTokens", "readonly"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3990
4037
|
}
|
|
3991
4038
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SelectionConfiguration, decorators: [{
|
|
3992
4039
|
type: Component,
|
|
@@ -4016,7 +4063,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4016
4063
|
useExisting: forwardRef(() => SelectionConfiguration),
|
|
4017
4064
|
multi: true,
|
|
4018
4065
|
},
|
|
4019
|
-
], template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <mt-card [title]=\"t('selections')\">\r\n <ng-template #cardEnd>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n (onClick)=\"addSelection()\"\r\n [disabled]=\"disabled || loadingTree()\"\r\n [pTooltip]=\"t('addSelection')\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Loading Skeleton State - Show for entire component while tree is loading -->\r\n @if (loadingTree()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Skeleton Selection Card -->\r\n <div class=\"p-4 rounded-lg border border-surface-200\">\r\n <!-- Skeleton Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <p-skeleton shape=\"circle\" width=\"24px\" height=\"24px\" />\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Module Selection -->\r\n <div class=\"grid grid-cols-1 gap-4 mb-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"60px\" height=\"14px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Filters Section -->\r\n <div class=\"border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <p-skeleton width=\"50px\" height=\"14px\" />\r\n <div class=\"flex gap-1\">\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n </div>\r\n </div>\r\n <div class=\"text-center py-4\">\r\n <p-skeleton width=\"150px\" height=\"14px\" styleClass=\"mx-auto\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-col gap-4\" [formGroup]=\"selectionsForm\">\r\n <div formArrayName=\"selections\">\r\n @for (\r\n selection of selectionsArray.controls;\r\n track trackBySelectionId($index, selection);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all mb-4 last:mb-0\"\r\n [class.border-red-500]=\"selection.invalid\"\r\n [class.border-surface-200]=\"!selection.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Selection Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full text-sm font-semibold\"\r\n [class.bg-primary-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.text-primary-600]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-100]=\"isFixedSelection(selection.value.id)\"\r\n [class.text-amber-600]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n >\r\n @if (isFixedSelection(selection.value.id)) {\r\n <i class=\"mti mti-lock-01 text-xs\"></i>\r\n } @else {\r\n {{ selection.value.id }}\r\n }\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">\r\n @if (isFixedSelection(selection.value.id)) {\r\n {{ t(\"fixedSelection\") }}\r\n } @else {\r\n {{ t(\"selection\") }}\r\n }\r\n </span>\r\n </div>\r\n @if (\r\n selectionsArray.length > 1 &&\r\n !isSelectionStructureLocked(selection.value.id)\r\n ) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeSelection(i)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Service (own row, only when multiple services) -->\r\n @if (!hasSingleService()) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('service')\"\r\n formControlName=\"service\"\r\n [options]=\"services()\"\r\n optionLabel=\"name\"\r\n optionValue=\"name\"\r\n [placeholder]=\"t('selectService')\"\r\n [loading]=\"loadingTree()\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onServiceChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Type (radio cards) \u2014 scopes Workspace + Module to one type -->\r\n @if (getTypeOptionsForSelection(i).length) {\r\n <div class=\"mb-4\">\r\n <mt-radio-cards-field\r\n [label]=\"t('type')\"\r\n formControlName=\"moduleType\"\r\n [options]=\"getTypeOptionsForSelection(i)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n size=\"small\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Module values (scoped to the selected type + chart workspace).\r\n The workspace is chosen once at the chart level, so there is\r\n no per-selection workspace picker here anymore. -->\r\n <div class=\"mb-4\">\r\n <mt-multi-select-field\r\n [label]=\"t('module')\"\r\n [ngModel]=\"getSelectorValues(i)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [options]=\"getModuleOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectModule')\"\r\n [filter]=\"true\"\r\n [virtualScroll]=\"true\"\r\n [virtualScrollItemSize]=\"38\"\r\n [showClear]=\"!isSelectionStructureLocked(selection.value.id)\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onModuleSelectionChange(i, $event)\"\r\n />\r\n </div>\r\n <!-- Hint: pick a type first -->\r\n @if (!getModuleTypeValue(i)) {\r\n <small class=\"text-muted-color mt-1 block mb-2\">{{\r\n t(\"selectTypeHint\")\r\n }}</small>\r\n }\r\n @if (\r\n selection.get(\"selector\")?.invalid &&\r\n selection.get(\"selector\")?.touched\r\n ) {\r\n <small class=\"text-red-500 mt-1 block mb-2\">{{\r\n t(\"moduleRequired\")\r\n }}</small>\r\n }\r\n\r\n <!-- Filters Section -->\r\n <div\r\n class=\"border border-surface-200 rounded-lg p-4\"\r\n [class.border-red-500]=\"getFilters(selection).invalid\"\r\n [class.border-amber-200]=\"isFixedSelection(selection.value.id)\"\r\n [class.bg-amber-50]=\"isFixedSelection(selection.value.id)\"\r\n >\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"filters\") }}</span>\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"flex items-center gap-1\">\r\n <mt-button\r\n icon=\"general.copy-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"\r\n disabled || getFilters(selection).length === 0\r\n \"\r\n (onClick)=\"copyFilters(i)\"\r\n [pTooltip]=\"t('copyFilters')\"\r\n />\r\n <mt-button\r\n icon=\"file.clipboard\"\r\n severity=\"help\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"togglePaste(i)\"\r\n [pTooltip]=\"t('pasteFilters')\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n } @else {\r\n <span class=\"text-xs text-amber-600 font-medium\">\r\n <i class=\"mti mti-lock-01 mr-1\"></i>\r\n {{ t(\"readOnly\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Paste JSON Area -->\r\n @if (selection.value.showPaste) {\r\n <div\r\n class=\"mb-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteFiltersJson')\"\r\n formControlName=\"filterJson\"\r\n [placeholder]=\"t('pasteFiltersJsonPlaceholder')\"\r\n [rows]=\"4\"\r\n />\r\n @if (selection.value.pasteError) {\r\n <small class=\"text-red-500 mt-1 block\">{{\r\n selection.value.pasteError\r\n }}</small>\r\n }\r\n <div class=\"flex justify-end gap-2 mt-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePaste(i)\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedFilters(i)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Filters List -->\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(selection).controls;\r\n track trackByFilterIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"flex flex-col gap-3 p-3 rounded-lg border\"\r\n [class.bg-surface-50]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.border-surface-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-25]=\"isFixedSelection(selection.value.id)\"\r\n [class.border-amber-100]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Row 1: Property, Operation, Logical -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Property Key -->\r\n <div class=\"col-span-5\">\r\n <mt-select-field\r\n [label]=\"t('property')\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"getPropertiesForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n (onChange)=\"onFilterPropertyChange(i, j, $event)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('operation')\"\r\n formControlName=\"operation\"\r\n [options]=\"operations\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"t('logical')\"\r\n formControlName=\"logical\"\r\n [options]=\"logicals\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter (hidden for fixed selections) -->\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"col-span-2 flex items-end justify-end\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n } @else {\r\n <div class=\"col-span-2\"></div>\r\n }\r\n </div>\r\n\r\n <!-- Row 2: Value, Level -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Value: unified select-or-write field. When the\r\n property exposes a fixed value list (lookup/status)\r\n the field surfaces it as a \"Values\" tab; otherwise\r\n a literal/token can be typed or picked. -->\r\n <div class=\"col-span-10\">\r\n <mt-filter-value-field\r\n [label]=\"t('value')\"\r\n formControlName=\"propertyValue\"\r\n [propertyKey]=\"filter.get('propertyKey')?.value\"\r\n [placeholder]=\"t('enterValue')\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation Level -->\r\n <div class=\"col-span-2\">\r\n <mt-number-field\r\n [label]=\"t('level')\"\r\n formControlName=\"operationLevel\"\r\n [min]=\"1\"\r\n [max]=\"10\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(selection).length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (selectionsArray.length === 0 && !loadingTree()) {\r\n <div class=\"text-center py-8 text-muted-color\">\r\n <i class=\"mti mti-database text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSelectionsConfigured\") }}</p>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSelection')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSelection()\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </mt-card>\r\n</div>\r\n" }]
|
|
4066
|
+
], template: "<div class=\"flex flex-col gap-4\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <mt-card [title]=\"t('selections')\">\r\n <ng-template #cardEnd>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n (onClick)=\"addSelection()\"\r\n [disabled]=\"disabled || loadingTree()\"\r\n [pTooltip]=\"t('addSelection')\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Loading Skeleton State - Show for entire component while tree is loading -->\r\n @if (loadingTree()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Skeleton Selection Card -->\r\n <div class=\"p-4 rounded-lg border border-surface-200\">\r\n <!-- Skeleton Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <p-skeleton shape=\"circle\" width=\"24px\" height=\"24px\" />\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Module Selection -->\r\n <div class=\"grid grid-cols-1 gap-4 mb-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"60px\" height=\"14px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n <!-- Skeleton Filters Section -->\r\n <div class=\"border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <p-skeleton width=\"50px\" height=\"14px\" />\r\n <div class=\"flex gap-1\">\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n <p-skeleton shape=\"circle\" width=\"28px\" height=\"28px\" />\r\n </div>\r\n </div>\r\n <div class=\"text-center py-4\">\r\n <p-skeleton width=\"150px\" height=\"14px\" styleClass=\"mx-auto\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex flex-col gap-4\" [formGroup]=\"selectionsForm\">\r\n <div formArrayName=\"selections\">\r\n @for (\r\n selection of selectionsArray.controls;\r\n track trackBySelectionId($index, selection);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all mb-4 last:mb-0\"\r\n [class.border-red-500]=\"selection.invalid\"\r\n [class.border-surface-200]=\"!selection.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Selection Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full text-sm font-semibold\"\r\n [class.bg-primary-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.text-primary-600]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-100]=\"isFixedSelection(selection.value.id)\"\r\n [class.text-amber-600]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n >\r\n @if (isFixedSelection(selection.value.id)) {\r\n <i class=\"mti mti-lock-01 text-xs\"></i>\r\n } @else {\r\n {{ selection.value.id }}\r\n }\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">\r\n @if (isFixedSelection(selection.value.id)) {\r\n {{ t(\"fixedSelection\") }}\r\n } @else {\r\n {{ t(\"selection\") }}\r\n }\r\n </span>\r\n </div>\r\n @if (\r\n selectionsArray.length > 1 &&\r\n !isSelectionStructureLocked(selection.value.id)\r\n ) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeSelection(i)\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Service (own row, only when multiple services) -->\r\n @if (!hasSingleService()) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('service')\"\r\n formControlName=\"service\"\r\n [options]=\"services()\"\r\n optionLabel=\"name\"\r\n optionValue=\"name\"\r\n [placeholder]=\"t('selectService')\"\r\n [loading]=\"loadingTree()\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onServiceChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Type (radio cards) \u2014 scopes Workspace + Module to one type -->\r\n @if (getTypeOptionsForSelection(i).length) {\r\n <div class=\"mb-4\">\r\n <mt-radio-cards-field\r\n [label]=\"t('type')\"\r\n formControlName=\"moduleType\"\r\n [options]=\"getTypeOptionsForSelection(i)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n size=\"small\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (shouldShowParentWorkspace(i)) {\r\n <div class=\"mb-4\">\r\n <mt-select-field\r\n [label]=\"t('workspace')\"\r\n formControlName=\"parentSelector\"\r\n [options]=\"getParentOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onParentSelectorChange(i)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Module values (scoped to the selected type + chart workspace).\r\n When a parent workspace is not supplied by the caller, the\r\n local parentSelector fallback scopes hierarchical modules. -->\r\n <div class=\"mb-4\">\r\n <mt-multi-select-field\r\n [label]=\"t('module')\"\r\n [ngModel]=\"getSelectorValues(i)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n [options]=\"getModuleOptionsForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"selector\"\r\n [placeholder]=\"t('selectModule')\"\r\n [filter]=\"true\"\r\n [virtualScroll]=\"true\"\r\n [virtualScrollItemSize]=\"38\"\r\n [showClear]=\"!isSelectionStructureLocked(selection.value.id)\"\r\n [readonly]=\"isSelectionStructureLocked(selection.value.id)\"\r\n (ngModelChange)=\"onModuleSelectionChange(i, $event)\"\r\n />\r\n </div>\r\n <!-- Hint: pick a type first -->\r\n @if (!getModuleTypeValue(i)) {\r\n <small class=\"text-muted-color mt-1 block mb-2\">{{\r\n t(\"selectTypeHint\")\r\n }}</small>\r\n }\r\n @if (\r\n selection.get(\"selector\")?.invalid &&\r\n selection.get(\"selector\")?.touched\r\n ) {\r\n <small class=\"text-red-500 mt-1 block mb-2\">{{\r\n t(\"moduleRequired\")\r\n }}</small>\r\n }\r\n\r\n <!-- Filters Section -->\r\n <div\r\n class=\"border border-surface-200 rounded-lg p-4\"\r\n [class.border-red-500]=\"getFilters(selection).invalid\"\r\n [class.border-amber-200]=\"isFixedSelection(selection.value.id)\"\r\n [class.bg-amber-50]=\"isFixedSelection(selection.value.id)\"\r\n >\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"filters\") }}</span>\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"flex items-center gap-1\">\r\n <mt-button\r\n icon=\"general.copy-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"\r\n disabled || getFilters(selection).length === 0\r\n \"\r\n (onClick)=\"copyFilters(i)\"\r\n [pTooltip]=\"t('copyFilters')\"\r\n />\r\n <mt-button\r\n icon=\"file.clipboard\"\r\n severity=\"help\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"togglePaste(i)\"\r\n [pTooltip]=\"t('pasteFilters')\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n } @else {\r\n <span class=\"text-xs text-amber-600 font-medium\">\r\n <i class=\"mti mti-lock-01 mr-1\"></i>\r\n {{ t(\"readOnly\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Paste JSON Area -->\r\n @if (selection.value.showPaste) {\r\n <div\r\n class=\"mb-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteFiltersJson')\"\r\n formControlName=\"filterJson\"\r\n [placeholder]=\"t('pasteFiltersJsonPlaceholder')\"\r\n [rows]=\"4\"\r\n />\r\n @if (selection.value.pasteError) {\r\n <small class=\"text-red-500 mt-1 block\">{{\r\n selection.value.pasteError\r\n }}</small>\r\n }\r\n <div class=\"flex justify-end gap-2 mt-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePaste(i)\"\r\n />\r\n <mt-button\r\n [label]=\"t('apply')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedFilters(i)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- Filters List -->\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(selection).controls;\r\n track trackByFilterIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"flex flex-col gap-3 p-3 rounded-lg border\"\r\n [class.bg-surface-50]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.border-surface-100]=\"\r\n !isFixedSelection(selection.value.id)\r\n \"\r\n [class.bg-amber-25]=\"isFixedSelection(selection.value.id)\"\r\n [class.border-amber-100]=\"\r\n isFixedSelection(selection.value.id)\r\n \"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Row 1: Property, Operation, Logical -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Property Key -->\r\n <div class=\"col-span-5\">\r\n <mt-select-field\r\n [label]=\"t('property')\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"getPropertiesForSelection(i)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n (onChange)=\"onFilterPropertyChange(i, j, $event)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation -->\r\n <div class=\"col-span-3\">\r\n <mt-select-field\r\n [label]=\"t('operation')\"\r\n formControlName=\"operation\"\r\n [options]=\"operations\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"t('logical')\"\r\n formControlName=\"logical\"\r\n [options]=\"logicals\"\r\n optionLabel=\"name\"\r\n optionValue=\"value\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter (hidden for fixed selections) -->\r\n @if (!isFixedSelection(selection.value.id)) {\r\n <div class=\"col-span-2 flex items-end justify-end\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n } @else {\r\n <div class=\"col-span-2\"></div>\r\n }\r\n </div>\r\n\r\n <!-- Row 2: Value, Level -->\r\n <div class=\"grid grid-cols-12 gap-3\">\r\n <!-- Value: unified select-or-write field. When the\r\n property exposes a fixed value list (lookup/status)\r\n the field surfaces it as a \"Values\" tab; otherwise\r\n a literal/token can be typed or picked. -->\r\n <div class=\"col-span-10\">\r\n <mt-filter-value-field\r\n [label]=\"t('value')\"\r\n formControlName=\"propertyValue\"\r\n [propertyKey]=\"filter.get('propertyKey')?.value\"\r\n [placeholder]=\"t('enterValue')\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n\r\n <!-- Operation Level -->\r\n <div class=\"col-span-2\">\r\n <mt-number-field\r\n [label]=\"t('level')\"\r\n formControlName=\"operationLevel\"\r\n [min]=\"1\"\r\n [max]=\"10\"\r\n [readonly]=\"isFixedSelection(selection.value.id)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(selection).length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (selectionsArray.length === 0 && !loadingTree()) {\r\n <div class=\"text-center py-8 text-muted-color\">\r\n <i class=\"mti mti-database text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSelectionsConfigured\") }}</p>\r\n @if (!structureLocked()) {\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSelection')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSelection()\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </mt-card>\r\n</div>\r\n" }]
|
|
4020
4067
|
}], ctorParameters: () => [], propDecorators: { structureLocked: [{ type: i0.Input, args: [{ isSignal: true, alias: "structureLocked", required: false }] }], workspaceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "workspaceId", required: false }] }], chartWorkspace: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartWorkspace", required: false }] }], modulesProperties: [{ type: i0.Input, args: [{ isSignal: true, alias: "modulesProperties", required: false }] }], propertiesFlat: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesFlat", required: false }] }], moduleChange: [{ type: i0.Output, args: ["moduleChange"] }] } });
|
|
4021
4068
|
|
|
4022
4069
|
/**
|
|
@@ -4042,6 +4089,10 @@ class DynamicFiltersConfig {
|
|
|
4042
4089
|
levelLogs = input([], ...(ngDevMode ? [{ debugName: "levelLogs" }] : /* istanbul ignore next */ []));
|
|
4043
4090
|
/** Product type to filter available field types */
|
|
4044
4091
|
productType = input('pplus', ...(ngDevMode ? [{ debugName: "productType" }] : /* istanbul ignore next */ []));
|
|
4092
|
+
/** Workspace metadata scope used by the shared datasource selection editor. */
|
|
4093
|
+
workspaceId = input(null, ...(ngDevMode ? [{ debugName: "workspaceId" }] : /* istanbul ignore next */ []));
|
|
4094
|
+
/** Template/workspace selector used to scope hierarchical Level modules. */
|
|
4095
|
+
chartWorkspace = input(null, ...(ngDevMode ? [{ debugName: "chartWorkspace" }] : /* istanbul ignore next */ []));
|
|
4045
4096
|
/** Emit when level logs need to be loaded for a specific schema level */
|
|
4046
4097
|
loadLevelLogs = output();
|
|
4047
4098
|
/** Filter fields data */
|
|
@@ -4070,7 +4121,7 @@ class DynamicFiltersConfig {
|
|
|
4070
4121
|
writeValue(value) {
|
|
4071
4122
|
const fields = (value ?? []).map((field) => this.normalizeField(field));
|
|
4072
4123
|
this.filterFields.set(fields);
|
|
4073
|
-
fields.forEach((field
|
|
4124
|
+
fields.forEach((field) => {
|
|
4074
4125
|
if (field.type === 'status' && field.configuration?.schemaLevelId) {
|
|
4075
4126
|
this.loadLevelLogs.emit(field.configuration.schemaLevelId);
|
|
4076
4127
|
}
|
|
@@ -4205,7 +4256,8 @@ class DynamicFiltersConfig {
|
|
|
4205
4256
|
}
|
|
4206
4257
|
openDropdownConfig(index, field) {
|
|
4207
4258
|
this.activeDropdownConfigIndex.set(index);
|
|
4208
|
-
this.
|
|
4259
|
+
const nextField = this.applyDropdownPayloadContext(index);
|
|
4260
|
+
this.loadDropdownProperties(index, this.getDropdownSelections(nextField ?? field));
|
|
4209
4261
|
}
|
|
4210
4262
|
closeDropdownConfig(index) {
|
|
4211
4263
|
if (this.activeDropdownConfigIndex() === index) {
|
|
@@ -4292,7 +4344,7 @@ class DynamicFiltersConfig {
|
|
|
4292
4344
|
}
|
|
4293
4345
|
getFieldTitle(field, index) {
|
|
4294
4346
|
const name = field.name?.en || field.name?.ar;
|
|
4295
|
-
return name || field.key || this.getFieldTypeLabel(field.type) || `#${index + 1}
|
|
4347
|
+
return (name || field.key || this.getFieldTypeLabel(field.type) || `#${index + 1}`);
|
|
4296
4348
|
}
|
|
4297
4349
|
getFieldTypeLabel(type) {
|
|
4298
4350
|
return (this.availableFieldTypes().find((item) => item.value === type)?.label ??
|
|
@@ -4336,6 +4388,12 @@ class DynamicFiltersConfig {
|
|
|
4336
4388
|
getSelectedProperties(field) {
|
|
4337
4389
|
return field.configuration?.payload?.query?.selectedProperties ?? [];
|
|
4338
4390
|
}
|
|
4391
|
+
getDropdownWorkspaceId(field) {
|
|
4392
|
+
return field.configuration?.payload?.workspaceId ?? this.workspaceId();
|
|
4393
|
+
}
|
|
4394
|
+
getDropdownChartWorkspace(field) {
|
|
4395
|
+
return field.configuration?.payload?.workspace ?? this.chartWorkspace();
|
|
4396
|
+
}
|
|
4339
4397
|
getModulesPropertiesForField(index) {
|
|
4340
4398
|
return this.fieldModulesProperties()[index] ?? this.emptyModulesProperties;
|
|
4341
4399
|
}
|
|
@@ -4375,7 +4433,9 @@ class DynamicFiltersConfig {
|
|
|
4375
4433
|
...field,
|
|
4376
4434
|
type,
|
|
4377
4435
|
key: this.requiresKey(type) ? field.key : undefined,
|
|
4378
|
-
name: this.requiresName(type)
|
|
4436
|
+
name: this.requiresName(type)
|
|
4437
|
+
? (field.name ?? { en: '', ar: '' })
|
|
4438
|
+
: undefined,
|
|
4379
4439
|
configuration: this.createConfigurationForType(type, field.configuration),
|
|
4380
4440
|
};
|
|
4381
4441
|
}
|
|
@@ -4429,13 +4489,15 @@ class DynamicFiltersConfig {
|
|
|
4429
4489
|
ensurePayload(current) {
|
|
4430
4490
|
return {
|
|
4431
4491
|
dashboardId: current?.dashboardId ?? 0,
|
|
4492
|
+
workspaceId: current?.workspaceId ?? this.workspaceId(),
|
|
4493
|
+
workspace: current?.workspace ?? this.chartWorkspace(),
|
|
4432
4494
|
chartType: current?.chartType ?? 'TableView',
|
|
4433
4495
|
selection: current?.selection?.length
|
|
4434
4496
|
? this.normalizeSelections(current.selection)
|
|
4435
4497
|
: [
|
|
4436
4498
|
{
|
|
4437
4499
|
id: 1,
|
|
4438
|
-
service:
|
|
4500
|
+
service: this.resolveDefaultService(),
|
|
4439
4501
|
selector: null,
|
|
4440
4502
|
selectorName: null,
|
|
4441
4503
|
filters: [],
|
|
@@ -4449,7 +4511,7 @@ class DynamicFiltersConfig {
|
|
|
4449
4511
|
loadDropdownProperties(index, selections) {
|
|
4450
4512
|
const items = (selections ?? [])
|
|
4451
4513
|
.map((selection) => ({
|
|
4452
|
-
serviceName: selection.service
|
|
4514
|
+
serviceName: this.resolveSelectionService(selection.service),
|
|
4453
4515
|
selector: selection.selector ??
|
|
4454
4516
|
selectorFromLegacy(selection.moduleType, selection.moduleId),
|
|
4455
4517
|
}))
|
|
@@ -4501,17 +4563,65 @@ class DynamicFiltersConfig {
|
|
|
4501
4563
|
return (selections ?? []).map((selection, index) => ({
|
|
4502
4564
|
...selection,
|
|
4503
4565
|
id: selection.id ?? index + 1,
|
|
4504
|
-
service: selection.service
|
|
4566
|
+
service: this.resolveSelectionService(selection.service),
|
|
4505
4567
|
selector: selection.selector ??
|
|
4506
4568
|
selectorFromLegacy(selection.moduleType, selection.moduleId),
|
|
4507
4569
|
selectorName: selection.selectorName ?? null,
|
|
4508
4570
|
filters: selection.filters ?? [],
|
|
4509
4571
|
}));
|
|
4510
4572
|
}
|
|
4573
|
+
applyDropdownPayloadContext(index) {
|
|
4574
|
+
const field = this.filterFields()[index];
|
|
4575
|
+
if (!field || field.type !== 'dropdownTVService')
|
|
4576
|
+
return field ?? null;
|
|
4577
|
+
const payload = this.ensurePayload(field.configuration?.payload);
|
|
4578
|
+
const currentPayload = field.configuration?.payload;
|
|
4579
|
+
if (currentPayload?.workspaceId === payload.workspaceId &&
|
|
4580
|
+
currentPayload?.workspace === payload.workspace) {
|
|
4581
|
+
return field;
|
|
4582
|
+
}
|
|
4583
|
+
let nextField = null;
|
|
4584
|
+
this.filterFields.update((fields) => {
|
|
4585
|
+
const newFields = [...fields];
|
|
4586
|
+
nextField = {
|
|
4587
|
+
...field,
|
|
4588
|
+
configuration: {
|
|
4589
|
+
...field.configuration,
|
|
4590
|
+
payload,
|
|
4591
|
+
},
|
|
4592
|
+
};
|
|
4593
|
+
newFields[index] = nextField;
|
|
4594
|
+
return newFields;
|
|
4595
|
+
});
|
|
4596
|
+
this.notifyChange();
|
|
4597
|
+
return nextField;
|
|
4598
|
+
}
|
|
4599
|
+
resolveDefaultService() {
|
|
4600
|
+
const treeServices = this.dashboardService.treeData();
|
|
4601
|
+
if (treeServices.length === 1) {
|
|
4602
|
+
return treeServices[0].serviceName;
|
|
4603
|
+
}
|
|
4604
|
+
const configuredServices = this.dashboardService.modulesTreeServices();
|
|
4605
|
+
if (configuredServices?.length === 1) {
|
|
4606
|
+
return configuredServices[0];
|
|
4607
|
+
}
|
|
4608
|
+
return null;
|
|
4609
|
+
}
|
|
4610
|
+
resolveSelectionService(service) {
|
|
4611
|
+
const treeServices = this.dashboardService.treeData();
|
|
4612
|
+
const defaultService = this.resolveDefaultService();
|
|
4613
|
+
if (!service)
|
|
4614
|
+
return defaultService;
|
|
4615
|
+
if (treeServices.length === 1 &&
|
|
4616
|
+
!treeServices.some((item) => item.serviceName === service)) {
|
|
4617
|
+
return defaultService;
|
|
4618
|
+
}
|
|
4619
|
+
return service;
|
|
4620
|
+
}
|
|
4511
4621
|
getSelectionSignature(selections) {
|
|
4512
4622
|
return JSON.stringify(this.normalizeSelections(selections).map((selection) => ({
|
|
4513
4623
|
id: selection.id,
|
|
4514
|
-
service: selection.service
|
|
4624
|
+
service: this.resolveSelectionService(selection.service),
|
|
4515
4625
|
selector: selection.selector ??
|
|
4516
4626
|
selectorFromLegacy(selection.moduleType, selection.moduleId),
|
|
4517
4627
|
filters: selection.filters ?? [],
|
|
@@ -4543,13 +4653,13 @@ class DynamicFiltersConfig {
|
|
|
4543
4653
|
this.dropdownPropertiesSignatureByIndex.clear();
|
|
4544
4654
|
}
|
|
4545
4655
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DynamicFiltersConfig, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4546
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DynamicFiltersConfig, isStandalone: true, selector: "mt-dynamic-filters-config", inputs: { lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogs: { classPropertyName: "levelLogs", publicName: "levelLogs", isSignal: true, isRequired: false, transformFunction: null }, productType: { classPropertyName: "productType", publicName: "productType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loadLevelLogs: "loadLevelLogs" }, providers: [
|
|
4656
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DynamicFiltersConfig, isStandalone: true, selector: "mt-dynamic-filters-config", inputs: { lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogs: { classPropertyName: "levelLogs", publicName: "levelLogs", isSignal: true, isRequired: false, transformFunction: null }, productType: { classPropertyName: "productType", publicName: "productType", isSignal: true, isRequired: false, transformFunction: null }, workspaceId: { classPropertyName: "workspaceId", publicName: "workspaceId", isSignal: true, isRequired: false, transformFunction: null }, chartWorkspace: { classPropertyName: "chartWorkspace", publicName: "chartWorkspace", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loadLevelLogs: "loadLevelLogs" }, providers: [
|
|
4547
4657
|
{
|
|
4548
4658
|
provide: NG_VALUE_ACCESSOR,
|
|
4549
4659
|
useExisting: forwardRef(() => DynamicFiltersConfig),
|
|
4550
4660
|
multi: true,
|
|
4551
4661
|
},
|
|
4552
|
-
], ngImport: i0, template: "<div\n class=\"flex flex-col gap-3\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 border-b border-surface-200 pb-3\"\n >\n <h3 class=\"text-base font-semibold text-surface-800\">\n {{ t(\"filterFieldsConfiguration\") }}\n </h3>\n <div class=\"flex items-center gap-1.5\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addField')\"\n severity=\"primary\"\n size=\"small\"\n (onClick)=\"addFilterField()\"\n [disabled]=\"disabled()\"\n />\n <mt-button\n icon=\"general.copy-06\"\n [pTooltip]=\"t('copyConfiguration')\"\n tooltipPosition=\"top\"\n severity=\"secondary\"\n size=\"small\"\n [rounded]=\"true\"\n (onClick)=\"copyConfiguration()\"\n />\n <mt-button\n icon=\"general.clipboard\"\n [pTooltip]=\"t('pasteConfiguration')\"\n tooltipPosition=\"top\"\n severity=\"secondary\"\n size=\"small\"\n [rounded]=\"true\"\n (onClick)=\"togglePasteArea()\"\n />\n </div>\n </div>\n\n @if (showPasteArea()) {\n <div\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 p-3\"\n >\n <mt-textarea-field\n [label]=\"t('pasteConfigurationHere')\"\n [rows]=\"6\"\n [ngModel]=\"pasteContent()\"\n (ngModelChange)=\"pasteContent.set($event)\"\n [placeholder]=\"t('pasteJsonConfiguration')\"\n />\n @if (pasteError()) {\n <div class=\"text-sm text-red-500\">{{ pasteError() }}</div>\n }\n <div class=\"flex justify-end gap-2\">\n <mt-button\n [label]=\"t('cancel')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"togglePasteArea()\"\n />\n <mt-button\n [label]=\"t('applyConfiguration')\"\n size=\"small\"\n (onClick)=\"applyPastedConfiguration()\"\n />\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n @for (field of filterFields(); track trackByIndex($index); let i = $index) {\n <section\n class=\"overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\n >\n <div\n class=\"flex items-center justify-between gap-3 border-b border-surface-200 bg-surface-100 px-3 py-2\"\n >\n <div class=\"min-w-0\">\n <div class=\"truncate text-sm font-semibold text-surface-800\">\n {{ getFieldTitle(field, i) }}\n </div>\n <div class=\"text-xs text-muted-color\">\n {{ getFieldTypeLabel(field.type) }}\n </div>\n </div>\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n size=\"small\"\n [rounded]=\"true\"\n [text]=\"true\"\n (onClick)=\"removeFilterField(i)\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3 p-3\">\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('fieldType')\"\n [options]=\"availableFieldTypes()\"\n optionValue=\"value\"\n optionLabel=\"label\"\n [ngModel]=\"field.type\"\n (ngModelChange)=\"onFieldTypeChange(i, $event)\"\n />\n\n @if (requiresKey(field.type)) {\n <mt-text-field\n [label]=\"t('fieldKey')\"\n [placeholder]=\"t('enterFieldKey')\"\n [ngModel]=\"field.key\"\n (ngModelChange)=\"updateField(i, 'key', $event)\"\n />\n }\n\n @if (requiresName(field.type)) {\n <mt-text-field\n [label]=\"t('nameEnglish')\"\n [placeholder]=\"t('enterEnglishName')\"\n [ngModel]=\"field.name?.en\"\n (ngModelChange)=\"updateFieldName(i, 'en', $event)\"\n />\n <mt-text-field\n [label]=\"t('nameArabic')\"\n [placeholder]=\"t('enterArabicName')\"\n [ngModel]=\"field.name?.ar\"\n (ngModelChange)=\"updateFieldName(i, 'ar', $event)\"\n />\n }\n </div>\n\n @if (hasTypeConfiguration(field)) {\n <div\n class=\"flex w-full flex-col gap-3 rounded-md border border-surface-200 bg-surface-50 p-3\"\n >\n <div class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"settings\") }}\n </div>\n\n @switch (field.type) {\n @case (\"dropdownTVService\") {\n @if (isDropdownConfigOpen(i)) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"t('close')\"\n icon=\"general.x-close\"\n severity=\"secondary\"\n size=\"small\"\n [text]=\"true\"\n (onClick)=\"closeDropdownConfig(i)\"\n />\n </div>\n\n <mt-selection-configuration\n class=\"block w-full\"\n [ngModel]=\"getDropdownSelections(field)\"\n (ngModelChange)=\"updateDropdownSelections(i, $event)\"\n (moduleChange)=\"onDropdownModuleChange(i, $event)\"\n [modulesProperties]=\"getModulesPropertiesForField(i)\"\n [propertiesFlat]=\"getPropertiesFlatForField(i)\"\n />\n\n <mt-multi-select-field\n class=\"block w-full\"\n [label]=\"t('selectedProperties')\"\n [options]=\"getPropertiesFlatForField(i)\"\n optionValue=\"key\"\n optionLabel=\"name\"\n [filter]=\"true\"\n [ngModel]=\"getSelectedProperties(field)\"\n (ngModelChange)=\"updateSelectedProperties(i, $event)\"\n />\n } @else {\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-surface-200 bg-surface-0 px-3 py-2\"\n >\n <span class=\"text-sm text-muted-color\">\n {{ getDropdownSummary(field) }}\n </span>\n <mt-button\n [label]=\"t('selectionsConfiguration')\"\n icon=\"general.settings-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"openDropdownConfig(i, field)\"\n />\n </div>\n }\n }\n\n @case (\"lookup\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('lookupId')\"\n [options]=\"lookups()\"\n optionValue=\"id\"\n optionLabel=\"displayName\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.lookupId\"\n (ngModelChange)=\"updateFieldConfig(i, 'lookupId', $event)\"\n />\n </div>\n }\n\n @case (\"status\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('schemaLevelId')\"\n [options]=\"levelsSchema()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.schemaLevelId\"\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\n />\n\n @if (field.configuration?.schemaLevelId) {\n <mt-select-field\n [label]=\"t('logId')\"\n [options]=\"levelLogs()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.logId\"\n (ngModelChange)=\"updateFieldConfig(i, 'logId', $event)\"\n />\n }\n </div>\n }\n\n @case (\"phaseGate\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('schemaLevelId')\"\n [options]=\"levelsSchema()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.schemaLevelId\"\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\n />\n </div>\n }\n\n @case (\"checkbox\") {\n <mt-toggle-field\n [label]=\"t('defaultChecked')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.checked ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'checked', $event)\"\n />\n }\n\n @case (\"year\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-number-field\n [label]=\"t('minYear')\"\n [placeholder]=\"t('minYear')\"\n [ngModel]=\"field.configuration?.minYear\"\n (ngModelChange)=\"updateFieldConfig(i, 'minYear', $event)\"\n />\n <mt-number-field\n [label]=\"t('maxYear')\"\n [placeholder]=\"t('maxYear')\"\n [ngModel]=\"field.configuration?.maxYear\"\n (ngModelChange)=\"updateFieldConfig(i, 'maxYear', $event)\"\n />\n </div>\n }\n }\n </div>\n }\n\n <div class=\"flex flex-wrap items-center gap-4\">\n @if (supportsRequired(field)) {\n <mt-toggle-field\n [label]=\"t('isRequired')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.isRequird ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'isRequird', $event)\"\n />\n }\n\n @if (supportsMultiple(field)) {\n <mt-toggle-field\n [label]=\"t('isMultiple')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.isMultiple ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'isMultiple', $event)\"\n />\n }\n </div>\n </div>\n </section>\n } @empty {\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-surface-300 py-10 text-center text-muted-color\"\n >\n <mt-icon icon=\"general.filter-lines\" class=\"text-3xl\" />\n <p class=\"text-sm font-medium\">{{ t(\"noFilterFieldsConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addField')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addFilterField()\"\n [disabled]=\"disabled()\"\n />\n </div>\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { 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: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4662
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-3\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 border-b border-surface-200 pb-3\"\r\n >\r\n <h3 class=\"text-base font-semibold text-surface-800\">\r\n {{ t(\"filterFieldsConfiguration\") }}\r\n </h3>\r\n <div class=\"flex items-center gap-1.5\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addField')\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n (onClick)=\"addFilterField()\"\r\n [disabled]=\"disabled()\"\r\n />\r\n <mt-button\r\n icon=\"general.copy-06\"\r\n [pTooltip]=\"t('copyConfiguration')\"\r\n tooltipPosition=\"top\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n (onClick)=\"copyConfiguration()\"\r\n />\r\n <mt-button\r\n icon=\"general.clipboard\"\r\n [pTooltip]=\"t('pasteConfiguration')\"\r\n tooltipPosition=\"top\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n (onClick)=\"togglePasteArea()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n @if (showPasteArea()) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 p-3\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteConfigurationHere')\"\r\n [rows]=\"6\"\r\n [ngModel]=\"pasteContent()\"\r\n (ngModelChange)=\"pasteContent.set($event)\"\r\n [placeholder]=\"t('pasteJsonConfiguration')\"\r\n />\r\n @if (pasteError()) {\r\n <div class=\"text-sm text-red-500\">{{ pasteError() }}</div>\r\n }\r\n <div class=\"flex justify-end gap-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePasteArea()\"\r\n />\r\n <mt-button\r\n [label]=\"t('applyConfiguration')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedConfiguration()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"flex flex-col gap-3\">\r\n @for (field of filterFields(); track trackByIndex($index); let i = $index) {\r\n <section\r\n class=\"overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <div\r\n class=\"flex items-center justify-between gap-3 border-b border-surface-200 bg-surface-100 px-3 py-2\"\r\n >\r\n <div class=\"min-w-0\">\r\n <div class=\"truncate text-sm font-semibold text-surface-800\">\r\n {{ getFieldTitle(field, i) }}\r\n </div>\r\n <div class=\"text-xs text-muted-color\">\r\n {{ getFieldTypeLabel(field.type) }}\r\n </div>\r\n </div>\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n (onClick)=\"removeFilterField(i)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3 p-3\">\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('fieldType')\"\r\n [options]=\"availableFieldTypes()\"\r\n optionValue=\"value\"\r\n optionLabel=\"label\"\r\n [ngModel]=\"field.type\"\r\n (ngModelChange)=\"onFieldTypeChange(i, $event)\"\r\n />\r\n\r\n @if (requiresKey(field.type)) {\r\n <mt-text-field\r\n [label]=\"t('fieldKey')\"\r\n [placeholder]=\"t('enterFieldKey')\"\r\n [ngModel]=\"field.key\"\r\n (ngModelChange)=\"updateField(i, 'key', $event)\"\r\n />\r\n }\r\n\r\n @if (requiresName(field.type)) {\r\n <mt-text-field\r\n [label]=\"t('nameEnglish')\"\r\n [placeholder]=\"t('enterEnglishName')\"\r\n [ngModel]=\"field.name?.en\"\r\n (ngModelChange)=\"updateFieldName(i, 'en', $event)\"\r\n />\r\n <mt-text-field\r\n [label]=\"t('nameArabic')\"\r\n [placeholder]=\"t('enterArabicName')\"\r\n [ngModel]=\"field.name?.ar\"\r\n (ngModelChange)=\"updateFieldName(i, 'ar', $event)\"\r\n />\r\n }\r\n </div>\r\n\r\n @if (hasTypeConfiguration(field)) {\r\n <div\r\n class=\"flex w-full flex-col gap-3 rounded-md border border-surface-200 bg-surface-50 p-3\"\r\n >\r\n <div class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"settings\") }}\r\n </div>\r\n\r\n @switch (field.type) {\r\n @case (\"dropdownTVService\") {\r\n @if (isDropdownConfigOpen(i)) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('close')\"\r\n icon=\"general.x-close\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n (onClick)=\"closeDropdownConfig(i)\"\r\n />\r\n </div>\r\n\r\n <mt-selection-configuration\r\n class=\"block w-full\"\r\n [workspaceId]=\"getDropdownWorkspaceId(field)\"\r\n [chartWorkspace]=\"getDropdownChartWorkspace(field)\"\r\n [ngModel]=\"getDropdownSelections(field)\"\r\n (ngModelChange)=\"updateDropdownSelections(i, $event)\"\r\n (moduleChange)=\"onDropdownModuleChange(i, $event)\"\r\n [modulesProperties]=\"getModulesPropertiesForField(i)\"\r\n [propertiesFlat]=\"getPropertiesFlatForField(i)\"\r\n />\r\n\r\n <mt-multi-select-field\r\n class=\"block w-full\"\r\n [label]=\"t('selectedProperties')\"\r\n [options]=\"getPropertiesFlatForField(i)\"\r\n optionValue=\"key\"\r\n optionLabel=\"name\"\r\n [filter]=\"true\"\r\n [ngModel]=\"getSelectedProperties(field)\"\r\n (ngModelChange)=\"updateSelectedProperties(i, $event)\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span class=\"text-sm text-muted-color\">\r\n {{ getDropdownSummary(field) }}\r\n </span>\r\n <mt-button\r\n [label]=\"t('selectionsConfiguration')\"\r\n icon=\"general.settings-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"openDropdownConfig(i, field)\"\r\n />\r\n </div>\r\n }\r\n }\r\n\r\n @case (\"lookup\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('lookupId')\"\r\n [options]=\"lookups()\"\r\n optionValue=\"id\"\r\n optionLabel=\"displayName\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.lookupId\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'lookupId', $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case (\"status\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('schemaLevelId')\"\r\n [options]=\"levelsSchema()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.schemaLevelId\"\r\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\r\n />\r\n\r\n @if (field.configuration?.schemaLevelId) {\r\n <mt-select-field\r\n [label]=\"t('logId')\"\r\n [options]=\"levelLogs()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.logId\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'logId', $event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n @case (\"phaseGate\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('schemaLevelId')\"\r\n [options]=\"levelsSchema()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.schemaLevelId\"\r\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case (\"checkbox\") {\r\n <mt-toggle-field\r\n [label]=\"t('defaultChecked')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.checked ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'checked', $event)\"\r\n />\r\n }\r\n\r\n @case (\"year\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-number-field\r\n [label]=\"t('minYear')\"\r\n [placeholder]=\"t('minYear')\"\r\n [ngModel]=\"field.configuration?.minYear\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'minYear', $event)\"\r\n />\r\n <mt-number-field\r\n [label]=\"t('maxYear')\"\r\n [placeholder]=\"t('maxYear')\"\r\n [ngModel]=\"field.configuration?.maxYear\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'maxYear', $event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"flex flex-wrap items-center gap-4\">\r\n @if (supportsRequired(field)) {\r\n <mt-toggle-field\r\n [label]=\"t('isRequired')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.isRequird ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'isRequird', $event)\"\r\n />\r\n }\r\n\r\n @if (supportsMultiple(field)) {\r\n <mt-toggle-field\r\n [label]=\"t('isMultiple')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.isMultiple ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'isMultiple', $event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n </section>\r\n } @empty {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-surface-300 py-10 text-center text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.filter-lines\" class=\"text-3xl\" />\r\n <p class=\"text-sm font-medium\">{{ t(\"noFilterFieldsConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addField')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"addFilterField()\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { 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: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4553
4663
|
}
|
|
4554
4664
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DynamicFiltersConfig, decorators: [{
|
|
4555
4665
|
type: Component,
|
|
@@ -4572,8 +4682,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4572
4682
|
useExisting: forwardRef(() => DynamicFiltersConfig),
|
|
4573
4683
|
multi: true,
|
|
4574
4684
|
},
|
|
4575
|
-
], template: "<div\n class=\"flex flex-col gap-3\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n>\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 border-b border-surface-200 pb-3\"\n >\n <h3 class=\"text-base font-semibold text-surface-800\">\n {{ t(\"filterFieldsConfiguration\") }}\n </h3>\n <div class=\"flex items-center gap-1.5\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addField')\"\n severity=\"primary\"\n size=\"small\"\n (onClick)=\"addFilterField()\"\n [disabled]=\"disabled()\"\n />\n <mt-button\n icon=\"general.copy-06\"\n [pTooltip]=\"t('copyConfiguration')\"\n tooltipPosition=\"top\"\n severity=\"secondary\"\n size=\"small\"\n [rounded]=\"true\"\n (onClick)=\"copyConfiguration()\"\n />\n <mt-button\n icon=\"general.clipboard\"\n [pTooltip]=\"t('pasteConfiguration')\"\n tooltipPosition=\"top\"\n severity=\"secondary\"\n size=\"small\"\n [rounded]=\"true\"\n (onClick)=\"togglePasteArea()\"\n />\n </div>\n </div>\n\n @if (showPasteArea()) {\n <div\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 p-3\"\n >\n <mt-textarea-field\n [label]=\"t('pasteConfigurationHere')\"\n [rows]=\"6\"\n [ngModel]=\"pasteContent()\"\n (ngModelChange)=\"pasteContent.set($event)\"\n [placeholder]=\"t('pasteJsonConfiguration')\"\n />\n @if (pasteError()) {\n <div class=\"text-sm text-red-500\">{{ pasteError() }}</div>\n }\n <div class=\"flex justify-end gap-2\">\n <mt-button\n [label]=\"t('cancel')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"togglePasteArea()\"\n />\n <mt-button\n [label]=\"t('applyConfiguration')\"\n size=\"small\"\n (onClick)=\"applyPastedConfiguration()\"\n />\n </div>\n </div>\n }\n\n <div class=\"flex flex-col gap-3\">\n @for (field of filterFields(); track trackByIndex($index); let i = $index) {\n <section\n class=\"overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\n >\n <div\n class=\"flex items-center justify-between gap-3 border-b border-surface-200 bg-surface-100 px-3 py-2\"\n >\n <div class=\"min-w-0\">\n <div class=\"truncate text-sm font-semibold text-surface-800\">\n {{ getFieldTitle(field, i) }}\n </div>\n <div class=\"text-xs text-muted-color\">\n {{ getFieldTypeLabel(field.type) }}\n </div>\n </div>\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n size=\"small\"\n [rounded]=\"true\"\n [text]=\"true\"\n (onClick)=\"removeFilterField(i)\"\n [disabled]=\"disabled()\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3 p-3\">\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('fieldType')\"\n [options]=\"availableFieldTypes()\"\n optionValue=\"value\"\n optionLabel=\"label\"\n [ngModel]=\"field.type\"\n (ngModelChange)=\"onFieldTypeChange(i, $event)\"\n />\n\n @if (requiresKey(field.type)) {\n <mt-text-field\n [label]=\"t('fieldKey')\"\n [placeholder]=\"t('enterFieldKey')\"\n [ngModel]=\"field.key\"\n (ngModelChange)=\"updateField(i, 'key', $event)\"\n />\n }\n\n @if (requiresName(field.type)) {\n <mt-text-field\n [label]=\"t('nameEnglish')\"\n [placeholder]=\"t('enterEnglishName')\"\n [ngModel]=\"field.name?.en\"\n (ngModelChange)=\"updateFieldName(i, 'en', $event)\"\n />\n <mt-text-field\n [label]=\"t('nameArabic')\"\n [placeholder]=\"t('enterArabicName')\"\n [ngModel]=\"field.name?.ar\"\n (ngModelChange)=\"updateFieldName(i, 'ar', $event)\"\n />\n }\n </div>\n\n @if (hasTypeConfiguration(field)) {\n <div\n class=\"flex w-full flex-col gap-3 rounded-md border border-surface-200 bg-surface-50 p-3\"\n >\n <div class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"settings\") }}\n </div>\n\n @switch (field.type) {\n @case (\"dropdownTVService\") {\n @if (isDropdownConfigOpen(i)) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"t('close')\"\n icon=\"general.x-close\"\n severity=\"secondary\"\n size=\"small\"\n [text]=\"true\"\n (onClick)=\"closeDropdownConfig(i)\"\n />\n </div>\n\n <mt-selection-configuration\n class=\"block w-full\"\n [ngModel]=\"getDropdownSelections(field)\"\n (ngModelChange)=\"updateDropdownSelections(i, $event)\"\n (moduleChange)=\"onDropdownModuleChange(i, $event)\"\n [modulesProperties]=\"getModulesPropertiesForField(i)\"\n [propertiesFlat]=\"getPropertiesFlatForField(i)\"\n />\n\n <mt-multi-select-field\n class=\"block w-full\"\n [label]=\"t('selectedProperties')\"\n [options]=\"getPropertiesFlatForField(i)\"\n optionValue=\"key\"\n optionLabel=\"name\"\n [filter]=\"true\"\n [ngModel]=\"getSelectedProperties(field)\"\n (ngModelChange)=\"updateSelectedProperties(i, $event)\"\n />\n } @else {\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-surface-200 bg-surface-0 px-3 py-2\"\n >\n <span class=\"text-sm text-muted-color\">\n {{ getDropdownSummary(field) }}\n </span>\n <mt-button\n [label]=\"t('selectionsConfiguration')\"\n icon=\"general.settings-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"openDropdownConfig(i, field)\"\n />\n </div>\n }\n }\n\n @case (\"lookup\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('lookupId')\"\n [options]=\"lookups()\"\n optionValue=\"id\"\n optionLabel=\"displayName\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.lookupId\"\n (ngModelChange)=\"updateFieldConfig(i, 'lookupId', $event)\"\n />\n </div>\n }\n\n @case (\"status\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('schemaLevelId')\"\n [options]=\"levelsSchema()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.schemaLevelId\"\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\n />\n\n @if (field.configuration?.schemaLevelId) {\n <mt-select-field\n [label]=\"t('logId')\"\n [options]=\"levelLogs()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.logId\"\n (ngModelChange)=\"updateFieldConfig(i, 'logId', $event)\"\n />\n }\n </div>\n }\n\n @case (\"phaseGate\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-select-field\n [label]=\"t('schemaLevelId')\"\n [options]=\"levelsSchema()\"\n optionValue=\"id\"\n optionLabel=\"description\"\n [filter]=\"true\"\n [ngModel]=\"field.configuration?.schemaLevelId\"\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\n />\n </div>\n }\n\n @case (\"checkbox\") {\n <mt-toggle-field\n [label]=\"t('defaultChecked')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.checked ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'checked', $event)\"\n />\n }\n\n @case (\"year\") {\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <mt-number-field\n [label]=\"t('minYear')\"\n [placeholder]=\"t('minYear')\"\n [ngModel]=\"field.configuration?.minYear\"\n (ngModelChange)=\"updateFieldConfig(i, 'minYear', $event)\"\n />\n <mt-number-field\n [label]=\"t('maxYear')\"\n [placeholder]=\"t('maxYear')\"\n [ngModel]=\"field.configuration?.maxYear\"\n (ngModelChange)=\"updateFieldConfig(i, 'maxYear', $event)\"\n />\n </div>\n }\n }\n </div>\n }\n\n <div class=\"flex flex-wrap items-center gap-4\">\n @if (supportsRequired(field)) {\n <mt-toggle-field\n [label]=\"t('isRequired')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.isRequird ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'isRequird', $event)\"\n />\n }\n\n @if (supportsMultiple(field)) {\n <mt-toggle-field\n [label]=\"t('isMultiple')\"\n size=\"small\"\n [ngModel]=\"field.configuration?.isMultiple ?? false\"\n (ngModelChange)=\"updateFieldConfig(i, 'isMultiple', $event)\"\n />\n }\n </div>\n </div>\n </section>\n } @empty {\n <div\n class=\"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-surface-300 py-10 text-center text-muted-color\"\n >\n <mt-icon icon=\"general.filter-lines\" class=\"text-3xl\" />\n <p class=\"text-sm font-medium\">{{ t(\"noFilterFieldsConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addField')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addFilterField()\"\n [disabled]=\"disabled()\"\n />\n </div>\n }\n </div>\n</div>\n" }]
|
|
4576
|
-
}], propDecorators: { lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }], levelLogs: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelLogs", required: false }] }], productType: [{ type: i0.Input, args: [{ isSignal: true, alias: "productType", required: false }] }], loadLevelLogs: [{ type: i0.Output, args: ["loadLevelLogs"] }] } });
|
|
4685
|
+
], template: "<div class=\"flex flex-col gap-3\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 border-b border-surface-200 pb-3\"\r\n >\r\n <h3 class=\"text-base font-semibold text-surface-800\">\r\n {{ t(\"filterFieldsConfiguration\") }}\r\n </h3>\r\n <div class=\"flex items-center gap-1.5\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addField')\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n (onClick)=\"addFilterField()\"\r\n [disabled]=\"disabled()\"\r\n />\r\n <mt-button\r\n icon=\"general.copy-06\"\r\n [pTooltip]=\"t('copyConfiguration')\"\r\n tooltipPosition=\"top\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n (onClick)=\"copyConfiguration()\"\r\n />\r\n <mt-button\r\n icon=\"general.clipboard\"\r\n [pTooltip]=\"t('pasteConfiguration')\"\r\n tooltipPosition=\"top\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n (onClick)=\"togglePasteArea()\"\r\n />\r\n </div>\r\n </div>\r\n\r\n @if (showPasteArea()) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-md border border-surface-200 bg-surface-50 p-3\"\r\n >\r\n <mt-textarea-field\r\n [label]=\"t('pasteConfigurationHere')\"\r\n [rows]=\"6\"\r\n [ngModel]=\"pasteContent()\"\r\n (ngModelChange)=\"pasteContent.set($event)\"\r\n [placeholder]=\"t('pasteJsonConfiguration')\"\r\n />\r\n @if (pasteError()) {\r\n <div class=\"text-sm text-red-500\">{{ pasteError() }}</div>\r\n }\r\n <div class=\"flex justify-end gap-2\">\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"togglePasteArea()\"\r\n />\r\n <mt-button\r\n [label]=\"t('applyConfiguration')\"\r\n size=\"small\"\r\n (onClick)=\"applyPastedConfiguration()\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"flex flex-col gap-3\">\r\n @for (field of filterFields(); track trackByIndex($index); let i = $index) {\r\n <section\r\n class=\"overflow-hidden rounded-md border border-surface-200 bg-surface-0\"\r\n >\r\n <div\r\n class=\"flex items-center justify-between gap-3 border-b border-surface-200 bg-surface-100 px-3 py-2\"\r\n >\r\n <div class=\"min-w-0\">\r\n <div class=\"truncate text-sm font-semibold text-surface-800\">\r\n {{ getFieldTitle(field, i) }}\r\n </div>\r\n <div class=\"text-xs text-muted-color\">\r\n {{ getFieldTypeLabel(field.type) }}\r\n </div>\r\n </div>\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n [text]=\"true\"\r\n (onClick)=\"removeFilterField(i)\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3 p-3\">\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('fieldType')\"\r\n [options]=\"availableFieldTypes()\"\r\n optionValue=\"value\"\r\n optionLabel=\"label\"\r\n [ngModel]=\"field.type\"\r\n (ngModelChange)=\"onFieldTypeChange(i, $event)\"\r\n />\r\n\r\n @if (requiresKey(field.type)) {\r\n <mt-text-field\r\n [label]=\"t('fieldKey')\"\r\n [placeholder]=\"t('enterFieldKey')\"\r\n [ngModel]=\"field.key\"\r\n (ngModelChange)=\"updateField(i, 'key', $event)\"\r\n />\r\n }\r\n\r\n @if (requiresName(field.type)) {\r\n <mt-text-field\r\n [label]=\"t('nameEnglish')\"\r\n [placeholder]=\"t('enterEnglishName')\"\r\n [ngModel]=\"field.name?.en\"\r\n (ngModelChange)=\"updateFieldName(i, 'en', $event)\"\r\n />\r\n <mt-text-field\r\n [label]=\"t('nameArabic')\"\r\n [placeholder]=\"t('enterArabicName')\"\r\n [ngModel]=\"field.name?.ar\"\r\n (ngModelChange)=\"updateFieldName(i, 'ar', $event)\"\r\n />\r\n }\r\n </div>\r\n\r\n @if (hasTypeConfiguration(field)) {\r\n <div\r\n class=\"flex w-full flex-col gap-3 rounded-md border border-surface-200 bg-surface-50 p-3\"\r\n >\r\n <div class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"settings\") }}\r\n </div>\r\n\r\n @switch (field.type) {\r\n @case (\"dropdownTVService\") {\r\n @if (isDropdownConfigOpen(i)) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('close')\"\r\n icon=\"general.x-close\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n (onClick)=\"closeDropdownConfig(i)\"\r\n />\r\n </div>\r\n\r\n <mt-selection-configuration\r\n class=\"block w-full\"\r\n [workspaceId]=\"getDropdownWorkspaceId(field)\"\r\n [chartWorkspace]=\"getDropdownChartWorkspace(field)\"\r\n [ngModel]=\"getDropdownSelections(field)\"\r\n (ngModelChange)=\"updateDropdownSelections(i, $event)\"\r\n (moduleChange)=\"onDropdownModuleChange(i, $event)\"\r\n [modulesProperties]=\"getModulesPropertiesForField(i)\"\r\n [propertiesFlat]=\"getPropertiesFlatForField(i)\"\r\n />\r\n\r\n <mt-multi-select-field\r\n class=\"block w-full\"\r\n [label]=\"t('selectedProperties')\"\r\n [options]=\"getPropertiesFlatForField(i)\"\r\n optionValue=\"key\"\r\n optionLabel=\"name\"\r\n [filter]=\"true\"\r\n [ngModel]=\"getSelectedProperties(field)\"\r\n (ngModelChange)=\"updateSelectedProperties(i, $event)\"\r\n />\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-md border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span class=\"text-sm text-muted-color\">\r\n {{ getDropdownSummary(field) }}\r\n </span>\r\n <mt-button\r\n [label]=\"t('selectionsConfiguration')\"\r\n icon=\"general.settings-01\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"openDropdownConfig(i, field)\"\r\n />\r\n </div>\r\n }\r\n }\r\n\r\n @case (\"lookup\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('lookupId')\"\r\n [options]=\"lookups()\"\r\n optionValue=\"id\"\r\n optionLabel=\"displayName\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.lookupId\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'lookupId', $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case (\"status\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('schemaLevelId')\"\r\n [options]=\"levelsSchema()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.schemaLevelId\"\r\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\r\n />\r\n\r\n @if (field.configuration?.schemaLevelId) {\r\n <mt-select-field\r\n [label]=\"t('logId')\"\r\n [options]=\"levelLogs()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.logId\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'logId', $event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n @case (\"phaseGate\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('schemaLevelId')\"\r\n [options]=\"levelsSchema()\"\r\n optionValue=\"id\"\r\n optionLabel=\"description\"\r\n [filter]=\"true\"\r\n [ngModel]=\"field.configuration?.schemaLevelId\"\r\n (ngModelChange)=\"onSchemaLevelChange(i, $event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case (\"checkbox\") {\r\n <mt-toggle-field\r\n [label]=\"t('defaultChecked')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.checked ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'checked', $event)\"\r\n />\r\n }\r\n\r\n @case (\"year\") {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n <mt-number-field\r\n [label]=\"t('minYear')\"\r\n [placeholder]=\"t('minYear')\"\r\n [ngModel]=\"field.configuration?.minYear\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'minYear', $event)\"\r\n />\r\n <mt-number-field\r\n [label]=\"t('maxYear')\"\r\n [placeholder]=\"t('maxYear')\"\r\n [ngModel]=\"field.configuration?.maxYear\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'maxYear', $event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"flex flex-wrap items-center gap-4\">\r\n @if (supportsRequired(field)) {\r\n <mt-toggle-field\r\n [label]=\"t('isRequired')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.isRequird ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'isRequird', $event)\"\r\n />\r\n }\r\n\r\n @if (supportsMultiple(field)) {\r\n <mt-toggle-field\r\n [label]=\"t('isMultiple')\"\r\n size=\"small\"\r\n [ngModel]=\"field.configuration?.isMultiple ?? false\"\r\n (ngModelChange)=\"updateFieldConfig(i, 'isMultiple', $event)\"\r\n />\r\n }\r\n </div>\r\n </div>\r\n </section>\r\n } @empty {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-surface-300 py-10 text-center text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.filter-lines\" class=\"text-3xl\" />\r\n <p class=\"text-sm font-medium\">{{ t(\"noFilterFieldsConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addField')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n (onClick)=\"addFilterField()\"\r\n [disabled]=\"disabled()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
4686
|
+
}], propDecorators: { lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }], levelLogs: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelLogs", required: false }] }], productType: [{ type: i0.Input, args: [{ isSignal: true, alias: "productType", required: false }] }], workspaceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "workspaceId", required: false }] }], chartWorkspace: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartWorkspace", required: false }] }], loadLevelLogs: [{ type: i0.Output, args: ["loadLevelLogs"] }] } });
|
|
4577
4687
|
|
|
4578
4688
|
/**
|
|
4579
4689
|
* Manage Filter On Page Component
|
|
@@ -4592,6 +4702,10 @@ class ManageFilterOnPage {
|
|
|
4592
4702
|
ref = inject(ModalRef);
|
|
4593
4703
|
/** Input: Initial filters data */
|
|
4594
4704
|
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
4705
|
+
/** Workspace metadata scope reused by dropdown-by-selection fields */
|
|
4706
|
+
workspaceId = input(null, ...(ngDevMode ? [{ debugName: "workspaceId" }] : /* istanbul ignore next */ []));
|
|
4707
|
+
/** Template/workspace selector that scopes hierarchical Level selections */
|
|
4708
|
+
chartWorkspace = input(null, ...(ngDevMode ? [{ debugName: "chartWorkspace" }] : /* istanbul ignore next */ []));
|
|
4595
4709
|
/** Input: Available lookups for dropdown */
|
|
4596
4710
|
lookups = input([], ...(ngDevMode ? [{ debugName: "lookups" }] : /* istanbul ignore next */ []));
|
|
4597
4711
|
/** Input: Available level schemas */
|
|
@@ -4628,7 +4742,7 @@ class ManageFilterOnPage {
|
|
|
4628
4742
|
this.ref.close(null);
|
|
4629
4743
|
}
|
|
4630
4744
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageFilterOnPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4631
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: ManageFilterOnPage, isStandalone: true, selector: "mt-manage-filter-on-page", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div\n class=\"flex-1 min-h-0 overflow-y-auto px-4 py-3\"\n [class]=\"modal.contentClass\"\n >\n <mt-dynamic-filters-config\n class=\"block\"\n [ngModel]=\"filtersConfig()\"\n (ngModelChange)=\"onFiltersChange($event)\"\n [lookups]=\"lookups()\"\n [levelsSchema]=\"levelsSchema()\"\n [levelLogs]=\"levelLogs()\"\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\n />\n </div>\n\n <div\n [class]=\"\r\n modal.footerClass +\r\n ' !h-auto !min-h-0 !justify-end !gap-2 !border-t !border-surface-200 !px-4 !py-3'\r\n \"\r\n >\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('save')\" icon=\"general.save-02\" (onClick)=\"save()\" />\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DynamicFiltersConfig, selector: "mt-dynamic-filters-config", inputs: ["lookups", "levelsSchema", "levelLogs", "productType"], outputs: ["loadLevelLogs"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4745
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: ManageFilterOnPage, isStandalone: true, selector: "mt-manage-filter-on-page", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, workspaceId: { classPropertyName: "workspaceId", publicName: "workspaceId", isSignal: true, isRequired: false, transformFunction: null }, chartWorkspace: { classPropertyName: "chartWorkspace", publicName: "chartWorkspace", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\r\n class=\"flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div\r\n class=\"flex-1 min-h-0 overflow-y-auto px-4 py-3\"\r\n [class]=\"modal.contentClass\"\r\n >\r\n <mt-dynamic-filters-config\r\n class=\"block\"\r\n [ngModel]=\"filtersConfig()\"\r\n (ngModelChange)=\"onFiltersChange($event)\"\r\n [workspaceId]=\"workspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [lookups]=\"lookups()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogs]=\"levelLogs()\"\r\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\r\n />\r\n </div>\r\n\r\n <div\r\n [class]=\"\r\n modal.footerClass +\r\n ' !h-auto !min-h-0 !justify-end !gap-2 !border-t !border-surface-200 !px-4 !py-3'\r\n \"\r\n >\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('save')\" icon=\"general.save-02\" (onClick)=\"save()\" />\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DynamicFiltersConfig, selector: "mt-dynamic-filters-config", inputs: ["lookups", "levelsSchema", "levelLogs", "productType", "workspaceId", "chartWorkspace"], outputs: ["loadLevelLogs"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4632
4746
|
}
|
|
4633
4747
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageFilterOnPage, decorators: [{
|
|
4634
4748
|
type: Component,
|
|
@@ -4638,8 +4752,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
4638
4752
|
TranslocoDirective,
|
|
4639
4753
|
Button,
|
|
4640
4754
|
DynamicFiltersConfig,
|
|
4641
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div\n class=\"flex-1 min-h-0 overflow-y-auto px-4 py-3\"\n [class]=\"modal.contentClass\"\n >\n <mt-dynamic-filters-config\n class=\"block\"\n [ngModel]=\"filtersConfig()\"\n (ngModelChange)=\"onFiltersChange($event)\"\n [lookups]=\"lookups()\"\n [levelsSchema]=\"levelsSchema()\"\n [levelLogs]=\"levelLogs()\"\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\n />\n </div>\n\n <div\n [class]=\"\r\n modal.footerClass +\r\n ' !h-auto !min-h-0 !justify-end !gap-2 !border-t !border-surface-200 !px-4 !py-3'\r\n \"\r\n >\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('save')\" icon=\"general.save-02\" (onClick)=\"save()\" />\r\n </div>\r\n</div>\r\n" }]
|
|
4642
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }] } });
|
|
4755
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"flex h-full min-h-0 flex-col\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <div\r\n class=\"flex-1 min-h-0 overflow-y-auto px-4 py-3\"\r\n [class]=\"modal.contentClass\"\r\n >\r\n <mt-dynamic-filters-config\r\n class=\"block\"\r\n [ngModel]=\"filtersConfig()\"\r\n (ngModelChange)=\"onFiltersChange($event)\"\r\n [workspaceId]=\"workspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [lookups]=\"lookups()\"\r\n [levelsSchema]=\"levelsSchema()\"\r\n [levelLogs]=\"levelLogs()\"\r\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\r\n />\r\n </div>\r\n\r\n <div\r\n [class]=\"\r\n modal.footerClass +\r\n ' !h-auto !min-h-0 !justify-end !gap-2 !border-t !border-surface-200 !px-4 !py-3'\r\n \"\r\n >\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('save')\" icon=\"general.save-02\" (onClick)=\"save()\" />\r\n </div>\r\n</div>\r\n" }]
|
|
4756
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], workspaceId: [{ type: i0.Input, args: [{ isSignal: true, alias: "workspaceId", required: false }] }], chartWorkspace: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartWorkspace", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }] } });
|
|
4643
4757
|
|
|
4644
4758
|
const PATH_TOKEN_RE = /[^.[\]]+/g;
|
|
4645
4759
|
const NUMERIC_RE = /^\d+$/;
|
|
@@ -4801,13 +4915,22 @@ function propertyKeyOf(value) {
|
|
|
4801
4915
|
function selectedPropertyOptions(cfg) {
|
|
4802
4916
|
const query = cfg?.serviceConfig?.query ?? {};
|
|
4803
4917
|
const seen = new Map();
|
|
4918
|
+
const humanize = (key) => key
|
|
4919
|
+
.replace(/^default_template_/i, '')
|
|
4920
|
+
.replace(/[_-]+/g, ' ')
|
|
4921
|
+
.replace(/\b\w/g, (c) => c.toUpperCase())
|
|
4922
|
+
.trim();
|
|
4804
4923
|
const add = (value) => {
|
|
4805
4924
|
const key = propertyKeyOf(value);
|
|
4806
4925
|
if (!key || seen.has(key))
|
|
4807
4926
|
return;
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4927
|
+
// Prefer a real display name from the property object; otherwise show a
|
|
4928
|
+
// humanized key (readable) instead of the raw snake_case key.
|
|
4929
|
+
const obj = value && typeof value === 'object'
|
|
4930
|
+
? value
|
|
4931
|
+
: null;
|
|
4932
|
+
const name = obj?.['name'] ?? obj?.['label'] ?? obj?.['displayName'] ?? obj?.['title'];
|
|
4933
|
+
const label = typeof name === 'string' && name.trim() ? name : humanize(key);
|
|
4811
4934
|
seen.set(key, label);
|
|
4812
4935
|
};
|
|
4813
4936
|
const addAll = (arr) => {
|
|
@@ -4957,14 +5080,6 @@ const CARD_STYLE_SECTION = {
|
|
|
4957
5080
|
path: 'clientConfig.configAsType.padding',
|
|
4958
5081
|
default: 16,
|
|
4959
5082
|
},
|
|
4960
|
-
{
|
|
4961
|
-
key: 'density',
|
|
4962
|
-
label: 'Density',
|
|
4963
|
-
type: 'select',
|
|
4964
|
-
path: 'clientConfig.configAsType.density',
|
|
4965
|
-
default: 'comfortable',
|
|
4966
|
-
options: DENSITY_OPTIONS,
|
|
4967
|
-
},
|
|
4968
5083
|
{
|
|
4969
5084
|
key: 'shadow',
|
|
4970
5085
|
label: 'Shadow',
|
|
@@ -4983,6 +5098,9 @@ const PALETTE_SECTION = {
|
|
|
4983
5098
|
icon: 'editor.palette',
|
|
4984
5099
|
domain: 'style',
|
|
4985
5100
|
scope: 'simple',
|
|
5101
|
+
// Series colors only apply to series charts (bar/pie/line/gauge/…), not
|
|
5102
|
+
// tables / timeline / map (category 'table') or cards.
|
|
5103
|
+
visibleWhen: (_cfg, cap) => cap?.category === 'chart',
|
|
4986
5104
|
fields: [
|
|
4987
5105
|
{
|
|
4988
5106
|
key: 'palette',
|
|
@@ -5068,6 +5186,9 @@ const FORMAT_SECTION = {
|
|
|
5068
5186
|
icon: 'finance.currency-dollar',
|
|
5069
5187
|
domain: 'labelLegendFormat',
|
|
5070
5188
|
scope: 'simple',
|
|
5189
|
+
// Number formatting applies to value charts/cards, not tables / timeline /
|
|
5190
|
+
// map (all category 'table'), which do their own column formatting.
|
|
5191
|
+
visibleWhen: (_cfg, cap) => cap?.category !== 'table',
|
|
5071
5192
|
fields: [
|
|
5072
5193
|
{
|
|
5073
5194
|
key: 'format.type',
|
|
@@ -5104,6 +5225,13 @@ const HEADER_SECTION = {
|
|
|
5104
5225
|
type: 'boolean',
|
|
5105
5226
|
path: 'clientConfig.configAsType.headerCardConfig.isHeaderCentered',
|
|
5106
5227
|
},
|
|
5228
|
+
{
|
|
5229
|
+
// card-content hides the header band when isHeaderHidden is true.
|
|
5230
|
+
key: 'hideHeader',
|
|
5231
|
+
label: 'Hide header',
|
|
5232
|
+
type: 'boolean',
|
|
5233
|
+
path: 'clientConfig.configAsType.headerCardConfig.isHeaderHidden',
|
|
5234
|
+
},
|
|
5107
5235
|
{
|
|
5108
5236
|
// card-content / statistic-card read StyleConfig['border-top-show'].
|
|
5109
5237
|
key: 'borderTop',
|
|
@@ -5112,10 +5240,22 @@ const HEADER_SECTION = {
|
|
|
5112
5240
|
path: 'clientConfig.displayConfig.StyleConfig.border-top-show',
|
|
5113
5241
|
},
|
|
5114
5242
|
{
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5243
|
+
// card-content reads headerConfig().headerColor for the title color.
|
|
5244
|
+
key: 'headerColor',
|
|
5245
|
+
label: 'Header color',
|
|
5246
|
+
type: 'color',
|
|
5247
|
+
path: 'clientConfig.configAsType.headerCardConfig.headerColor',
|
|
5248
|
+
},
|
|
5249
|
+
{
|
|
5250
|
+
// card-content reads headerConfig().headerFontSize (px) for the title.
|
|
5251
|
+
key: 'headerFontSize',
|
|
5252
|
+
label: 'Header font size',
|
|
5253
|
+
type: 'number',
|
|
5254
|
+
min: 8,
|
|
5255
|
+
max: 48,
|
|
5256
|
+
step: 1,
|
|
5257
|
+
path: 'clientConfig.configAsType.headerCardConfig.headerFontSize',
|
|
5258
|
+
default: 14,
|
|
5119
5259
|
},
|
|
5120
5260
|
],
|
|
5121
5261
|
};
|
|
@@ -5125,6 +5265,8 @@ const BEHAVIOR_SECTION = {
|
|
|
5125
5265
|
icon: 'editor.cursor-click-02',
|
|
5126
5266
|
domain: 'behavior',
|
|
5127
5267
|
scope: 'simple',
|
|
5268
|
+
// Hidden for now (per product decision); re-enable by removing visibleWhen.
|
|
5269
|
+
visibleWhen: () => false,
|
|
5128
5270
|
fields: [
|
|
5129
5271
|
{
|
|
5130
5272
|
key: 'filtersBar',
|
|
@@ -6404,6 +6546,53 @@ const MAP_SECTION = {
|
|
|
6404
6546
|
},
|
|
6405
6547
|
],
|
|
6406
6548
|
};
|
|
6549
|
+
// Per-property fields shared by the entity preview AND the card-list / level
|
|
6550
|
+
// card types — all render via entity-preview-card / entities-preview-card,
|
|
6551
|
+
// which read these exact paths (propsConfigAsIndex[index].width/border/hidden/
|
|
6552
|
+
// colorAsProperty + overrideSelectedPropertiesLabels/Colors).
|
|
6553
|
+
const PROPERTY_LABELS_FIELD = {
|
|
6554
|
+
// Per-property labels the renderer reads from
|
|
6555
|
+
// configAsType.overrideSelectedPropertiesLabels[propKey][lang].
|
|
6556
|
+
key: 'propertyTranslations',
|
|
6557
|
+
label: 'Property labels',
|
|
6558
|
+
type: 'keyValueMap',
|
|
6559
|
+
path: 'clientConfig.configAsType.overrideSelectedPropertiesLabels',
|
|
6560
|
+
description: 'Override the displayed label per property.',
|
|
6561
|
+
keysFrom: (cfg) => selectedPropertyOptions(cfg),
|
|
6562
|
+
valueFields: [
|
|
6563
|
+
{ key: 'en', label: 'English', type: 'text', path: 'en' },
|
|
6564
|
+
{ key: 'ar', label: 'Arabic', type: 'text', path: 'ar' },
|
|
6565
|
+
],
|
|
6566
|
+
};
|
|
6567
|
+
const PROPERTY_CONFIG_FIELD = {
|
|
6568
|
+
// Per-property layout — positional array (propsConfigAsIndex[index]) the
|
|
6569
|
+
// entity renderers read; one row per selected property, in order.
|
|
6570
|
+
key: 'propsConfigAsIndex',
|
|
6571
|
+
label: 'Properties configuration',
|
|
6572
|
+
type: 'keyValueMap',
|
|
6573
|
+
path: 'clientConfig.configAsType.propsConfigAsIndex',
|
|
6574
|
+
asArray: true,
|
|
6575
|
+
description: 'Width, border, visibility and color source per property.',
|
|
6576
|
+
keysFrom: (cfg) => selectedPropertyOptions(cfg),
|
|
6577
|
+
valueFields: [
|
|
6578
|
+
{ key: 'width', label: 'Width', type: 'text', path: 'width' },
|
|
6579
|
+
{
|
|
6580
|
+
key: 'colorAsProperty',
|
|
6581
|
+
label: 'Color from',
|
|
6582
|
+
type: 'text',
|
|
6583
|
+
path: 'colorAsProperty',
|
|
6584
|
+
},
|
|
6585
|
+
{ key: 'border', label: 'Border', type: 'boolean', path: 'border' },
|
|
6586
|
+
{ key: 'hidden', label: 'Hidden', type: 'boolean', path: 'hidden' },
|
|
6587
|
+
],
|
|
6588
|
+
};
|
|
6589
|
+
const PROPERTY_COLORS_FIELD = {
|
|
6590
|
+
key: 'propertyColors',
|
|
6591
|
+
label: 'Property colors (JSON)',
|
|
6592
|
+
type: 'json',
|
|
6593
|
+
path: 'clientConfig.configAsType.overrideSelectedPropertiesColors',
|
|
6594
|
+
scope: 'advanced',
|
|
6595
|
+
};
|
|
6407
6596
|
const ENTITY_SECTION = {
|
|
6408
6597
|
key: 'entity-preview',
|
|
6409
6598
|
label: 'Entity preview',
|
|
@@ -6411,13 +6600,9 @@ const ENTITY_SECTION = {
|
|
|
6411
6600
|
domain: 'entity',
|
|
6412
6601
|
scope: 'simple',
|
|
6413
6602
|
fields: [
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
type: 'json',
|
|
6418
|
-
path: 'clientConfig.configAsType.propertiesConfig',
|
|
6419
|
-
scope: 'advanced',
|
|
6420
|
-
},
|
|
6603
|
+
PROPERTY_LABELS_FIELD,
|
|
6604
|
+
PROPERTY_CONFIG_FIELD,
|
|
6605
|
+
PROPERTY_COLORS_FIELD,
|
|
6421
6606
|
{
|
|
6422
6607
|
key: 'badgeColorByCondition',
|
|
6423
6608
|
label: 'Badge color by condition (JSON)',
|
|
@@ -6427,6 +6612,17 @@ const ENTITY_SECTION = {
|
|
|
6427
6612
|
},
|
|
6428
6613
|
],
|
|
6429
6614
|
};
|
|
6615
|
+
// Property settings for card-list / level-card types (listOfLevelCards,
|
|
6616
|
+
// entitiesPreview) — they render via entities-preview-card, which reads the
|
|
6617
|
+
// same per-property paths. Was lost when these moved to LEVEL_CARDS_SECTION.
|
|
6618
|
+
const PROPERTY_SETTINGS_SECTION = {
|
|
6619
|
+
key: 'card-properties',
|
|
6620
|
+
label: 'Property settings',
|
|
6621
|
+
icon: 'general.dots-grid',
|
|
6622
|
+
domain: 'entity',
|
|
6623
|
+
scope: 'simple',
|
|
6624
|
+
fields: [PROPERTY_LABELS_FIELD, PROPERTY_CONFIG_FIELD, PROPERTY_COLORS_FIELD],
|
|
6625
|
+
};
|
|
6430
6626
|
// The performance card renders via entity-preview-card, which has no trend
|
|
6431
6627
|
// concept — every former field here wrote a path no renderer read. Left empty
|
|
6432
6628
|
// (renders nothing) so the card only shows the working common style sections.
|
|
@@ -6833,6 +7029,7 @@ const SCHEMA_DEFS = [
|
|
|
6833
7029
|
sections: [
|
|
6834
7030
|
...COMMON_CHART_BASE,
|
|
6835
7031
|
LEVEL_CARDS_SECTION,
|
|
7032
|
+
PROPERTY_SETTINGS_SECTION,
|
|
6836
7033
|
FORMAT_SECTION,
|
|
6837
7034
|
...COMMON_CHART_TAIL,
|
|
6838
7035
|
],
|
|
@@ -6843,6 +7040,7 @@ const SCHEMA_DEFS = [
|
|
|
6843
7040
|
sections: [
|
|
6844
7041
|
...COMMON_CHART_BASE,
|
|
6845
7042
|
LEVEL_CARDS_SECTION,
|
|
7043
|
+
PROPERTY_SETTINGS_SECTION,
|
|
6846
7044
|
FORMAT_SECTION,
|
|
6847
7045
|
...COMMON_CHART_TAIL,
|
|
6848
7046
|
],
|
|
@@ -8689,101 +8887,6 @@ function readByPath(cfg, path) {
|
|
|
8689
8887
|
* Pass 4/5 - Control Schema public surface.
|
|
8690
8888
|
*/
|
|
8691
8889
|
|
|
8692
|
-
const STYLE_PRESETS = [
|
|
8693
|
-
{
|
|
8694
|
-
key: 'compact',
|
|
8695
|
-
label: 'Compact',
|
|
8696
|
-
description: 'Smaller text, tighter padding, ideal for densely packed boards.',
|
|
8697
|
-
layout: { padding: 8, borderRadius: 6, shadow: 'soft', density: 'compact' },
|
|
8698
|
-
style: { titleFontSize: 14, subtitleFontSize: 12 },
|
|
8699
|
-
labelLegendFormat: { legendShow: true, legendPosition: 'bottom' },
|
|
8700
|
-
},
|
|
8701
|
-
{
|
|
8702
|
-
key: 'standard',
|
|
8703
|
-
label: 'Standard',
|
|
8704
|
-
description: 'Balanced default. Works well in most boards.',
|
|
8705
|
-
layout: {
|
|
8706
|
-
padding: 16,
|
|
8707
|
-
borderRadius: 8,
|
|
8708
|
-
shadow: 'medium',
|
|
8709
|
-
density: 'comfortable',
|
|
8710
|
-
},
|
|
8711
|
-
style: { titleFontSize: 18, subtitleFontSize: 14 },
|
|
8712
|
-
labelLegendFormat: { legendShow: true, legendPosition: 'bottom' },
|
|
8713
|
-
},
|
|
8714
|
-
{
|
|
8715
|
-
key: 'presentation',
|
|
8716
|
-
label: 'Presentation',
|
|
8717
|
-
description: 'Large titles, generous spacing, high-contrast for demos.',
|
|
8718
|
-
layout: {
|
|
8719
|
-
padding: 24,
|
|
8720
|
-
borderRadius: 12,
|
|
8721
|
-
shadow: 'strong',
|
|
8722
|
-
density: 'presentation',
|
|
8723
|
-
},
|
|
8724
|
-
style: { titleFontSize: 22, subtitleFontSize: 16 },
|
|
8725
|
-
labelLegendFormat: { legendShow: true, legendPosition: 'right' },
|
|
8726
|
-
},
|
|
8727
|
-
{
|
|
8728
|
-
key: 'kpi-card',
|
|
8729
|
-
label: 'KPI card',
|
|
8730
|
-
description: 'Big number, subtle border, clean for dashboards summary cards.',
|
|
8731
|
-
layout: {
|
|
8732
|
-
padding: 20,
|
|
8733
|
-
borderRadius: 10,
|
|
8734
|
-
shadow: 'soft',
|
|
8735
|
-
density: 'comfortable',
|
|
8736
|
-
},
|
|
8737
|
-
style: { titleFontSize: 14, subtitleFontSize: 11 },
|
|
8738
|
-
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
8739
|
-
},
|
|
8740
|
-
{
|
|
8741
|
-
key: 'table-dense',
|
|
8742
|
-
label: 'Table — dense',
|
|
8743
|
-
description: 'Compact rows for power users / large tables.',
|
|
8744
|
-
layout: { padding: 8, borderRadius: 4, shadow: 'soft', density: 'compact' },
|
|
8745
|
-
style: { titleFontSize: 14, subtitleFontSize: 11 },
|
|
8746
|
-
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
8747
|
-
},
|
|
8748
|
-
{
|
|
8749
|
-
key: 'table-comfortable',
|
|
8750
|
-
label: 'Table — comfortable',
|
|
8751
|
-
description: 'Generous rows, easier on the eyes for review work.',
|
|
8752
|
-
layout: {
|
|
8753
|
-
padding: 16,
|
|
8754
|
-
borderRadius: 8,
|
|
8755
|
-
shadow: 'soft',
|
|
8756
|
-
density: 'comfortable',
|
|
8757
|
-
},
|
|
8758
|
-
style: { titleFontSize: 16, subtitleFontSize: 13 },
|
|
8759
|
-
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
8760
|
-
},
|
|
8761
|
-
];
|
|
8762
|
-
/**
|
|
8763
|
-
* Recommend the relevant presets for a chart capability — table presets only
|
|
8764
|
-
* for tables, KPI presets only for cards. The popover surfaces this list.
|
|
8765
|
-
*/
|
|
8766
|
-
function presetsForCapability(cap) {
|
|
8767
|
-
if (!cap)
|
|
8768
|
-
return STYLE_PRESETS;
|
|
8769
|
-
if (cap.category === 'table' || cap.id.startsWith('table')) {
|
|
8770
|
-
return STYLE_PRESETS.filter((p) => p.key === 'table-dense' ||
|
|
8771
|
-
p.key === 'table-comfortable' ||
|
|
8772
|
-
p.key === 'standard' ||
|
|
8773
|
-
p.key === 'presentation');
|
|
8774
|
-
}
|
|
8775
|
-
if (cap.category === 'card') {
|
|
8776
|
-
return STYLE_PRESETS.filter((p) => p.key === 'kpi-card' ||
|
|
8777
|
-
p.key === 'compact' ||
|
|
8778
|
-
p.key === 'standard' ||
|
|
8779
|
-
p.key === 'presentation');
|
|
8780
|
-
}
|
|
8781
|
-
return STYLE_PRESETS.filter((p) => ['compact', 'standard', 'presentation'].includes(p.key));
|
|
8782
|
-
}
|
|
8783
|
-
function findPreset(key) {
|
|
8784
|
-
return STYLE_PRESETS.find((p) => p.key === key);
|
|
8785
|
-
}
|
|
8786
|
-
|
|
8787
8890
|
const GUIDED = 'dashboardBuilder.guided';
|
|
8788
8891
|
const ITEM_ACTIONS = 'dashboardBuilder.actions';
|
|
8789
8892
|
const ITEM_GUIDANCE_REGISTRY = {
|
|
@@ -10384,7 +10487,9 @@ function formatCurrency(value, config, langCode = 'en') {
|
|
|
10384
10487
|
newValue = '-' + newValue;
|
|
10385
10488
|
}
|
|
10386
10489
|
newValue += suffix;
|
|
10387
|
-
|
|
10490
|
+
// Selecting the "currency" format type shows the currency by default (SAR
|
|
10491
|
+
// unless the host configured another), without needing a separate toggle.
|
|
10492
|
+
if (config?.showCurrency || config?.type === 'currency') {
|
|
10388
10493
|
newValue += getCurrencySuffix(langCode);
|
|
10389
10494
|
}
|
|
10390
10495
|
return newValue;
|
|
@@ -19767,7 +19872,7 @@ class ActionService {
|
|
|
19767
19872
|
dialogConfig?.clientConfig?.title?.['ar'] ||
|
|
19768
19873
|
'';
|
|
19769
19874
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
19770
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
19875
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-DJqN3Sel.mjs').then(({ DashboardDialogComponent }) => {
|
|
19771
19876
|
// Open dialog using ModalService
|
|
19772
19877
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
19773
19878
|
header: title,
|
|
@@ -27233,6 +27338,14 @@ class ChartViewer {
|
|
|
27233
27338
|
chartTypeId = input('', ...(ngDevMode ? [{ debugName: "chartTypeId" }] : /* istanbul ignore next */ []));
|
|
27234
27339
|
/** Loading state for refresh */
|
|
27235
27340
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
27341
|
+
destroyRef = inject(DestroyRef);
|
|
27342
|
+
loadingTimer = null;
|
|
27343
|
+
constructor() {
|
|
27344
|
+
this.destroyRef.onDestroy(() => {
|
|
27345
|
+
if (this.loadingTimer)
|
|
27346
|
+
clearTimeout(this.loadingTimer);
|
|
27347
|
+
});
|
|
27348
|
+
}
|
|
27236
27349
|
/** Preview only renders when the selected capability has enough config. */
|
|
27237
27350
|
canPreview = computed(() => {
|
|
27238
27351
|
const config = this.config();
|
|
@@ -27282,12 +27395,19 @@ class ChartViewer {
|
|
|
27282
27395
|
(Array.isArray(value) && value.length === 0));
|
|
27283
27396
|
});
|
|
27284
27397
|
}, ...(ngDevMode ? [{ debugName: "canPreview" }] : /* istanbul ignore next */ []));
|
|
27285
|
-
/**
|
|
27398
|
+
/**
|
|
27399
|
+
* Refresh the preview — flashes the loading spinner. Called by the manual
|
|
27400
|
+
* refresh button AND on every config change in the Style Studio, so edits
|
|
27401
|
+
* get the same "refreshing" feedback. Coalesces rapid calls into one window.
|
|
27402
|
+
*/
|
|
27286
27403
|
refresh() {
|
|
27287
27404
|
this.loading.set(true);
|
|
27288
|
-
|
|
27405
|
+
if (this.loadingTimer)
|
|
27406
|
+
clearTimeout(this.loadingTimer);
|
|
27407
|
+
this.loadingTimer = setTimeout(() => {
|
|
27289
27408
|
this.loading.set(false);
|
|
27290
|
-
|
|
27409
|
+
this.loadingTimer = null;
|
|
27410
|
+
}, 450);
|
|
27291
27411
|
}
|
|
27292
27412
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartViewer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27293
27413
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ChartViewer, isStandalone: true, selector: "mt-chart-viewer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartTypeId: { classPropertyName: "chartTypeId", publicName: "chartTypeId", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"h-full flex flex-col bg-surface-50 border-l border-surface-200\">\n <!-- Header -->\n <div\n class=\"flex items-center justify-between px-4 py-3 bg-surface-0 border-b border-surface-200\"\n >\n <span class=\"text-sm font-medium text-surface-700\">{{\n t(\"preview\")\n }}</span>\n <mt-button\n icon=\"arrow.refresh-cw-01\"\n [rounded]=\"true\"\n size=\"small\"\n severity=\"help\"\n [tooltip]=\"t('refresh')\"\n (onClick)=\"refresh()\"\n />\n </div>\n\n <!-- Preview Content -->\n <div class=\"flex-1 p-4 overflow-auto\">\n @if (loading()) {\n <div class=\"flex items-center justify-center h-full\">\n <mt-icon\n icon=\"general.loading-02\"\n class=\"text-3xl text-primary animate-spin\"\n />\n </div>\n } @else if (config() && chartTypeId() && canPreview()) {\n <div\n class=\"h-full bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden\"\n >\n <mt-dashboard-item\n [config]=\"config()\"\n [chartTypeId]=\"chartTypeId()\"\n [readonly]=\"true\"\n [pageName]=\"\n config()?.clientConfig?.title?.['en'] ||\n config()?.clientConfig?.title?.['ar'] ||\n ''\n \"\n />\n </div>\n } @else {\n <div\n class=\"flex flex-col items-center justify-center h-full text-muted-color\"\n >\n <mt-icon icon=\"chart.bar-chart-10\" class=\"text-4xl mb-3 opacity-50\" />\n <p class=\"text-sm\">{{ t(\"noPreviewAvailable\") }}</p>\n <p class=\"text-xs opacity-70\">{{ t(\"configureChartToPreview\") }}</p>\n </div>\n }\n </div>\n </div>\n</ng-container>\n", styles: [":host{display:block;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"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -27295,7 +27415,7 @@ class ChartViewer {
|
|
|
27295
27415
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartViewer, decorators: [{
|
|
27296
27416
|
type: Component,
|
|
27297
27417
|
args: [{ selector: 'mt-chart-viewer', standalone: true, imports: [CommonModule, TranslocoDirective, Button, Icon, DashboardItem], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"h-full flex flex-col bg-surface-50 border-l border-surface-200\">\n <!-- Header -->\n <div\n class=\"flex items-center justify-between px-4 py-3 bg-surface-0 border-b border-surface-200\"\n >\n <span class=\"text-sm font-medium text-surface-700\">{{\n t(\"preview\")\n }}</span>\n <mt-button\n icon=\"arrow.refresh-cw-01\"\n [rounded]=\"true\"\n size=\"small\"\n severity=\"help\"\n [tooltip]=\"t('refresh')\"\n (onClick)=\"refresh()\"\n />\n </div>\n\n <!-- Preview Content -->\n <div class=\"flex-1 p-4 overflow-auto\">\n @if (loading()) {\n <div class=\"flex items-center justify-center h-full\">\n <mt-icon\n icon=\"general.loading-02\"\n class=\"text-3xl text-primary animate-spin\"\n />\n </div>\n } @else if (config() && chartTypeId() && canPreview()) {\n <div\n class=\"h-full bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden\"\n >\n <mt-dashboard-item\n [config]=\"config()\"\n [chartTypeId]=\"chartTypeId()\"\n [readonly]=\"true\"\n [pageName]=\"\n config()?.clientConfig?.title?.['en'] ||\n config()?.clientConfig?.title?.['ar'] ||\n ''\n \"\n />\n </div>\n } @else {\n <div\n class=\"flex flex-col items-center justify-center h-full text-muted-color\"\n >\n <mt-icon icon=\"chart.bar-chart-10\" class=\"text-4xl mb-3 opacity-50\" />\n <p class=\"text-sm\">{{ t(\"noPreviewAvailable\") }}</p>\n <p class=\"text-xs opacity-70\">{{ t(\"configureChartToPreview\") }}</p>\n </div>\n }\n </div>\n </div>\n</ng-container>\n", styles: [":host{display:block;height:100%}\n"] }]
|
|
27298
|
-
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartTypeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartTypeId", required: false }] }] } });
|
|
27418
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartTypeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartTypeId", required: false }] }] } });
|
|
27299
27419
|
|
|
27300
27420
|
/**
|
|
27301
27421
|
* The canonical list of configuration domains. Order is the order of
|
|
@@ -27459,6 +27579,101 @@ const POPOVER_TAB_SPECS = [
|
|
|
27459
27579
|
{ key: 'advanced', label: 'Advanced', icon: 'development.code-02' },
|
|
27460
27580
|
];
|
|
27461
27581
|
|
|
27582
|
+
const STYLE_PRESETS = [
|
|
27583
|
+
{
|
|
27584
|
+
key: 'compact',
|
|
27585
|
+
label: 'Compact',
|
|
27586
|
+
description: 'Smaller text, tighter padding, ideal for densely packed boards.',
|
|
27587
|
+
layout: { padding: 8, borderRadius: 6, shadow: 'soft', density: 'compact' },
|
|
27588
|
+
style: { titleFontSize: 14, subtitleFontSize: 12 },
|
|
27589
|
+
labelLegendFormat: { legendShow: true, legendPosition: 'bottom' },
|
|
27590
|
+
},
|
|
27591
|
+
{
|
|
27592
|
+
key: 'standard',
|
|
27593
|
+
label: 'Standard',
|
|
27594
|
+
description: 'Balanced default. Works well in most boards.',
|
|
27595
|
+
layout: {
|
|
27596
|
+
padding: 16,
|
|
27597
|
+
borderRadius: 8,
|
|
27598
|
+
shadow: 'medium',
|
|
27599
|
+
density: 'comfortable',
|
|
27600
|
+
},
|
|
27601
|
+
style: { titleFontSize: 18, subtitleFontSize: 14 },
|
|
27602
|
+
labelLegendFormat: { legendShow: true, legendPosition: 'bottom' },
|
|
27603
|
+
},
|
|
27604
|
+
{
|
|
27605
|
+
key: 'presentation',
|
|
27606
|
+
label: 'Presentation',
|
|
27607
|
+
description: 'Large titles, generous spacing, high-contrast for demos.',
|
|
27608
|
+
layout: {
|
|
27609
|
+
padding: 24,
|
|
27610
|
+
borderRadius: 12,
|
|
27611
|
+
shadow: 'strong',
|
|
27612
|
+
density: 'presentation',
|
|
27613
|
+
},
|
|
27614
|
+
style: { titleFontSize: 22, subtitleFontSize: 16 },
|
|
27615
|
+
labelLegendFormat: { legendShow: true, legendPosition: 'right' },
|
|
27616
|
+
},
|
|
27617
|
+
{
|
|
27618
|
+
key: 'kpi-card',
|
|
27619
|
+
label: 'KPI card',
|
|
27620
|
+
description: 'Big number, subtle border, clean for dashboards summary cards.',
|
|
27621
|
+
layout: {
|
|
27622
|
+
padding: 20,
|
|
27623
|
+
borderRadius: 10,
|
|
27624
|
+
shadow: 'soft',
|
|
27625
|
+
density: 'comfortable',
|
|
27626
|
+
},
|
|
27627
|
+
style: { titleFontSize: 14, subtitleFontSize: 11 },
|
|
27628
|
+
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
27629
|
+
},
|
|
27630
|
+
{
|
|
27631
|
+
key: 'table-dense',
|
|
27632
|
+
label: 'Table — dense',
|
|
27633
|
+
description: 'Compact rows for power users / large tables.',
|
|
27634
|
+
layout: { padding: 8, borderRadius: 4, shadow: 'soft', density: 'compact' },
|
|
27635
|
+
style: { titleFontSize: 14, subtitleFontSize: 11 },
|
|
27636
|
+
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
27637
|
+
},
|
|
27638
|
+
{
|
|
27639
|
+
key: 'table-comfortable',
|
|
27640
|
+
label: 'Table — comfortable',
|
|
27641
|
+
description: 'Generous rows, easier on the eyes for review work.',
|
|
27642
|
+
layout: {
|
|
27643
|
+
padding: 16,
|
|
27644
|
+
borderRadius: 8,
|
|
27645
|
+
shadow: 'soft',
|
|
27646
|
+
density: 'comfortable',
|
|
27647
|
+
},
|
|
27648
|
+
style: { titleFontSize: 16, subtitleFontSize: 13 },
|
|
27649
|
+
labelLegendFormat: { legendShow: false, legendPosition: 'bottom' },
|
|
27650
|
+
},
|
|
27651
|
+
];
|
|
27652
|
+
/**
|
|
27653
|
+
* Recommend the relevant presets for a chart capability — table presets only
|
|
27654
|
+
* for tables, KPI presets only for cards. The popover surfaces this list.
|
|
27655
|
+
*/
|
|
27656
|
+
function presetsForCapability(cap) {
|
|
27657
|
+
if (!cap)
|
|
27658
|
+
return STYLE_PRESETS;
|
|
27659
|
+
if (cap.category === 'table' || cap.id.startsWith('table')) {
|
|
27660
|
+
return STYLE_PRESETS.filter((p) => p.key === 'table-dense' ||
|
|
27661
|
+
p.key === 'table-comfortable' ||
|
|
27662
|
+
p.key === 'standard' ||
|
|
27663
|
+
p.key === 'presentation');
|
|
27664
|
+
}
|
|
27665
|
+
if (cap.category === 'card') {
|
|
27666
|
+
return STYLE_PRESETS.filter((p) => p.key === 'kpi-card' ||
|
|
27667
|
+
p.key === 'compact' ||
|
|
27668
|
+
p.key === 'standard' ||
|
|
27669
|
+
p.key === 'presentation');
|
|
27670
|
+
}
|
|
27671
|
+
return STYLE_PRESETS.filter((p) => ['compact', 'standard', 'presentation'].includes(p.key));
|
|
27672
|
+
}
|
|
27673
|
+
function findPreset(key) {
|
|
27674
|
+
return STYLE_PRESETS.find((p) => p.key === key);
|
|
27675
|
+
}
|
|
27676
|
+
|
|
27462
27677
|
/**
|
|
27463
27678
|
* Pass 3 Advanced Config Bridge.
|
|
27464
27679
|
*
|
|
@@ -27751,7 +27966,7 @@ class ArrayBuilderField {
|
|
|
27751
27966
|
return true;
|
|
27752
27967
|
}
|
|
27753
27968
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ArrayBuilderField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27754
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ArrayBuilderField, isStandalone: true, selector: "mt-array-builder-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, itemFields: { classPropertyName: "itemFields", publicName: "itemFields", isSignal: true, isRequired: false, transformFunction: null }, itemTitleKey: { classPropertyName: "itemTitleKey", publicName: "itemTitleKey", isSignal: true, isRequired: false, transformFunction: null }, addLabel: { classPropertyName: "addLabel", publicName: "addLabel", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-array-builder flex flex-col gap-2\">\n @if (rows().length) {\n <div\n cdkDropList\n class=\"flex flex-col gap-2\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (row of rows(); track row.id) {\n <div\n cdkDrag\n class=\"rounded-lg border border-surface-200 bg-surface-0 p-2.5\"\n >\n <div class=\"mb-2 flex items-center gap-2\">\n <span\n cdkDragHandle\n class=\"cursor-grab text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\n </span>\n <span\n class=\"min-w-0 flex-1 truncate text-sm font-medium text-color\"\n >\n {{ rowTitle(row, $index) }}\n </span>\n <button\n type=\"button\"\n class=\"text-muted-color transition-colors hover:text-red-500\"\n aria-label=\"Remove\"\n (click)=\"remove($index)\"\n >\n <mt-icon icon=\"general.trash-01\" class=\"text-base\" />\n </button>\n </div>\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2\">\n @for (f of itemFields(); track f.key) {\n <div class=\"flex flex-col\">\n @switch (f.type) {\n @case (\"color\") {\n <mt-color-picker-field\n [label]=\"f.label\"\n [formControl]=\"control(row, f.key)\"\n />\n }\n @case (\"number\") {\n <mt-number-field\n [label]=\"f.label\"\n [formControl]=\"control(row, f.key)\"\n />\n }\n @case (\"boolean\") {\n <mt-toggle-field\n [label]=\"f.label\"\n labelPosition=\"start\"\n [formControl]=\"control(row, f.key)\"\n />\n }\n @case (\"select\") {\n <mt-select-field\n [label]=\"f.label\"\n [options]=\"options(f)\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [formControl]=\"control(row, f.key)\"\n />\n }\n @default {\n <mt-text-field\n [label]=\"f.label\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control(row, f.key)\"\n />\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <p class=\"text-xs text-muted-color\">Nothing added yet.</p>\n }\n\n @if (canAdd) {\n <div>\n <mt-button\n [label]=\"addLabel()\"\n icon=\"general.plus\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"add()\"\n />\n </div>\n }\n</div>\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: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27969
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ArrayBuilderField, isStandalone: true, selector: "mt-array-builder-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, itemFields: { classPropertyName: "itemFields", publicName: "itemFields", isSignal: true, isRequired: false, transformFunction: null }, itemTitleKey: { classPropertyName: "itemTitleKey", publicName: "itemTitleKey", isSignal: true, isRequired: false, transformFunction: null }, addLabel: { classPropertyName: "addLabel", publicName: "addLabel", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-array-builder flex flex-col gap-2\">\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (row of rows(); track row.id) {\r\n <div\r\n cdkDrag\r\n class=\"rounded-lg border border-surface-200 bg-surface-0 p-2.5\"\r\n >\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm font-medium text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ rowTitle(row, $index) }}\r\n </span>\r\n <button\r\n type=\"button\"\r\n class=\"text-muted-color transition-colors hover:text-red-500\"\r\n aria-label=\"Remove\"\r\n (click)=\"remove($index)\"\r\n >\r\n <mt-icon icon=\"general.trash-01\" class=\"text-base\" />\r\n </button>\r\n </div>\r\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2\">\r\n @for (f of itemFields(); track f.key) {\r\n <div class=\"flex flex-col\">\r\n @switch (f.type) {\r\n @case (\"color\") {\r\n <mt-color-picker-field\r\n [label]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n labelPosition=\"start\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options(f)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @default {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">Nothing added yet.</p>\r\n }\r\n\r\n @if (canAdd) {\r\n <div>\r\n <mt-button\r\n [label]=\"addLabel()\"\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"add()\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27755
27970
|
}
|
|
27756
27971
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ArrayBuilderField, decorators: [{
|
|
27757
27972
|
type: Component,
|
|
@@ -27766,20 +27981,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
27766
27981
|
SelectField,
|
|
27767
27982
|
ToggleField,
|
|
27768
27983
|
Icon,
|
|
27769
|
-
|
|
27984
|
+
TruncateTooltip,
|
|
27985
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-array-builder flex flex-col gap-2\">\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (row of rows(); track row.id) {\r\n <div\r\n cdkDrag\r\n class=\"rounded-lg border border-surface-200 bg-surface-0 p-2.5\"\r\n >\r\n <div class=\"mb-2 flex items-center gap-2\">\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm font-medium text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ rowTitle(row, $index) }}\r\n </span>\r\n <button\r\n type=\"button\"\r\n class=\"text-muted-color transition-colors hover:text-red-500\"\r\n aria-label=\"Remove\"\r\n (click)=\"remove($index)\"\r\n >\r\n <mt-icon icon=\"general.trash-01\" class=\"text-base\" />\r\n </button>\r\n </div>\r\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2\">\r\n @for (f of itemFields(); track f.key) {\r\n <div class=\"flex flex-col\">\r\n @switch (f.type) {\r\n @case (\"color\") {\r\n <mt-color-picker-field\r\n [label]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n labelPosition=\"start\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options(f)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @default {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">Nothing added yet.</p>\r\n }\r\n\r\n @if (canAdd) {\r\n <div>\r\n <mt-button\r\n [label]=\"addLabel()\"\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"add()\"\r\n />\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
27770
27986
|
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], itemFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemFields", required: false }] }], itemTitleKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTitleKey", required: false }] }], addLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "addLabel", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
27771
27987
|
|
|
27772
27988
|
/**
|
|
27773
|
-
* Per-key value editor
|
|
27774
|
-
*
|
|
27775
|
-
* (`{
|
|
27776
|
-
*
|
|
27777
|
-
*
|
|
27989
|
+
* Per-key value editor for the chart's selected properties. Two storage modes:
|
|
27990
|
+
*
|
|
27991
|
+
* - default (map): `{ [propKey]: { ...valueFields } }` — e.g. per-property
|
|
27992
|
+
* translations / colors (`overrideSelectedPropertiesLabels`).
|
|
27993
|
+
* - `asArray`: a POSITIONAL array aligned to the key order — e.g.
|
|
27994
|
+
* `propsConfigAsIndex` where the runtime reads `array[index]` for the
|
|
27995
|
+
* property at that index. One row per key is always emitted to keep the
|
|
27996
|
+
* array aligned.
|
|
27997
|
+
*
|
|
27998
|
+
* Keys come from `keys` (the chart's selected properties); each renders the
|
|
27999
|
+
* scalar `valueFields` as `mt-*` controls (text / number / color / select /
|
|
28000
|
+
* boolean). Controlled: `value` in, `valueChange` out.
|
|
27778
28001
|
*/
|
|
27779
28002
|
class KeyValueMapField {
|
|
27780
28003
|
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
27781
28004
|
keys = input([], ...(ngDevMode ? [{ debugName: "keys" }] : /* istanbul ignore next */ []));
|
|
27782
28005
|
valueFields = input([], ...(ngDevMode ? [{ debugName: "valueFields" }] : /* istanbul ignore next */ []));
|
|
28006
|
+
/** When true, store/read a positional array aligned to `keys` order. */
|
|
28007
|
+
asArray = input(false, ...(ngDevMode ? [{ debugName: "asArray" }] : /* istanbul ignore next */ []));
|
|
27783
28008
|
valueChange = output();
|
|
27784
28009
|
rows = signal([], ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
27785
28010
|
destroyRef = inject(DestroyRef);
|
|
@@ -27789,18 +28014,20 @@ class KeyValueMapField {
|
|
|
27789
28014
|
constructor() {
|
|
27790
28015
|
effect(() => {
|
|
27791
28016
|
const keys = this.keys();
|
|
27792
|
-
const map = this.value() ?? {};
|
|
27793
28017
|
const fields = this.valueFields();
|
|
28018
|
+
const raw = this.value();
|
|
28019
|
+
const asArray = this.asArray();
|
|
27794
28020
|
// Skip rebuild when our own emit echoed back (prevents focus loss).
|
|
27795
28021
|
if (this.syncing)
|
|
27796
28022
|
return;
|
|
27797
|
-
if (untracked(() => this.matchesCurrent(keys,
|
|
28023
|
+
if (untracked(() => this.matchesCurrent(keys, raw, fields, asArray))) {
|
|
27798
28024
|
return;
|
|
28025
|
+
}
|
|
27799
28026
|
this.rowSubs.unsubscribe();
|
|
27800
28027
|
this.rowSubs = new Subscription();
|
|
27801
|
-
this.rows.set(keys.map((opt) => {
|
|
28028
|
+
this.rows.set(keys.map((opt, index) => {
|
|
27802
28029
|
const key = String(opt.value);
|
|
27803
|
-
const existing =
|
|
28030
|
+
const existing = this.existingFor(raw, key, index, asArray);
|
|
27804
28031
|
const group = new FormGroup({});
|
|
27805
28032
|
for (const f of fields) {
|
|
27806
28033
|
group.addControl(f.key, new FormControl(existing?.[f.key] ?? f.default ?? null));
|
|
@@ -27817,20 +28044,41 @@ class KeyValueMapField {
|
|
|
27817
28044
|
control(row, key) {
|
|
27818
28045
|
return row.group.get(key);
|
|
27819
28046
|
}
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
|
|
27823
|
-
|
|
27824
|
-
|
|
27825
|
-
|
|
27826
|
-
|
|
28047
|
+
existingFor(raw, key, index, asArray) {
|
|
28048
|
+
if (asArray) {
|
|
28049
|
+
const arr = Array.isArray(raw) ? raw : [];
|
|
28050
|
+
return arr[index] ?? {};
|
|
28051
|
+
}
|
|
28052
|
+
const map = raw ?? {};
|
|
28053
|
+
return map[key] ?? {};
|
|
28054
|
+
}
|
|
28055
|
+
clean(raw) {
|
|
28056
|
+
const obj = {};
|
|
28057
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
28058
|
+
if (v !== null && v !== undefined && v !== '')
|
|
28059
|
+
obj[k] = v;
|
|
27827
28060
|
}
|
|
28061
|
+
return obj;
|
|
28062
|
+
}
|
|
28063
|
+
emit() {
|
|
27828
28064
|
this.syncing = true;
|
|
27829
|
-
this.
|
|
28065
|
+
if (this.asArray()) {
|
|
28066
|
+
// One entry per key, in order — keeps positional alignment.
|
|
28067
|
+
const arr = this.rows().map((row) => this.clean(row.group.value));
|
|
28068
|
+
this.valueChange.emit(arr);
|
|
28069
|
+
}
|
|
28070
|
+
else {
|
|
28071
|
+
const out = {};
|
|
28072
|
+
for (const row of this.rows()) {
|
|
28073
|
+
const cleaned = this.clean(row.group.value);
|
|
28074
|
+
if (Object.keys(cleaned).length)
|
|
28075
|
+
out[row.key] = cleaned;
|
|
28076
|
+
}
|
|
28077
|
+
this.valueChange.emit(out);
|
|
28078
|
+
}
|
|
27830
28079
|
queueMicrotask(() => (this.syncing = false));
|
|
27831
28080
|
}
|
|
27832
|
-
|
|
27833
|
-
matchesCurrent(keys, map, fields) {
|
|
28081
|
+
matchesCurrent(keys, raw, fields, asArray) {
|
|
27834
28082
|
const rows = this.rows();
|
|
27835
28083
|
if (rows.length !== keys.length)
|
|
27836
28084
|
return false;
|
|
@@ -27838,7 +28086,7 @@ class KeyValueMapField {
|
|
|
27838
28086
|
const key = String(keys[i].value);
|
|
27839
28087
|
if (rows[i].key !== key)
|
|
27840
28088
|
return false;
|
|
27841
|
-
const existing =
|
|
28089
|
+
const existing = this.existingFor(raw, key, i, asArray);
|
|
27842
28090
|
const current = rows[i].group.value;
|
|
27843
28091
|
for (const f of fields) {
|
|
27844
28092
|
const a = existing?.[f.key] ?? null;
|
|
@@ -27850,7 +28098,7 @@ class KeyValueMapField {
|
|
|
27850
28098
|
return true;
|
|
27851
28099
|
}
|
|
27852
28100
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: KeyValueMapField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27853
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: KeyValueMapField, isStandalone: true, selector: "mt-key-value-map-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, keys: { classPropertyName: "keys", publicName: "keys", isSignal: true, isRequired: false, transformFunction: null }, valueFields: { classPropertyName: "valueFields", publicName: "valueFields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-kv-map flex flex-col gap-2\">\n @if (rows().length) {\n @for (row of rows(); track row.key) {\n <div\n class=\"
|
|
28101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: KeyValueMapField, isStandalone: true, selector: "mt-key-value-map-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, keys: { classPropertyName: "keys", publicName: "keys", isSignal: true, isRequired: false, transformFunction: null }, valueFields: { classPropertyName: "valueFields", publicName: "valueFields", isSignal: true, isRequired: false, transformFunction: null }, asArray: { classPropertyName: "asArray", publicName: "asArray", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-kv-map flex flex-col gap-2\">\r\n @if (rows().length) {\r\n @for (row of rows(); track row.key) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n class=\"truncate text-sm font-semibold text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ row.label }}\r\n </span>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (f of valueFields(); track f.key) {\r\n @switch (f.type) {\r\n @case (\"color\") {\r\n <mt-color-picker-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n labelPosition=\"start\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [options]=\"options(f)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @default {\r\n <mt-text-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n No properties available yet \u2014 select fields for this chart first.\r\n </p>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27854
28102
|
}
|
|
27855
28103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: KeyValueMapField, decorators: [{
|
|
27856
28104
|
type: Component,
|
|
@@ -27858,10 +28106,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
27858
28106
|
CommonModule,
|
|
27859
28107
|
ReactiveFormsModule,
|
|
27860
28108
|
TextField,
|
|
28109
|
+
NumberField,
|
|
27861
28110
|
ColorPickerField,
|
|
27862
28111
|
SelectField,
|
|
27863
|
-
|
|
27864
|
-
|
|
28112
|
+
ToggleField,
|
|
28113
|
+
TruncateTooltip,
|
|
28114
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-kv-map flex flex-col gap-2\">\r\n @if (rows().length) {\r\n @for (row of rows(); track row.key) {\r\n <div\r\n class=\"flex flex-col gap-2 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n class=\"truncate text-sm font-semibold text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ row.label }}\r\n </span>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (f of valueFields(); track f.key) {\r\n @switch (f.type) {\r\n @case (\"color\") {\r\n <mt-color-picker-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n labelPosition=\"start\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [options]=\"options(f)\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n @default {\r\n <mt-text-field\r\n class=\"flex-1\"\r\n [placeholder]=\"f.label\"\r\n [formControl]=\"control(row, f.key)\"\r\n />\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n No properties available yet \u2014 select fields for this chart first.\r\n </p>\r\n }\r\n</div>\r\n" }]
|
|
28115
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], keys: [{ type: i0.Input, args: [{ isSignal: true, alias: "keys", required: false }] }], valueFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFields", required: false }] }], asArray: [{ type: i0.Input, args: [{ isSignal: true, alias: "asArray", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
27865
28116
|
|
|
27866
28117
|
/**
|
|
27867
28118
|
* Drag-to-reorder the chart legend. The available entries (`items`) come from
|
|
@@ -27884,11 +28135,11 @@ class LegendOrderField {
|
|
|
27884
28135
|
this.valueChange.emit([]);
|
|
27885
28136
|
}
|
|
27886
28137
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27887
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-legend-order flex flex-col gap-2\">\n @if (rows().length) {\n <div\n cdkDropList\n class=\"flex flex-col gap-2\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (item of rows(); track item.key) {\n <div\n cdkDrag\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\n >\n <span\n cdkDragHandle\n class=\"cursor-grab text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\n </span>\n <span
|
|
28138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"db-legend-order flex flex-col gap-2\">\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n label=\"Reset order\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n No legend entries yet \u2014 the preview needs data to list them.\r\n </p>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
27888
28139
|
}
|
|
27889
28140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, decorators: [{
|
|
27890
28141
|
type: Component,
|
|
27891
|
-
args: [{ selector: 'mt-legend-order-field', standalone: true, imports: [CommonModule, DragDropModule, Button, Icon], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-legend-order flex flex-col gap-2\">\n @if (rows().length) {\n <div\n cdkDropList\n class=\"flex flex-col gap-2\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (item of rows(); track item.key) {\n <div\n cdkDrag\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\n >\n <span\n cdkDragHandle\n class=\"cursor-grab text-muted-color\"\n aria-hidden=\"true\"\n >\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\n </span>\n <span
|
|
28142
|
+
args: [{ selector: 'mt-legend-order-field', standalone: true, imports: [CommonModule, DragDropModule, Button, Icon, TruncateTooltip], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-legend-order flex flex-col gap-2\">\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n label=\"Reset order\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n No legend entries yet \u2014 the preview needs data to list them.\r\n </p>\r\n }\r\n</div>\r\n" }]
|
|
27892
28143
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
27893
28144
|
|
|
27894
28145
|
const SHADOW_PRESET_PATH$1 = 'clientConfig.configAsType.cardStyleConfig.__shadowPreset';
|
|
@@ -28096,6 +28347,15 @@ class StyleField {
|
|
|
28096
28347
|
? raw
|
|
28097
28348
|
: {};
|
|
28098
28349
|
}
|
|
28350
|
+
/** keyValueMap accepts either a map or a positional array (asArray mode). */
|
|
28351
|
+
readMapOrArray() {
|
|
28352
|
+
const raw = this.currentValue();
|
|
28353
|
+
if (Array.isArray(raw))
|
|
28354
|
+
return raw;
|
|
28355
|
+
return raw && typeof raw === 'object'
|
|
28356
|
+
? raw
|
|
28357
|
+
: {};
|
|
28358
|
+
}
|
|
28099
28359
|
readJson() {
|
|
28100
28360
|
const raw = this.currentValue();
|
|
28101
28361
|
if (raw === undefined || raw === null)
|
|
@@ -28155,7 +28415,7 @@ class StyleField {
|
|
|
28155
28415
|
this.patch.emit({ path: SHADOW_PRESET_PATH$1, value: key });
|
|
28156
28416
|
}
|
|
28157
28417
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28158
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\n@switch (f.type) {\n @case (\"text\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"cssDimension\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? '16px'\"\n [formControl]=\"control\"\n />\n }\n @case (\"multilineText\") {\n <mt-textarea-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"number\") {\n <mt-number-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [min]=\"numberMin\"\n [max]=\"numberMax\"\n [formControl]=\"control\"\n />\n }\n @case (\"numberRange\") {\n <mt-slider-field\n [label]=\"f.label\"\n [min]=\"f.min ?? 0\"\n [max]=\"f.max ?? 100\"\n [step]=\"f.step ?? 1\"\n [unit]=\"f.unit ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"boolean\") {\n <mt-toggle-field\n [label]=\"f.label\"\n toggleShape=\"card\"\n [descriptionCard]=\"f.description ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"color\") {\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @case (\"select\") {\n <mt-select-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [filter]=\"useFilter\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"multiselect\") {\n <mt-multi-select-field\n [label]=\"f.label\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n display=\"chip\"\n [formControl]=\"control\"\n />\n }\n @case (\"iconPicker\") {\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @default {\n <!-- Composite + JSON types render their own label header -->\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\n @if (f.description) {\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\n }\n @switch (f.type) {\n @case (\"segmented\") {\n <mt-segmented-field\n [options]=\"options()\"\n [value]=\"currentValue()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"palette\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"colorList\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"arrayBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"f.itemFields ?? []\"\n [itemTitleKey]=\"f.itemTitleKey\"\n [addLabel]=\"f.addLabel ?? 'Add item'\"\n [maxItems]=\"f.maxItems\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"conditionBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"conditionFields()\"\n [addLabel]=\"f.addLabel ?? 'Add rule'\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"keyValueMap\") {\n <mt-key-value-map-field\n [value]=\"
|
|
28418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"f.addLabel ?? 'Add item'\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"f.addLabel ?? 'Add rule'\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SliderField, selector: "mt-slider-field", inputs: ["field", "label", "class", "min", "max", "step", "hideNumber", "unit", "readonly", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: IconField, selector: "mt-icon-field", inputs: ["label", "required"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ColorListField, selector: "mt-color-list-field", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ArrayBuilderField, selector: "mt-array-builder-field", inputs: ["value", "itemFields", "itemTitleKey", "addLabel", "maxItems"], outputs: ["valueChange"] }, { kind: "component", type: KeyValueMapField, selector: "mt-key-value-map-field", inputs: ["value", "keys", "valueFields", "asArray"], outputs: ["valueChange"] }, { kind: "component", type: LegendOrderField, selector: "mt-legend-order-field", inputs: ["items"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
28159
28419
|
}
|
|
28160
28420
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, decorators: [{
|
|
28161
28421
|
type: Component,
|
|
@@ -28176,7 +28436,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
28176
28436
|
ArrayBuilderField,
|
|
28177
28437
|
KeyValueMapField,
|
|
28178
28438
|
LegendOrderField,
|
|
28179
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\n@switch (f.type) {\n @case (\"text\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"cssDimension\") {\n <mt-text-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? '16px'\"\n [formControl]=\"control\"\n />\n }\n @case (\"multilineText\") {\n <mt-textarea-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"number\") {\n <mt-number-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [min]=\"numberMin\"\n [max]=\"numberMax\"\n [formControl]=\"control\"\n />\n }\n @case (\"numberRange\") {\n <mt-slider-field\n [label]=\"f.label\"\n [min]=\"f.min ?? 0\"\n [max]=\"f.max ?? 100\"\n [step]=\"f.step ?? 1\"\n [unit]=\"f.unit ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"boolean\") {\n <mt-toggle-field\n [label]=\"f.label\"\n toggleShape=\"card\"\n [descriptionCard]=\"f.description ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"color\") {\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @case (\"select\") {\n <mt-select-field\n [label]=\"f.label\"\n [hint]=\"f.description\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [filter]=\"useFilter\"\n [placeholder]=\"f.placeholder ?? ''\"\n [formControl]=\"control\"\n />\n }\n @case (\"multiselect\") {\n <mt-multi-select-field\n [label]=\"f.label\"\n [options]=\"options()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n display=\"chip\"\n [formControl]=\"control\"\n />\n }\n @case (\"iconPicker\") {\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\n }\n @default {\n <!-- Composite + JSON types render their own label header -->\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\n @if (f.description) {\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\n }\n @switch (f.type) {\n @case (\"segmented\") {\n <mt-segmented-field\n [options]=\"options()\"\n [value]=\"currentValue()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"palette\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"colorList\") {\n <mt-color-list-field\n [value]=\"readColors()\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"arrayBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"f.itemFields ?? []\"\n [itemTitleKey]=\"f.itemTitleKey\"\n [addLabel]=\"f.addLabel ?? 'Add item'\"\n [maxItems]=\"f.maxItems\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"conditionBuilder\") {\n <mt-array-builder-field\n [value]=\"readArray()\"\n [itemFields]=\"conditionFields()\"\n [addLabel]=\"f.addLabel ?? 'Add rule'\"\n (valueChange)=\"emitValue($event)\"\n />\n }\n @case (\"keyValueMap\") {\n <mt-key-value-map-field\n [value]=\"
|
|
28439
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"f.addLabel ?? 'Add item'\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"f.addLabel ?? 'Add rule'\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n" }]
|
|
28180
28440
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], persisted: [{ type: i0.Input, args: [{ isSignal: true, alias: "persisted", required: true }] }], capability: [{ type: i0.Input, args: [{ isSignal: true, alias: "capability", required: false }] }], legendItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItems", required: false }] }], patch: [{ type: i0.Output, args: ["patch"] }] } });
|
|
28181
28441
|
|
|
28182
28442
|
/**
|
|
@@ -28265,11 +28525,11 @@ class StyleSettingsRenderer {
|
|
|
28265
28525
|
}
|
|
28266
28526
|
}
|
|
28267
28527
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleSettingsRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28268
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleSettingsRenderer, isStandalone: true, selector: "mt-style-settings-renderer", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch", requestScope: "requestScope" }, ngImport: i0, template: "<div class=\"db-style-renderer flex flex-col gap-4\">\n @for (entry of sections(); track entry.section.key) {\n <section\n [id]=\"sectionId(entry.section)\"\n class=\"db-style-section scroll-mt-4 overflow-hidden rounded-xl border border-surface-200 bg-surface-0\"\n [attr.data-domain]=\"entry.section.domain\"\n >\n <header\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-3\"\n >\n <span\n class=\"flex h-7 w-7 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"entry.section.icon\" class=\"text-base\" />\n </span>\n <div class=\"min-w-0 flex-1\">\n <h4
|
|
28528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleSettingsRenderer, isStandalone: true, selector: "mt-style-settings-renderer", inputs: { schema: { classPropertyName: "schema", publicName: "schema", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: false, transformFunction: null }, search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch", requestScope: "requestScope" }, ngImport: i0, template: "<div class=\"db-style-renderer flex flex-col gap-4\">\r\n @for (entry of sections(); track entry.section.key) {\r\n <section\r\n [id]=\"sectionId(entry.section)\"\r\n class=\"db-style-section scroll-mt-4 overflow-hidden rounded-xl border border-surface-200 bg-surface-0\"\r\n [attr.data-domain]=\"entry.section.domain\"\r\n >\r\n <header\r\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-3\"\r\n >\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"entry.section.icon\" class=\"text-base\" />\r\n </span>\r\n <div class=\"min-w-0 flex-1\">\r\n <h4\r\n class=\"truncate text-sm font-semibold text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ entry.section.label }}\r\n </h4>\r\n @if (entry.section.description) {\r\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\r\n {{ entry.section.description }}\r\n </p>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n tooltip=\"Reset this section\"\r\n (onClick)=\"resetSection(entry)\"\r\n />\r\n </header>\r\n\r\n @if (entry.controls.length) {\r\n <div class=\"grid grid-cols-1 gap-x-4 gap-y-3 p-4 lg:grid-cols-2\">\r\n @for (field of entry.controls; track field.key) {\r\n <div\r\n class=\"db-style-field flex flex-col\"\r\n [class.lg:col-span-2]=\"isComposite(field)\"\r\n >\r\n <mt-style-field\r\n [field]=\"field\"\r\n [persisted]=\"persisted()\"\r\n [capability]=\"capability()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Toggles grouped together on their own row, as cards -->\r\n @if (entry.toggles.length) {\r\n <div\r\n class=\"grid grid-cols-1 gap-3 px-4 pb-4 sm:grid-cols-2\"\r\n [class.pt-4]=\"!entry.controls.length\"\r\n >\r\n @for (field of entry.toggles; track field.key) {\r\n <mt-style-field\r\n [field]=\"field\"\r\n [persisted]=\"persisted()\"\r\n [capability]=\"capability()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n @if (isEmpty()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center rounded-xl border border-dashed border-surface-300 bg-surface-0 p-8 text-center\"\r\n >\r\n <mt-icon\r\n icon=\"general.search-md\"\r\n class=\"mb-2 text-2xl text-muted-color\"\r\n />\r\n <p class=\"text-sm font-medium text-color\">No matching settings</p>\r\n <p class=\"mt-1 mb-3 text-xs text-muted-color\">\r\n Try a different search term.\r\n </p>\r\n @if (scope() === \"simple\") {\r\n <mt-button\r\n label=\"Show advanced settings\"\r\n icon=\"general.settings-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestScope.emit('advanced')\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: StyleField, selector: "mt-style-field", inputs: ["field", "persisted", "capability", "legendItems"], outputs: ["patch"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
28269
28529
|
}
|
|
28270
28530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleSettingsRenderer, decorators: [{
|
|
28271
28531
|
type: Component,
|
|
28272
|
-
args: [{ selector: 'mt-style-settings-renderer', standalone: true, imports: [CommonModule, Icon, Button, StyleField], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-style-renderer flex flex-col gap-4\">\n @for (entry of sections(); track entry.section.key) {\n <section\n [id]=\"sectionId(entry.section)\"\n class=\"db-style-section scroll-mt-4 overflow-hidden rounded-xl border border-surface-200 bg-surface-0\"\n [attr.data-domain]=\"entry.section.domain\"\n >\n <header\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-3\"\n >\n <span\n class=\"flex h-7 w-7 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"entry.section.icon\" class=\"text-base\" />\n </span>\n <div class=\"min-w-0 flex-1\">\n <h4
|
|
28532
|
+
args: [{ selector: 'mt-style-settings-renderer', standalone: true, imports: [CommonModule, Icon, Button, StyleField, TruncateTooltip], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"db-style-renderer flex flex-col gap-4\">\r\n @for (entry of sections(); track entry.section.key) {\r\n <section\r\n [id]=\"sectionId(entry.section)\"\r\n class=\"db-style-section scroll-mt-4 overflow-hidden rounded-xl border border-surface-200 bg-surface-0\"\r\n [attr.data-domain]=\"entry.section.domain\"\r\n >\r\n <header\r\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-3\"\r\n >\r\n <span\r\n class=\"flex h-7 w-7 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"entry.section.icon\" class=\"text-base\" />\r\n </span>\r\n <div class=\"min-w-0 flex-1\">\r\n <h4\r\n class=\"truncate text-sm font-semibold text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ entry.section.label }}\r\n </h4>\r\n @if (entry.section.description) {\r\n <p class=\"truncate text-xs text-muted-color\" mtTruncateTooltip>\r\n {{ entry.section.description }}\r\n </p>\r\n }\r\n </div>\r\n <mt-button\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n size=\"small\"\r\n tooltip=\"Reset this section\"\r\n (onClick)=\"resetSection(entry)\"\r\n />\r\n </header>\r\n\r\n @if (entry.controls.length) {\r\n <div class=\"grid grid-cols-1 gap-x-4 gap-y-3 p-4 lg:grid-cols-2\">\r\n @for (field of entry.controls; track field.key) {\r\n <div\r\n class=\"db-style-field flex flex-col\"\r\n [class.lg:col-span-2]=\"isComposite(field)\"\r\n >\r\n <mt-style-field\r\n [field]=\"field\"\r\n [persisted]=\"persisted()\"\r\n [capability]=\"capability()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Toggles grouped together on their own row, as cards -->\r\n @if (entry.toggles.length) {\r\n <div\r\n class=\"grid grid-cols-1 gap-3 px-4 pb-4 sm:grid-cols-2\"\r\n [class.pt-4]=\"!entry.controls.length\"\r\n >\r\n @for (field of entry.toggles; track field.key) {\r\n <mt-style-field\r\n [field]=\"field\"\r\n [persisted]=\"persisted()\"\r\n [capability]=\"capability()\"\r\n [legendItems]=\"legendItems()\"\r\n (patch)=\"onPatch($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </section>\r\n }\r\n\r\n @if (isEmpty()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center rounded-xl border border-dashed border-surface-300 bg-surface-0 p-8 text-center\"\r\n >\r\n <mt-icon\r\n icon=\"general.search-md\"\r\n class=\"mb-2 text-2xl text-muted-color\"\r\n />\r\n <p class=\"text-sm font-medium text-color\">No matching settings</p>\r\n <p class=\"mt-1 mb-3 text-xs text-muted-color\">\r\n Try a different search term.\r\n </p>\r\n @if (scope() === \"simple\") {\r\n <mt-button\r\n label=\"Show advanced settings\"\r\n icon=\"general.settings-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestScope.emit('advanced')\"\r\n />\r\n }\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
28273
28533
|
}], propDecorators: { schema: [{ type: i0.Input, args: [{ isSignal: true, alias: "schema", required: true }] }], persisted: [{ type: i0.Input, args: [{ isSignal: true, alias: "persisted", required: true }] }], capability: [{ type: i0.Input, args: [{ isSignal: true, alias: "capability", required: false }] }], scope: [{ type: i0.Input, args: [{ isSignal: true, alias: "scope", required: false }] }], search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], legendItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItems", required: false }] }], patch: [{ type: i0.Output, args: ["patch"] }], requestScope: [{ type: i0.Output, args: ["requestScope"] }] } });
|
|
28274
28534
|
|
|
28275
28535
|
/**
|
|
@@ -28334,6 +28594,16 @@ class StyleStudioDrawer {
|
|
|
28334
28594
|
});
|
|
28335
28595
|
/** Section the rail highlights as active (scroll-spy). */
|
|
28336
28596
|
activeSection = signal('', ...(ngDevMode ? [{ debugName: "activeSection" }] : /* istanbul ignore next */ []));
|
|
28597
|
+
/**
|
|
28598
|
+
* Isolated preview id so editing here NEVER mutates the real dashboard
|
|
28599
|
+
* chart's store entry. The preview renders from this id; Cancel leaves the
|
|
28600
|
+
* real chart untouched.
|
|
28601
|
+
*/
|
|
28602
|
+
previewId = `style-preview-${Date.now().toString(36)}-${Math.random()
|
|
28603
|
+
.toString(36)
|
|
28604
|
+
.slice(2)}`;
|
|
28605
|
+
/** The live preview viewer — driven to flash its loading on every change. */
|
|
28606
|
+
previewViewer = viewChild(ChartViewer, ...(ngDevMode ? [{ debugName: "previewViewer" }] : /* istanbul ignore next */ []));
|
|
28337
28607
|
constructor() {
|
|
28338
28608
|
const configItem = this.drawerConfig.data?.item;
|
|
28339
28609
|
if (configItem) {
|
|
@@ -28341,13 +28611,35 @@ class StyleStudioDrawer {
|
|
|
28341
28611
|
}
|
|
28342
28612
|
// Wide two-pane studio: settings + live preview side by side.
|
|
28343
28613
|
this.drawerController?.setStyleClass('!w-[72rem] !max-w-full');
|
|
28344
|
-
// Seed preview
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28614
|
+
// Seed the isolated preview store from the real chart's cached data so the
|
|
28615
|
+
// preview shows immediately; if not cached, fetch it on the real id.
|
|
28616
|
+
const realId = configItem?.config?.serviceConfig?.dashboardId;
|
|
28617
|
+
const realRaw = realId
|
|
28618
|
+
? this.itemStoreService.getItemProperty(realId, 'DataResponse')
|
|
28619
|
+
: null;
|
|
28620
|
+
if (realRaw != null && configItem) {
|
|
28621
|
+
this.itemStoreService.updateStoreForItem(this.previewId, {
|
|
28622
|
+
DataResponse: realRaw,
|
|
28623
|
+
ConfigurationItem: configItem.config,
|
|
28624
|
+
});
|
|
28350
28625
|
}
|
|
28626
|
+
else if (realId) {
|
|
28627
|
+
this.itemStoreService.triggerDataFetch(realId);
|
|
28628
|
+
}
|
|
28629
|
+
// LIVE preview: re-process the data with the working config on EVERY edit
|
|
28630
|
+
// and push it into the isolated preview store, so style/preset changes show
|
|
28631
|
+
// instantly (DashboardItem itself only re-renders on dashboardId change).
|
|
28632
|
+
effect(() => {
|
|
28633
|
+
const cfg = this.previewConfig();
|
|
28634
|
+
if (!cfg)
|
|
28635
|
+
return;
|
|
28636
|
+
untracked(() => {
|
|
28637
|
+
// Flash the preview's loading spinner on every change — same feedback
|
|
28638
|
+
// as the manual Refresh button — then push the freshly-processed data.
|
|
28639
|
+
this.previewViewer()?.refresh();
|
|
28640
|
+
this.syncPreviewStore(cfg, realId ?? null);
|
|
28641
|
+
});
|
|
28642
|
+
});
|
|
28351
28643
|
// Highlight the first section as soon as the rail is known.
|
|
28352
28644
|
effect(() => {
|
|
28353
28645
|
const sections = this.navSections();
|
|
@@ -28356,6 +28648,24 @@ class StyleStudioDrawer {
|
|
|
28356
28648
|
}
|
|
28357
28649
|
});
|
|
28358
28650
|
}
|
|
28651
|
+
/** Re-process + push the working config into the isolated preview store. */
|
|
28652
|
+
syncPreviewStore(cfg, realId) {
|
|
28653
|
+
const raw = this.itemStoreService.getItemProperty(this.previewId, 'DataResponse') ??
|
|
28654
|
+
(realId
|
|
28655
|
+
? this.itemStoreService.getItemProperty(realId, 'DataResponse')
|
|
28656
|
+
: null);
|
|
28657
|
+
const patch = { ConfigurationItem: cfg };
|
|
28658
|
+
if (raw != null) {
|
|
28659
|
+
patch.DataResponse = raw;
|
|
28660
|
+
try {
|
|
28661
|
+
patch.DataHandled = this.chartDataService.processChartData(raw, cfg);
|
|
28662
|
+
}
|
|
28663
|
+
catch {
|
|
28664
|
+
/* keep last good handled data */
|
|
28665
|
+
}
|
|
28666
|
+
}
|
|
28667
|
+
this.itemStoreService.updateStoreForItem(this.previewId, patch);
|
|
28668
|
+
}
|
|
28359
28669
|
// --- config / schema ------------------------------------------------------
|
|
28360
28670
|
itemConfig = computed(() => this.item()?.config ?? null, ...(ngDevMode ? [{ debugName: "itemConfig" }] : /* istanbul ignore next */ []));
|
|
28361
28671
|
capability = computed(() => {
|
|
@@ -28424,23 +28734,21 @@ class StyleStudioDrawer {
|
|
|
28424
28734
|
}
|
|
28425
28735
|
return out;
|
|
28426
28736
|
}, ...(ngDevMode ? [{ debugName: "navGroups" }] : /* istanbul ignore next */ []));
|
|
28427
|
-
presets = computed(() => {
|
|
28428
|
-
const cap = this.capability();
|
|
28429
|
-
if (!cap)
|
|
28430
|
-
return STYLE_PRESETS;
|
|
28431
|
-
if (cap.category === 'table') {
|
|
28432
|
-
return STYLE_PRESETS.filter((p) => p.key.startsWith('table') || p.key === 'standard');
|
|
28433
|
-
}
|
|
28434
|
-
if (cap.category === 'card') {
|
|
28435
|
-
return STYLE_PRESETS.filter((p) => ['kpi-card', 'compact', 'standard', 'presentation'].includes(p.key));
|
|
28436
|
-
}
|
|
28437
|
-
return STYLE_PRESETS.filter((p) => ['compact', 'standard', 'presentation'].includes(p.key));
|
|
28438
|
-
}, ...(ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []));
|
|
28439
28737
|
scopeOptions = computed(() => [
|
|
28440
28738
|
{ label: this.t('styleStudio.simple', 'Simple'), value: 'simple' },
|
|
28441
28739
|
{ label: this.t('styleStudio.advanced', 'Advanced'), value: 'advanced' },
|
|
28442
28740
|
], ...(ngDevMode ? [{ debugName: "scopeOptions" }] : /* istanbul ignore next */ []));
|
|
28443
28741
|
// --- preview --------------------------------------------------------------
|
|
28742
|
+
/** Working config re-keyed to the isolated preview id (drives ChartViewer). */
|
|
28743
|
+
previewConfig = computed(() => {
|
|
28744
|
+
const cfg = this.itemConfig();
|
|
28745
|
+
if (!cfg)
|
|
28746
|
+
return null;
|
|
28747
|
+
return {
|
|
28748
|
+
...cfg,
|
|
28749
|
+
serviceConfig: { ...cfg.serviceConfig, dashboardId: this.previewId },
|
|
28750
|
+
};
|
|
28751
|
+
}, ...(ngDevMode ? [{ debugName: "previewConfig" }] : /* istanbul ignore next */ []));
|
|
28444
28752
|
/** Chart-type id handed to the live ChartViewer (renders ALL widget types). */
|
|
28445
28753
|
previewChartTypeId = computed(() => String(this.item()?.chartTypeId ?? ''), ...(ngDevMode ? [{ debugName: "previewChartTypeId" }] : /* istanbul ignore next */ []));
|
|
28446
28754
|
previewTitle = computed(() => {
|
|
@@ -28449,30 +28757,11 @@ class StyleStudioDrawer {
|
|
|
28449
28757
|
return title?.[langCode] || title?.['en'] || title?.['ar'] || '';
|
|
28450
28758
|
}, ...(ngDevMode ? [{ debugName: "previewTitle" }] : /* istanbul ignore next */ []));
|
|
28451
28759
|
/**
|
|
28452
|
-
* Preview data — the source for the legend-order entries.
|
|
28453
|
-
*
|
|
28454
|
-
*
|
|
28455
|
-
* when no handled data is cached (re-processing here can lose legend names).
|
|
28760
|
+
* Preview data — the source for the legend-order entries. Reads the isolated
|
|
28761
|
+
* preview store, which `syncPreviewStore()` keeps re-processed against the
|
|
28762
|
+
* working config on every edit.
|
|
28456
28763
|
*/
|
|
28457
|
-
previewData = computed(() => {
|
|
28458
|
-
const config = this.itemConfig();
|
|
28459
|
-
const dashboardId = config?.serviceConfig?.dashboardId;
|
|
28460
|
-
if (!config || !dashboardId)
|
|
28461
|
-
return null;
|
|
28462
|
-
const handled = this.itemStoreService.getDataHandled(dashboardId);
|
|
28463
|
-
if (handled)
|
|
28464
|
-
return handled;
|
|
28465
|
-
const rawData = this.itemStoreService.getItemProperty(dashboardId, 'DataResponse');
|
|
28466
|
-
if (rawData !== undefined && rawData !== null) {
|
|
28467
|
-
try {
|
|
28468
|
-
return this.chartDataService.processChartData(rawData, config);
|
|
28469
|
-
}
|
|
28470
|
-
catch {
|
|
28471
|
-
/* no usable data yet */
|
|
28472
|
-
}
|
|
28473
|
-
}
|
|
28474
|
-
return null;
|
|
28475
|
-
}, ...(ngDevMode ? [{ debugName: "previewData" }] : /* istanbul ignore next */ []));
|
|
28764
|
+
previewData = computed(() => this.itemStoreService.getDataHandled(this.previewId) ?? null, ...(ngDevMode ? [{ debugName: "previewData" }] : /* istanbul ignore next */ []));
|
|
28476
28765
|
/** Legend entries (ordered by the saved override) for the legendOrder control. */
|
|
28477
28766
|
legendItems = computed(() => {
|
|
28478
28767
|
const items = this.extractLegendItems(this.previewData());
|
|
@@ -28568,16 +28857,6 @@ class StyleStudioDrawer {
|
|
|
28568
28857
|
config: applyControlPatchToPersisted(i.config, patch),
|
|
28569
28858
|
});
|
|
28570
28859
|
}
|
|
28571
|
-
applyPreset(preset) {
|
|
28572
|
-
const i = this.item();
|
|
28573
|
-
if (!i?.config)
|
|
28574
|
-
return;
|
|
28575
|
-
const patches = this.presetPatches(preset);
|
|
28576
|
-
this.item.set({
|
|
28577
|
-
...i,
|
|
28578
|
-
config: applyControlPatchesToPersisted(i.config, patches),
|
|
28579
|
-
});
|
|
28580
|
-
}
|
|
28581
28860
|
scrollTo(section) {
|
|
28582
28861
|
this.activeSection.set(section.key);
|
|
28583
28862
|
const pane = this.scrollPane()?.nativeElement;
|
|
@@ -28640,28 +28919,13 @@ class StyleStudioDrawer {
|
|
|
28640
28919
|
close() {
|
|
28641
28920
|
this.dialogRef.close(null);
|
|
28642
28921
|
}
|
|
28643
|
-
/** Map a preset's friendly fields to the persisted paths the schema uses. */
|
|
28644
|
-
presetPatches(preset) {
|
|
28645
|
-
const p = [];
|
|
28646
|
-
const push = (path, value) => {
|
|
28647
|
-
if (value !== undefined)
|
|
28648
|
-
p.push({ path, value });
|
|
28649
|
-
};
|
|
28650
|
-
push('clientConfig.configAsType.padding', preset.layout.padding);
|
|
28651
|
-
push('clientConfig.configAsType.cardStyleConfig.borderRadius', preset.layout.borderRadius);
|
|
28652
|
-
push('clientConfig.configAsType.density', preset.layout.density);
|
|
28653
|
-
push('clientConfig.displayConfig.StyleConfig.font-size-title', preset.style.titleFontSize);
|
|
28654
|
-
push('clientConfig.configAsType.legend.show', preset.labelLegendFormat.legendShow);
|
|
28655
|
-
push('clientConfig.configAsType.legend.position', preset.labelLegendFormat.legendPosition);
|
|
28656
|
-
return p;
|
|
28657
|
-
}
|
|
28658
28922
|
t(key, fallback) {
|
|
28659
28923
|
const full = `dashboardBuilder.${key}`;
|
|
28660
28924
|
const out = this.transloco.translate(full);
|
|
28661
28925
|
return out === full ? fallback : out;
|
|
28662
28926
|
}
|
|
28663
28927
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28664
|
-
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 }], 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\"
|
|
28928
|
+
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 [schema]=\"schema()\"\r\n [persisted]=\"itemConfig()\"\r\n [capability]=\"capability()\"\r\n [scope]=\"scope()\"\r\n [search]=\"search()\"\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 aria-label=\"Resize preview\"\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 <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n />\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"], 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: ["schema", "persisted", "capability", "scope", "search", "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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
28665
28929
|
}
|
|
28666
28930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, decorators: [{
|
|
28667
28931
|
type: Component,
|
|
@@ -28672,11 +28936,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
28672
28936
|
Button,
|
|
28673
28937
|
TextField,
|
|
28674
28938
|
Icon,
|
|
28939
|
+
TruncateTooltip,
|
|
28675
28940
|
StyleSettingsRenderer,
|
|
28676
28941
|
SegmentedField,
|
|
28677
28942
|
ChartViewer,
|
|
28678
|
-
], 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\"
|
|
28679
|
-
}], ctorParameters: () => [], propDecorators: { scrollPane: [{ type: i0.ViewChild, args: ['scrollPane', { isSignal: true }] }] } });
|
|
28943
|
+
], 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 [schema]=\"schema()\"\r\n [persisted]=\"itemConfig()\"\r\n [capability]=\"capability()\"\r\n [scope]=\"scope()\"\r\n [search]=\"search()\"\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 aria-label=\"Resize preview\"\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 <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n />\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"] }]
|
|
28944
|
+
}], ctorParameters: () => [], propDecorators: { scrollPane: [{ type: i0.ViewChild, args: ['scrollPane', { isSignal: true }] }], previewViewer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ChartViewer), { isSignal: true }] }] } });
|
|
28680
28945
|
|
|
28681
28946
|
/**
|
|
28682
28947
|
* Style Studio — schema-driven chart style editor (replaces the legacy
|
|
@@ -31256,6 +31521,19 @@ class DataSourceSettings {
|
|
|
31256
31521
|
chartWorkspace = signal(null, ...(ngDevMode ? [{ debugName: "chartWorkspace" }] : /* istanbul ignore next */ []));
|
|
31257
31522
|
/** Inline "change workspace" confirmation visibility. */
|
|
31258
31523
|
confirmingWorkspaceChange = signal(false, ...(ngDevMode ? [{ debugName: "confirmingWorkspaceChange" }] : /* istanbul ignore next */ []));
|
|
31524
|
+
/**
|
|
31525
|
+
* True when the chart workspace was auto-detected from OLD data (the chart had
|
|
31526
|
+
* selections/workspaceId but no stored `serviceConfig.workspace`). Drives the
|
|
31527
|
+
* "auto-detected — Save to keep it / Clear" notice. Cleared once the user
|
|
31528
|
+
* picks deliberately or clears it.
|
|
31529
|
+
*/
|
|
31530
|
+
workspaceAutoDetected = signal(false, ...(ngDevMode ? [{ debugName: "workspaceAutoDetected" }] : /* istanbul ignore next */ []));
|
|
31531
|
+
/**
|
|
31532
|
+
* Set once the user explicitly clears an auto-detected workspace, so the
|
|
31533
|
+
* derive effect doesn't immediately re-detect the same one (which would make
|
|
31534
|
+
* Clear a no-op). Reset on a deliberate pick.
|
|
31535
|
+
*/
|
|
31536
|
+
userClearedWorkspace = signal(false, ...(ngDevMode ? [{ debugName: "userClearedWorkspace" }] : /* istanbul ignore next */ []));
|
|
31259
31537
|
workspaceServiceName = computed(() => this.dashboardService.modulesTreeServices()?.[0] ?? 'pplus', ...(ngDevMode ? [{ debugName: "workspaceServiceName" }] : /* istanbul ignore next */ []));
|
|
31260
31538
|
/**
|
|
31261
31539
|
* The hierarchical "Level" module + its owning service (searches all loaded
|
|
@@ -31367,15 +31645,29 @@ class DataSourceSettings {
|
|
|
31367
31645
|
effect(() => {
|
|
31368
31646
|
this.treeData();
|
|
31369
31647
|
const selections = this.selections();
|
|
31648
|
+
// Read selectedWorkspaceId so this re-runs once effect 1 hydrates it.
|
|
31649
|
+
this.selectedWorkspaceId();
|
|
31370
31650
|
untracked(() => {
|
|
31371
|
-
if (this.chartWorkspace())
|
|
31651
|
+
if (this.chartWorkspace() || this.userClearedWorkspace())
|
|
31372
31652
|
return;
|
|
31373
|
-
const
|
|
31374
|
-
if (!
|
|
31653
|
+
const ws = this.deriveChartWorkspace(selections);
|
|
31654
|
+
if (!ws)
|
|
31375
31655
|
return;
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
|
|
31656
|
+
// Auto-select for OLD data: show it in the gate, flag it so the
|
|
31657
|
+
// "Save to keep it / Clear" notice appears, and backfill the persisted
|
|
31658
|
+
// workspace + workspaceId so navigate-to-entity has an id on save.
|
|
31659
|
+
this.chartWorkspace.set(ws);
|
|
31660
|
+
this.workspaceAutoDetected.set(true);
|
|
31661
|
+
const workspaceId = this.parseWorkspaceId(ws);
|
|
31662
|
+
const current = this.selectedWorkspaceId();
|
|
31663
|
+
if (workspaceId !== null && (current === null || current === '')) {
|
|
31664
|
+
this.selectedWorkspaceId.set(workspaceId);
|
|
31665
|
+
this.dashboardService.setModulesTreeWorkspaceId(workspaceId);
|
|
31666
|
+
}
|
|
31667
|
+
this.serviceConfigChange.emit({
|
|
31668
|
+
workspace: ws,
|
|
31669
|
+
...(workspaceId !== null ? { workspaceId } : {}),
|
|
31670
|
+
});
|
|
31379
31671
|
});
|
|
31380
31672
|
});
|
|
31381
31673
|
// Effect 1: Sync config to local state (without loading properties)
|
|
@@ -31406,8 +31698,12 @@ class DataSourceSettings {
|
|
|
31406
31698
|
}
|
|
31407
31699
|
// Chart-level workspace (Template root). Absent on legacy configs — the
|
|
31408
31700
|
// derive effect backfills it from the first Level selection once the
|
|
31409
|
-
// tree is available.
|
|
31410
|
-
|
|
31701
|
+
// tree is available. Don't let a null config value clobber a workspace
|
|
31702
|
+
// the derive effect already filled in.
|
|
31703
|
+
const wsFromConfig = serviceConfig['workspace'] ?? null;
|
|
31704
|
+
if (wsFromConfig !== null || !this.chartWorkspace()) {
|
|
31705
|
+
this.chartWorkspace.set(wsFromConfig);
|
|
31706
|
+
}
|
|
31411
31707
|
// Persisted/BE sourceLinks use sourceId1 / source1LinkProperty; the
|
|
31412
31708
|
// form binds the FE shape (source1SelectionId / source1PropertyKey), so
|
|
31413
31709
|
// map BE -> FE here or the Source Links tab renders blank.
|
|
@@ -31576,13 +31872,34 @@ class DataSourceSettings {
|
|
|
31576
31872
|
});
|
|
31577
31873
|
}
|
|
31578
31874
|
// ==================== Chart-level Workspace actions ====================
|
|
31875
|
+
// Workspace auto-detect + workspaceId persistence (navigate-to-entity).
|
|
31579
31876
|
/** Pick the single chart workspace (Template root). Opens the tabs. */
|
|
31580
31877
|
onWorkspacePick(selector) {
|
|
31581
31878
|
this.chartWorkspace.set(selector);
|
|
31879
|
+
// A deliberate pick is no longer "auto-detected" — drop the notice and
|
|
31880
|
+
// re-arm auto-detect for any future clear.
|
|
31881
|
+
this.workspaceAutoDetected.set(false);
|
|
31882
|
+
this.userClearedWorkspace.set(false);
|
|
31883
|
+
// Persist BOTH the selector AND the numeric workspaceId. navigate-to-entity
|
|
31884
|
+
// reads serviceConfig.workspaceId first (its primary source), so filling it
|
|
31885
|
+
// here is what lets that action build /{workspaceId}/explore/... on save.
|
|
31886
|
+
const workspaceId = this.parseWorkspaceId(selector);
|
|
31887
|
+
if (workspaceId !== null) {
|
|
31888
|
+
this.selectedWorkspaceId.set(workspaceId);
|
|
31889
|
+
this.dashboardService.setModulesTreeWorkspaceId(workspaceId);
|
|
31890
|
+
}
|
|
31582
31891
|
this.serviceConfigChange.emit({
|
|
31583
31892
|
workspace: selector,
|
|
31893
|
+
...(workspaceId !== null ? { workspaceId } : {}),
|
|
31584
31894
|
});
|
|
31585
31895
|
}
|
|
31896
|
+
/** Numeric workspace id parsed from a Template selector ("Template:48" -> 48). */
|
|
31897
|
+
parseWorkspaceId(selector) {
|
|
31898
|
+
if (!selector)
|
|
31899
|
+
return null;
|
|
31900
|
+
const match = String(selector).match(/(\d+)\s*$/);
|
|
31901
|
+
return match ? Number(match[1]) : null;
|
|
31902
|
+
}
|
|
31586
31903
|
/** Ask to change workspace (shows the inline confirm). */
|
|
31587
31904
|
requestChangeWorkspace() {
|
|
31588
31905
|
this.confirmingWorkspaceChange.set(true);
|
|
@@ -31625,6 +31942,48 @@ class DataSourceSettings {
|
|
|
31625
31942
|
error: () => this.treeData.set([]),
|
|
31626
31943
|
});
|
|
31627
31944
|
}
|
|
31945
|
+
/**
|
|
31946
|
+
* Best-effort workspace selector for OLD charts that never stored
|
|
31947
|
+
* `serviceConfig.workspace`. Tries, in order: an existing numeric
|
|
31948
|
+
* `workspaceId` (mapped to a known Template option, else synthesized), a
|
|
31949
|
+
* Level selection mapped through the tree, then a workspaceId carried on any
|
|
31950
|
+
* selection. Returns null when nothing can be inferred.
|
|
31951
|
+
*/
|
|
31952
|
+
deriveChartWorkspace(selections) {
|
|
31953
|
+
const wsId = this.selectedWorkspaceId();
|
|
31954
|
+
if (wsId !== null && wsId !== undefined && wsId !== '') {
|
|
31955
|
+
const match = this.workspaceOptions().find((o) => this.parseWorkspaceId(o.value) === Number(wsId));
|
|
31956
|
+
return match ? match.value : `Template:${wsId}`;
|
|
31957
|
+
}
|
|
31958
|
+
const levelSel = selections.find((s) => /^Level:/i.test(s.selector ?? ''));
|
|
31959
|
+
if (levelSel?.selector) {
|
|
31960
|
+
const ws = this.deriveWorkspaceFromLevel(levelSel.selector);
|
|
31961
|
+
if (ws)
|
|
31962
|
+
return ws;
|
|
31963
|
+
}
|
|
31964
|
+
const selWithWs = selections.find((s) => {
|
|
31965
|
+
const id = s['workspaceId'];
|
|
31966
|
+
return id !== null && id !== undefined && id !== '';
|
|
31967
|
+
});
|
|
31968
|
+
if (selWithWs) {
|
|
31969
|
+
const id = selWithWs['workspaceId'];
|
|
31970
|
+
return `Template:${id}`;
|
|
31971
|
+
}
|
|
31972
|
+
return null;
|
|
31973
|
+
}
|
|
31974
|
+
/**
|
|
31975
|
+
* Discard an auto-detected workspace without wiping the (still valid)
|
|
31976
|
+
* selections — re-opens the picker so the user can choose deliberately.
|
|
31977
|
+
*/
|
|
31978
|
+
clearAutoDetectedWorkspace() {
|
|
31979
|
+
this.chartWorkspace.set(null);
|
|
31980
|
+
this.workspaceAutoDetected.set(false);
|
|
31981
|
+
this.userClearedWorkspace.set(true);
|
|
31982
|
+
this.serviceConfigChange.emit({
|
|
31983
|
+
workspace: null,
|
|
31984
|
+
workspaceId: null,
|
|
31985
|
+
});
|
|
31986
|
+
}
|
|
31628
31987
|
/** Reverse-map a Level selector to its Template root (for legacy restore). */
|
|
31629
31988
|
deriveWorkspaceFromLevel(levelSelector) {
|
|
31630
31989
|
const module = this.levelContext()?.module;
|
|
@@ -32074,7 +32433,7 @@ class DataSourceSettings {
|
|
|
32074
32433
|
};
|
|
32075
32434
|
}
|
|
32076
32435
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DataSourceSettings, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32077
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DataSourceSettings, isStandalone: true, selector: "mt-data-source-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartType: { classPropertyName: "chartType", publicName: "chartType", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { serviceConfigChange: "serviceConfigChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\n @if (supportsCustomApi()) {\n <div class=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\n (click)=\"onModeChange('selection')\"\n >\n <mt-icon\n icon=\"dev.database-01\"\n class=\"mt-0.5 text-lg\"\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\n />\n <span class=\"flex flex-col\">\n <span class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"dataSourceModes.selection\") }}\n </span>\n <span class=\"text-xs text-muted-color\">\n {{ t(\"dataSourceModes.selectionHint\") }}\n </span>\n </span>\n </button>\n\n <button\n type=\"button\"\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\n (click)=\"onModeChange('customApi')\"\n >\n <mt-icon\n icon=\"dev.code-02\"\n class=\"mt-0.5 text-lg\"\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\n />\n <span class=\"flex flex-col\">\n <span class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"dataSourceModes.customApi\") }}\n </span>\n <span class=\"text-xs text-muted-color\">\n {{ t(\"dataSourceModes.customApiHint\") }}\n </span>\n </span>\n </button>\n </div>\n }\n\n <!-- ===================== CUSTOM API MODE ===================== -->\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\n <mt-custom-api-configuration\n [ngModel]=\"customApi()\"\n (ngModelChange)=\"onCustomApiChange($event)\"\n />\n } @else {\n <!-- ===================== SELECTION CYCLE ===================== -->\n\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear -->\n @if (showWorkspaceGate()) {\n @if (needsWorkspacePick()) {\n <div\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\n >\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\n <div class=\"flex flex-col gap-1\">\n <h3 class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"workspaceGateTitle\") }}\n </h3>\n <p class=\"text-xs text-muted-color\">\n {{ t(\"workspaceGateHint\") }}\n </p>\n </div>\n <div class=\"w-full max-w-sm\">\n <mt-select-field\n [options]=\"workspaceOptions()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"t('selectWorkspace')\"\n [filter]=\"true\"\n [ngModel]=\"chartWorkspace()\"\n (ngModelChange)=\"onWorkspacePick($event)\"\n />\n </div>\n </div>\n } @else if (chartWorkspace()) {\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span class=\"flex items-center gap-2 text-sm\">\n <mt-icon\n icon=\"dev.database-01\"\n class=\"text-base text-primary-500\"\n />\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\n <span class=\"font-medium text-surface-700\">{{\n chartWorkspaceLabel()\n }}</span>\n </span>\n @if (!confirmingWorkspaceChange()) {\n <mt-button\n [label]=\"t('change')\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"requestChangeWorkspace()\"\n />\n } @else {\n <span class=\"flex flex-wrap items-center gap-2\">\n <span class=\"text-xs text-amber-600\">{{\n t(\"changeWorkspaceConfirm\")\n }}</span>\n <mt-button\n [label]=\"t('cancel')\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"cancelChangeWorkspace()\"\n />\n <mt-button\n [label]=\"t('changeAndClear')\"\n severity=\"danger\"\n size=\"small\"\n (onClick)=\"confirmChangeWorkspace()\"\n />\n </span>\n }\n </div>\n }\n }\n\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\n <mt-tabs\n [options]=\"sectionOptions()\"\n optionLabel=\"label\"\n optionValue=\"id\"\n [active]=\"visibleSection()\"\n (onChange)=\"onSectionChange($event)\"\n />\n }\n\n <!-- ===================== SELECTION ===================== -->\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\n <div\n [hidden]=\"visibleSection() !== 'selection'\"\n class=\"flex flex-col gap-5\"\n >\n @if (showInformativeSelectionMode()) {\n <div class=\"flex items-center justify-end\">\n <mt-toggle-field\n [label]=\"t('advancedSelection')\"\n [ngModel]=\"selectionMode() === 'advanced'\"\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\n />\n </div>\n }\n\n @if (\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\n ) {\n <mt-selection-configuration\n [workspaceId]=\"selectedWorkspaceId()\"\n [chartWorkspace]=\"chartWorkspace()\"\n [modulesProperties]=\"modulesProperties()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [ngModel]=\"selections()\"\n (ngModelChange)=\"onSelectionsChange($event)\"\n (moduleChange)=\"onModuleChange($event)\"\n />\n } @else {\n <div class=\"flex flex-col gap-5\">\n <mt-informative-context-selection\n class=\"block\"\n [informativeContext]=\"informativeContext()\"\n [currentSelection]=\"selections()\"\n [preferredTargetSelector]=\"contextTargetSelector()\"\n [applyToken]=\"contextTargetApplyToken()\"\n (templateApply)=\"onContextTemplateApply($event)\"\n />\n\n @if (selections().length) {\n <mt-selection-configuration\n [workspaceId]=\"selectedWorkspaceId()\"\n [chartWorkspace]=\"chartWorkspace()\"\n [modulesProperties]=\"modulesProperties()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [structureLocked]=\"true\"\n [ngModel]=\"selections()\"\n (ngModelChange)=\"onSelectionsChange($event)\"\n />\n }\n </div>\n }\n </div>\n }\n\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\n @if (showSourceLinks() && !needsWorkspacePick()) {\n <div\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\n class=\"flex flex-col gap-5\"\n >\n <mt-source-link-configuration\n [selectionModules]=\"selectionModules()\"\n [ngModel]=\"sourceLinks()\"\n (ngModelChange)=\"onSourceLinksChange($event)\"\n />\n </div>\n }\n\n <!-- ===================== QUERY ===================== -->\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\n @if (loadingProperties()) {\n <div class=\"flex flex-col gap-4\">\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"120px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n <div class=\"grid grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"80px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"90px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n </div>\n </div>\n } @else {\n <!-- Group By Multiple (table views) -->\n @if (showGroupByMultiple()) {\n <mt-string-array-input\n [label]=\"t('groupByMultiple')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('selectGroupByProperties')\"\n [ngModel]=\"groupByMultiple()\"\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\n />\n }\n\n <!-- Query Configuration based on chart type -->\n @switch (queryComponentType()) {\n @case (\"general\") {\n <mt-general-query\n [chartType]=\"getChartTypeId()\"\n [querySchema]=\"querySchema()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onQueryChange($event)\"\n />\n\n <mt-toggle-field\n [label]=\"t('isNormalized')\"\n [ngModel]=\"isNormalized()\"\n (ngModelChange)=\"onIsNormalizedChange($event)\"\n />\n }\n @case (\"table\") {\n <mt-table-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onTableQueryChange($event)\"\n />\n }\n @case (\"timeline\") {\n <mt-timeline-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onTimelineQueryChange($event)\"\n />\n }\n @case (\"timelineMultiLevel\") {\n <div class=\"flex flex-col gap-5\">\n <div class=\"flex items-center justify-between\">\n <p class=\"text-sm text-muted-color\">\n {{ t(\"timelineMultiLevelDescription\") }}\n </p>\n <mt-button\n size=\"small\"\n severity=\"secondary\"\n icon=\"general.plus\"\n [label]=\"t('addLevel')\"\n (onClick)=\"addTimelineLevel()\"\n />\n </div>\n\n <mt-select-field\n [label]=\"t('timeFrame')\"\n [options]=\"timeFrameOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"timelineTimeFrame()\"\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\n />\n\n @for (level of timelineLevels(); track $index) {\n <div\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\n >\n <div class=\"flex items-center justify-between\">\n <span class=\"font-medium\">\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\n </span>\n <mt-button\n size=\"small\"\n severity=\"danger\"\n [text]=\"true\"\n icon=\"general.trash-02\"\n (onClick)=\"removeTimelineLevel($index)\"\n />\n </div>\n\n <div class=\"grid grid-cols-2 gap-3\">\n <mt-select-field\n [label]=\"t('pivotProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.pivotProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'pivotProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('lookupProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.lookupProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'lookupProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('idProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.idProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField($index, 'idProperty', $event)\n \"\n />\n <mt-select-field\n [label]=\"t('startTimeProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.startPoint_timeProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'startPoint_timeProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('endTimeProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.endPoint_timeProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'endPoint_timeProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('progressProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.progressProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'progressProperty',\n $event\n )\n \"\n />\n @if (shouldShowTimelineParentProperty($index)) {\n <mt-select-field\n [label]=\"t('parentProperty')\"\n [options]=\"timelineParentPropertyOptions($index)\"\n optionLabel=\"name\"\n optionValue=\"key\"\n [ngModel]=\"level.parentProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'parentProperty',\n $event\n )\n \"\n />\n }\n </div>\n\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('selectProperties')\"\n [ngModel]=\"level.extraProperties || level.extras || []\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'extraProperties',\n $event\n )\n \"\n />\n </div>\n }\n\n @if (timelineLevels().length === 0) {\n <div class=\"text-center py-4 text-muted-color text-sm\">\n {{ t(\"noTimelineLevelsHint\") }}\n </div>\n }\n </div>\n }\n @case (\"map\") {\n <mt-map-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onMapQueryChange($event)\"\n />\n }\n @case (\"splitter\") {\n <mt-splitter-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onSplitterQueryChange($event)\"\n />\n }\n @case (\"properties\") {\n <mt-properties-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\n />\n }\n @case (\"snapshot\") {\n <mt-snapshot-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\n />\n }\n @case (\"phaseGate\") {\n <div class=\"flex flex-col gap-2\">\n <mt-text-field\n [label]=\"t('levelId')\"\n [ngModel]=\"phaseGateLevelId()\"\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\n />\n <p class=\"text-xs text-muted-color\">\n {{ t(\"phaseGateLevelIdHint\") }}\n </p>\n </div>\n }\n @case (\"repeater\") {\n <div class=\"flex flex-col gap-5\">\n <mt-select-field\n [label]=\"t('repeaterDashboard')\"\n [options]=\"availableDashboards()\"\n optionLabel=\"name\"\n optionValue=\"id\"\n [ngModel]=\"repeaterDashboardId()\"\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\n />\n\n <mt-string-array-input\n [label]=\"t('repeaterSelectedProperties')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\n [ngModel]=\"repeaterSelectedProperties()\"\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\n />\n </div>\n }\n }\n }\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { 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: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { 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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }, { kind: "component", type: SourceLinkConfiguration, selector: "mt-source-link-configuration", inputs: ["selectionModules"] }, { kind: "component", type: CustomApiConfiguration, selector: "mt-custom-api-configuration" }, { kind: "component", type: GeneralQuery, selector: "mt-general-query", inputs: ["chartType", "querySchema", "propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TableQuery, selector: "mt-table-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TimelineQuery, selector: "mt-timeline-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: PropertiesQuery, selector: "mt-properties-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SnapshotQuery, selector: "mt-snapshot-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: MapQuery, selector: "mt-map-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SplitterQuery, selector: "mt-splitter-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: InformativeContextSelection, selector: "mt-informative-context-selection", inputs: ["informativeContext", "currentSelection", "preferredTargetSelector", "applyToken"], outputs: ["templateApply"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DataSourceSettings, isStandalone: true, selector: "mt-data-source-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartType: { classPropertyName: "chartType", publicName: "chartType", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { serviceConfigChange: "serviceConfigChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { 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: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { 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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }, { kind: "component", type: SourceLinkConfiguration, selector: "mt-source-link-configuration", inputs: ["selectionModules"] }, { kind: "component", type: CustomApiConfiguration, selector: "mt-custom-api-configuration" }, { kind: "component", type: GeneralQuery, selector: "mt-general-query", inputs: ["chartType", "querySchema", "propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TableQuery, selector: "mt-table-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TimelineQuery, selector: "mt-timeline-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: PropertiesQuery, selector: "mt-properties-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SnapshotQuery, selector: "mt-snapshot-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: MapQuery, selector: "mt-map-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SplitterQuery, selector: "mt-splitter-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: InformativeContextSelection, selector: "mt-informative-context-selection", inputs: ["informativeContext", "currentSelection", "preferredTargetSelector", "applyToken"], outputs: ["templateApply"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32078
32437
|
}
|
|
32079
32438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DataSourceSettings, decorators: [{
|
|
32080
32439
|
type: Component,
|
|
@@ -32102,7 +32461,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
32102
32461
|
SplitterQuery,
|
|
32103
32462
|
InformativeContextSelection,
|
|
32104
32463
|
StringArrayInput,
|
|
32105
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\n @if (supportsCustomApi()) {\n <div class=\"grid grid-cols-2 gap-3\">\n <button\n type=\"button\"\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\n (click)=\"onModeChange('selection')\"\n >\n <mt-icon\n icon=\"dev.database-01\"\n class=\"mt-0.5 text-lg\"\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\n />\n <span class=\"flex flex-col\">\n <span class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"dataSourceModes.selection\") }}\n </span>\n <span class=\"text-xs text-muted-color\">\n {{ t(\"dataSourceModes.selectionHint\") }}\n </span>\n </span>\n </button>\n\n <button\n type=\"button\"\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\n (click)=\"onModeChange('customApi')\"\n >\n <mt-icon\n icon=\"dev.code-02\"\n class=\"mt-0.5 text-lg\"\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\n />\n <span class=\"flex flex-col\">\n <span class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"dataSourceModes.customApi\") }}\n </span>\n <span class=\"text-xs text-muted-color\">\n {{ t(\"dataSourceModes.customApiHint\") }}\n </span>\n </span>\n </button>\n </div>\n }\n\n <!-- ===================== CUSTOM API MODE ===================== -->\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\n <mt-custom-api-configuration\n [ngModel]=\"customApi()\"\n (ngModelChange)=\"onCustomApiChange($event)\"\n />\n } @else {\n <!-- ===================== SELECTION CYCLE ===================== -->\n\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear -->\n @if (showWorkspaceGate()) {\n @if (needsWorkspacePick()) {\n <div\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\n >\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\n <div class=\"flex flex-col gap-1\">\n <h3 class=\"text-sm font-semibold text-surface-700\">\n {{ t(\"workspaceGateTitle\") }}\n </h3>\n <p class=\"text-xs text-muted-color\">\n {{ t(\"workspaceGateHint\") }}\n </p>\n </div>\n <div class=\"w-full max-w-sm\">\n <mt-select-field\n [options]=\"workspaceOptions()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"t('selectWorkspace')\"\n [filter]=\"true\"\n [ngModel]=\"chartWorkspace()\"\n (ngModelChange)=\"onWorkspacePick($event)\"\n />\n </div>\n </div>\n } @else if (chartWorkspace()) {\n <div\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\n >\n <span class=\"flex items-center gap-2 text-sm\">\n <mt-icon\n icon=\"dev.database-01\"\n class=\"text-base text-primary-500\"\n />\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\n <span class=\"font-medium text-surface-700\">{{\n chartWorkspaceLabel()\n }}</span>\n </span>\n @if (!confirmingWorkspaceChange()) {\n <mt-button\n [label]=\"t('change')\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"requestChangeWorkspace()\"\n />\n } @else {\n <span class=\"flex flex-wrap items-center gap-2\">\n <span class=\"text-xs text-amber-600\">{{\n t(\"changeWorkspaceConfirm\")\n }}</span>\n <mt-button\n [label]=\"t('cancel')\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"cancelChangeWorkspace()\"\n />\n <mt-button\n [label]=\"t('changeAndClear')\"\n severity=\"danger\"\n size=\"small\"\n (onClick)=\"confirmChangeWorkspace()\"\n />\n </span>\n }\n </div>\n }\n }\n\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\n <mt-tabs\n [options]=\"sectionOptions()\"\n optionLabel=\"label\"\n optionValue=\"id\"\n [active]=\"visibleSection()\"\n (onChange)=\"onSectionChange($event)\"\n />\n }\n\n <!-- ===================== SELECTION ===================== -->\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\n <div\n [hidden]=\"visibleSection() !== 'selection'\"\n class=\"flex flex-col gap-5\"\n >\n @if (showInformativeSelectionMode()) {\n <div class=\"flex items-center justify-end\">\n <mt-toggle-field\n [label]=\"t('advancedSelection')\"\n [ngModel]=\"selectionMode() === 'advanced'\"\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\n />\n </div>\n }\n\n @if (\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\n ) {\n <mt-selection-configuration\n [workspaceId]=\"selectedWorkspaceId()\"\n [chartWorkspace]=\"chartWorkspace()\"\n [modulesProperties]=\"modulesProperties()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [ngModel]=\"selections()\"\n (ngModelChange)=\"onSelectionsChange($event)\"\n (moduleChange)=\"onModuleChange($event)\"\n />\n } @else {\n <div class=\"flex flex-col gap-5\">\n <mt-informative-context-selection\n class=\"block\"\n [informativeContext]=\"informativeContext()\"\n [currentSelection]=\"selections()\"\n [preferredTargetSelector]=\"contextTargetSelector()\"\n [applyToken]=\"contextTargetApplyToken()\"\n (templateApply)=\"onContextTemplateApply($event)\"\n />\n\n @if (selections().length) {\n <mt-selection-configuration\n [workspaceId]=\"selectedWorkspaceId()\"\n [chartWorkspace]=\"chartWorkspace()\"\n [modulesProperties]=\"modulesProperties()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [structureLocked]=\"true\"\n [ngModel]=\"selections()\"\n (ngModelChange)=\"onSelectionsChange($event)\"\n />\n }\n </div>\n }\n </div>\n }\n\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\n @if (showSourceLinks() && !needsWorkspacePick()) {\n <div\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\n class=\"flex flex-col gap-5\"\n >\n <mt-source-link-configuration\n [selectionModules]=\"selectionModules()\"\n [ngModel]=\"sourceLinks()\"\n (ngModelChange)=\"onSourceLinksChange($event)\"\n />\n </div>\n }\n\n <!-- ===================== QUERY ===================== -->\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\n @if (loadingProperties()) {\n <div class=\"flex flex-col gap-4\">\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"120px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n <div class=\"grid grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"80px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"90px\" height=\"16px\" />\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\n </div>\n </div>\n </div>\n } @else {\n <!-- Group By Multiple (table views) -->\n @if (showGroupByMultiple()) {\n <mt-string-array-input\n [label]=\"t('groupByMultiple')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('selectGroupByProperties')\"\n [ngModel]=\"groupByMultiple()\"\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\n />\n }\n\n <!-- Query Configuration based on chart type -->\n @switch (queryComponentType()) {\n @case (\"general\") {\n <mt-general-query\n [chartType]=\"getChartTypeId()\"\n [querySchema]=\"querySchema()\"\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onQueryChange($event)\"\n />\n\n <mt-toggle-field\n [label]=\"t('isNormalized')\"\n [ngModel]=\"isNormalized()\"\n (ngModelChange)=\"onIsNormalizedChange($event)\"\n />\n }\n @case (\"table\") {\n <mt-table-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onTableQueryChange($event)\"\n />\n }\n @case (\"timeline\") {\n <mt-timeline-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onTimelineQueryChange($event)\"\n />\n }\n @case (\"timelineMultiLevel\") {\n <div class=\"flex flex-col gap-5\">\n <div class=\"flex items-center justify-between\">\n <p class=\"text-sm text-muted-color\">\n {{ t(\"timelineMultiLevelDescription\") }}\n </p>\n <mt-button\n size=\"small\"\n severity=\"secondary\"\n icon=\"general.plus\"\n [label]=\"t('addLevel')\"\n (onClick)=\"addTimelineLevel()\"\n />\n </div>\n\n <mt-select-field\n [label]=\"t('timeFrame')\"\n [options]=\"timeFrameOptions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [ngModel]=\"timelineTimeFrame()\"\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\n />\n\n @for (level of timelineLevels(); track $index) {\n <div\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\n >\n <div class=\"flex items-center justify-between\">\n <span class=\"font-medium\">\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\n </span>\n <mt-button\n size=\"small\"\n severity=\"danger\"\n [text]=\"true\"\n icon=\"general.trash-02\"\n (onClick)=\"removeTimelineLevel($index)\"\n />\n </div>\n\n <div class=\"grid grid-cols-2 gap-3\">\n <mt-select-field\n [label]=\"t('pivotProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.pivotProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'pivotProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('lookupProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.lookupProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'lookupProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('idProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.idProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField($index, 'idProperty', $event)\n \"\n />\n <mt-select-field\n [label]=\"t('startTimeProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.startPoint_timeProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'startPoint_timeProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('endTimeProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.endPoint_timeProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'endPoint_timeProperty',\n $event\n )\n \"\n />\n <mt-select-field\n [label]=\"t('progressProperty')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [ngModel]=\"level.progressProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'progressProperty',\n $event\n )\n \"\n />\n @if (shouldShowTimelineParentProperty($index)) {\n <mt-select-field\n [label]=\"t('parentProperty')\"\n [options]=\"timelineParentPropertyOptions($index)\"\n optionLabel=\"name\"\n optionValue=\"key\"\n [ngModel]=\"level.parentProperty\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'parentProperty',\n $event\n )\n \"\n />\n }\n </div>\n\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('selectProperties')\"\n [ngModel]=\"level.extraProperties || level.extras || []\"\n (ngModelChange)=\"\n updateTimelineLevelField(\n $index,\n 'extraProperties',\n $event\n )\n \"\n />\n </div>\n }\n\n @if (timelineLevels().length === 0) {\n <div class=\"text-center py-4 text-muted-color text-sm\">\n {{ t(\"noTimelineLevelsHint\") }}\n </div>\n }\n </div>\n }\n @case (\"map\") {\n <mt-map-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onMapQueryChange($event)\"\n />\n }\n @case (\"splitter\") {\n <mt-splitter-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onSplitterQueryChange($event)\"\n />\n }\n @case (\"properties\") {\n <mt-properties-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\n />\n }\n @case (\"snapshot\") {\n <mt-snapshot-query\n [propertiesFlat]=\"propertiesFlat()\"\n [propertiesGrouped]=\"propertiesGrouped()\"\n [ngModel]=\"query()\"\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\n />\n }\n @case (\"phaseGate\") {\n <div class=\"flex flex-col gap-2\">\n <mt-text-field\n [label]=\"t('levelId')\"\n [ngModel]=\"phaseGateLevelId()\"\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\n />\n <p class=\"text-xs text-muted-color\">\n {{ t(\"phaseGateLevelIdHint\") }}\n </p>\n </div>\n }\n @case (\"repeater\") {\n <div class=\"flex flex-col gap-5\">\n <mt-select-field\n [label]=\"t('repeaterDashboard')\"\n [options]=\"availableDashboards()\"\n optionLabel=\"name\"\n optionValue=\"id\"\n [ngModel]=\"repeaterDashboardId()\"\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\n />\n\n <mt-string-array-input\n [label]=\"t('repeaterSelectedProperties')\"\n [options]=\"\n propertiesGrouped().length > 1\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"propertiesGrouped().length > 1\"\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\n [ngModel]=\"repeaterSelectedProperties()\"\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\n />\n </div>\n }\n }\n }\n </div>\n }\n }\n</div>\n" }]
|
|
32464
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n" }]
|
|
32106
32465
|
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartType: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartType", required: false }] }], informativeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "informativeContext", required: false }] }], serviceConfigChange: [{ type: i0.Output, args: ["serviceConfigChange"] }] } });
|
|
32107
32466
|
|
|
32108
32467
|
/**
|
|
@@ -32271,7 +32630,7 @@ class ManageItem {
|
|
|
32271
32630
|
this.chartLevelLogs.set(Array.isArray(level?.logs) ? level.logs : []);
|
|
32272
32631
|
}
|
|
32273
32632
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32274
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ManageItem, isStandalone: true, selector: "mt-manage-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, providers: [ManageItemService], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"flex flex-col h-full\" [class]=\"modal.contentClass\">\n <div class=\"flex flex-1 min-h-0\">\n <!-- Left: Datasource configuration -->\n <div\n class=\"db-sectioned-drawer flex min-w-0 flex-col\"\n [class.flex-1]=\"previewCollapsed()\"\n [class.border-r]=\"!previewCollapsed()\"\n [class.border-surface-200]=\"!previewCollapsed()\"\n [style.width]=\"previewCollapsed() ? '100%' : '60%'\"\n >\n <!-- Header: chart type badge + preview toggle -->\n <div\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-2.5\"\n >\n @if (selectedChartType()) {\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"selectedChartType()?.icon\" class=\"text-lg\" />\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"truncate text-sm font-semibold text-surface-700\">\n {{ isNew() ? t(\"newItem\") : t(\"editItem\") }}\n </h3>\n <p class=\"truncate text-xs text-muted-color\">\n {{ selectedChartType()?.name }}\n </p>\n </div>\n } @else {\n <div class=\"flex-1\"></div>\n }\n\n <mt-button\n [label]=\"previewCollapsed() ? t('showPreview') : t('hidePreview')\"\n [icon]=\"previewCollapsed() ? 'general.eye' : 'general.eye-off'\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"togglePreview()\"\n />\n </div>\n\n <!-- Tabs: Data source | Filters (matches the old chart editor). -->\n <div\n class=\"flex items-center gap-1 border-b border-surface-200 px-4 pt-2\"\n >\n <button\n type=\"button\"\n class=\"-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors\"\n [class.border-primary-500]=\"activeTab() === 'datasource'\"\n [class.text-primary-600]=\"activeTab() === 'datasource'\"\n [class.border-transparent]=\"activeTab() !== 'datasource'\"\n [class.text-muted-color]=\"activeTab() !== 'datasource'\"\n (click)=\"activeTab.set('datasource')\"\n >\n {{ t(\"dataSource\") }}\n </button>\n <button\n type=\"button\"\n class=\"-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors\"\n [class.border-primary-500]=\"activeTab() === 'filters'\"\n [class.text-primary-600]=\"activeTab() === 'filters'\"\n [class.border-transparent]=\"activeTab() !== 'filters'\"\n [class.text-muted-color]=\"activeTab() !== 'filters'\"\n (click)=\"activeTab.set('filters')\"\n >\n {{ t(\"filters\") }}\n </button>\n </div>\n\n <!-- Content -->\n <div class=\"flex-1 overflow-auto p-4\">\n @if (activeTab() === \"datasource\") {\n <mt-data-source-settings\n [config]=\"config()\"\n [chartType]=\"selectedChartType()\"\n [informativeContext]=\"informativeContext()\"\n (serviceConfigChange)=\"onServiceConfigUpdate($event)\"\n />\n } @else {\n <!-- Per-chart interactive filters builder (the controls end users\n change on this chart at runtime). -->\n <mt-dynamic-filters-config\n [ngModel]=\"dynamicFilters()\"\n (ngModelChange)=\"onDynamicFiltersChange($event)\"\n [lookups]=\"chartLookups()\"\n [levelsSchema]=\"chartLevelsSchema()\"\n [levelLogs]=\"chartLevelLogs()\"\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\n />\n }\n </div>\n </div>\n\n <!-- Right: collapsible chart preview -->\n @if (!previewCollapsed()) {\n <div class=\"h-full min-w-[350px]\" [style.width]=\"'40%'\">\n <mt-chart-viewer [config]=\"config()\" [chartTypeId]=\"chartTypeId()\" />\n </div>\n }\n </div>\n </div>\n\n <!-- Footer -->\n <div [class]=\"modal.footerClass\">\n <!-- Validation Status -->\n <div class=\"flex items-center gap-2 text-sm flex-1\">\n @if (isValid()) {\n <span class=\"flex items-center gap-1 text-green-600\">\n <mt-icon icon=\"general.check-circle\" class=\"text-base\" />\n {{ t(\"ready\") }}\n </span>\n } @else {\n <span class=\"flex items-center gap-1 text-amber-600\">\n <mt-icon icon=\"general.alert-circle\" class=\"text-base\" />\n {{ t(\"incomplete\") }}\n </span>\n }\n </div>\n\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"cancel()\" />\n <mt-button\n [label]=\"t('save')\"\n icon=\"general.save-02\"\n [loading]=\"saving()\"\n [disabled]=\"!isValid()\"\n (onClick)=\"save()\"\n />\n </div>\n</ng-container>\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DataSourceSettings, selector: "mt-data-source-settings", inputs: ["config", "chartType", "informativeContext"], outputs: ["serviceConfigChange"] }, { kind: "component", type: ChartViewer, selector: "mt-chart-viewer", inputs: ["config", "chartTypeId"] }, { kind: "component", type: DynamicFiltersConfig, selector: "mt-dynamic-filters-config", inputs: ["lookups", "levelsSchema", "levelLogs", "productType"], outputs: ["loadLevelLogs"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32633
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ManageItem, isStandalone: true, selector: "mt-manage-item", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, providers: [ManageItemService], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\n <div class=\"flex flex-col h-full\" [class]=\"modal.contentClass\">\n <div class=\"flex flex-1 min-h-0\">\n <!-- Left: Datasource configuration -->\n <div\n class=\"db-sectioned-drawer flex min-w-0 flex-col\"\n [class.flex-1]=\"previewCollapsed()\"\n [class.border-r]=\"!previewCollapsed()\"\n [class.border-surface-200]=\"!previewCollapsed()\"\n [style.width]=\"previewCollapsed() ? '100%' : '60%'\"\n >\n <!-- Header: chart type badge + preview toggle -->\n <div\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-2.5\"\n >\n @if (selectedChartType()) {\n <span\n class=\"flex h-9 w-9 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\n >\n <mt-icon [icon]=\"selectedChartType()?.icon\" class=\"text-lg\" />\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"truncate text-sm font-semibold text-surface-700\">\n {{ isNew() ? t(\"newItem\") : t(\"editItem\") }}\n </h3>\n <p class=\"truncate text-xs text-muted-color\">\n {{ selectedChartType()?.name }}\n </p>\n </div>\n } @else {\n <div class=\"flex-1\"></div>\n }\n\n <mt-button\n [label]=\"previewCollapsed() ? t('showPreview') : t('hidePreview')\"\n [icon]=\"previewCollapsed() ? 'general.eye' : 'general.eye-off'\"\n severity=\"secondary\"\n variant=\"outlined\"\n size=\"small\"\n (onClick)=\"togglePreview()\"\n />\n </div>\n\n <!-- Tabs: Data source | Filters (matches the old chart editor). -->\n <div\n class=\"flex items-center gap-1 border-b border-surface-200 px-4 pt-2\"\n >\n <button\n type=\"button\"\n class=\"-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors\"\n [class.border-primary-500]=\"activeTab() === 'datasource'\"\n [class.text-primary-600]=\"activeTab() === 'datasource'\"\n [class.border-transparent]=\"activeTab() !== 'datasource'\"\n [class.text-muted-color]=\"activeTab() !== 'datasource'\"\n (click)=\"activeTab.set('datasource')\"\n >\n {{ t(\"dataSource\") }}\n </button>\n <button\n type=\"button\"\n class=\"-mb-px border-b-2 px-3 py-2 text-sm font-medium transition-colors\"\n [class.border-primary-500]=\"activeTab() === 'filters'\"\n [class.text-primary-600]=\"activeTab() === 'filters'\"\n [class.border-transparent]=\"activeTab() !== 'filters'\"\n [class.text-muted-color]=\"activeTab() !== 'filters'\"\n (click)=\"activeTab.set('filters')\"\n >\n {{ t(\"filters\") }}\n </button>\n </div>\n\n <!-- Content -->\n <div class=\"flex-1 overflow-auto p-4\">\n @if (activeTab() === \"datasource\") {\n <mt-data-source-settings\n [config]=\"config()\"\n [chartType]=\"selectedChartType()\"\n [informativeContext]=\"informativeContext()\"\n (serviceConfigChange)=\"onServiceConfigUpdate($event)\"\n />\n } @else {\n <!-- Per-chart interactive filters builder (the controls end users\n change on this chart at runtime). -->\n <mt-dynamic-filters-config\n [ngModel]=\"dynamicFilters()\"\n (ngModelChange)=\"onDynamicFiltersChange($event)\"\n [lookups]=\"chartLookups()\"\n [levelsSchema]=\"chartLevelsSchema()\"\n [levelLogs]=\"chartLevelLogs()\"\n (loadLevelLogs)=\"onLoadLevelLogs($event)\"\n />\n }\n </div>\n </div>\n\n <!-- Right: collapsible chart preview -->\n @if (!previewCollapsed()) {\n <div class=\"h-full min-w-[350px]\" [style.width]=\"'40%'\">\n <mt-chart-viewer [config]=\"config()\" [chartTypeId]=\"chartTypeId()\" />\n </div>\n }\n </div>\n </div>\n\n <!-- Footer -->\n <div [class]=\"modal.footerClass\">\n <!-- Validation Status -->\n <div class=\"flex items-center gap-2 text-sm flex-1\">\n @if (isValid()) {\n <span class=\"flex items-center gap-1 text-green-600\">\n <mt-icon icon=\"general.check-circle\" class=\"text-base\" />\n {{ t(\"ready\") }}\n </span>\n } @else {\n <span class=\"flex items-center gap-1 text-amber-600\">\n <mt-icon icon=\"general.alert-circle\" class=\"text-base\" />\n {{ t(\"incomplete\") }}\n </span>\n }\n </div>\n\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"cancel()\" />\n <mt-button\n [label]=\"t('save')\"\n icon=\"general.save-02\"\n [loading]=\"saving()\"\n [disabled]=\"!isValid()\"\n (onClick)=\"save()\"\n />\n </div>\n</ng-container>\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: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DataSourceSettings, selector: "mt-data-source-settings", inputs: ["config", "chartType", "informativeContext"], outputs: ["serviceConfigChange"] }, { kind: "component", type: ChartViewer, selector: "mt-chart-viewer", inputs: ["config", "chartTypeId"] }, { kind: "component", type: DynamicFiltersConfig, selector: "mt-dynamic-filters-config", inputs: ["lookups", "levelsSchema", "levelLogs", "productType", "workspaceId", "chartWorkspace"], outputs: ["loadLevelLogs"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32275
32634
|
}
|
|
32276
32635
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageItem, decorators: [{
|
|
32277
32636
|
type: Component,
|
|
@@ -38336,6 +38695,7 @@ class DashboardBuilder {
|
|
|
38336
38695
|
// Filter
|
|
38337
38696
|
// ============================================
|
|
38338
38697
|
openManageFilter() {
|
|
38698
|
+
const filterSelectionContext = this.resolveManageFilterSelectionContext();
|
|
38339
38699
|
const ref = this.modalService.openModal(ManageFilterOnPage, 'drawer', {
|
|
38340
38700
|
header: this.transloco.translate('dashboardBuilder.manageFilter'),
|
|
38341
38701
|
styleClass: '!w-[56rem] max-w-[96vw] !absolute',
|
|
@@ -38343,6 +38703,8 @@ class DashboardBuilder {
|
|
|
38343
38703
|
position: 'end',
|
|
38344
38704
|
inputValues: {
|
|
38345
38705
|
data: this.filtersConfig() || [],
|
|
38706
|
+
workspaceId: filterSelectionContext.workspaceId,
|
|
38707
|
+
chartWorkspace: filterSelectionContext.chartWorkspace,
|
|
38346
38708
|
},
|
|
38347
38709
|
});
|
|
38348
38710
|
ref.onClose.subscribe((result) => {
|
|
@@ -38373,6 +38735,85 @@ class DashboardBuilder {
|
|
|
38373
38735
|
}
|
|
38374
38736
|
});
|
|
38375
38737
|
}
|
|
38738
|
+
resolveManageFilterSelectionContext() {
|
|
38739
|
+
const resolveFromConfig = (config) => {
|
|
38740
|
+
const serviceConfig = config?.serviceConfig;
|
|
38741
|
+
if (!serviceConfig) {
|
|
38742
|
+
return { workspaceId: null, chartWorkspace: null };
|
|
38743
|
+
}
|
|
38744
|
+
const workspaceId = this.resolveWorkspaceId(config);
|
|
38745
|
+
const workspace = serviceConfig['workspace'];
|
|
38746
|
+
const selection = serviceConfig['selection'];
|
|
38747
|
+
const restoredWorkspace = typeof workspace === 'string'
|
|
38748
|
+
? workspace
|
|
38749
|
+
: this.deriveWorkspaceFromSelections(selection);
|
|
38750
|
+
return {
|
|
38751
|
+
workspaceId,
|
|
38752
|
+
chartWorkspace: restoredWorkspace,
|
|
38753
|
+
};
|
|
38754
|
+
};
|
|
38755
|
+
for (const item of [...this.charts(), ...this.dialogs()]) {
|
|
38756
|
+
const context = resolveFromConfig(item.config);
|
|
38757
|
+
if (context.workspaceId !== null || context.chartWorkspace) {
|
|
38758
|
+
return context;
|
|
38759
|
+
}
|
|
38760
|
+
}
|
|
38761
|
+
for (const field of this.filtersConfig()) {
|
|
38762
|
+
const payload = field?.configuration?.payload;
|
|
38763
|
+
if (!payload)
|
|
38764
|
+
continue;
|
|
38765
|
+
const workspaceId = payload['workspaceId'];
|
|
38766
|
+
const workspace = payload['workspace'];
|
|
38767
|
+
if (workspaceId !== null &&
|
|
38768
|
+
workspaceId !== undefined &&
|
|
38769
|
+
workspaceId !== '') {
|
|
38770
|
+
return {
|
|
38771
|
+
workspaceId: workspaceId,
|
|
38772
|
+
chartWorkspace: typeof workspace === 'string' ? workspace : null,
|
|
38773
|
+
};
|
|
38774
|
+
}
|
|
38775
|
+
if (typeof workspace === 'string' && workspace) {
|
|
38776
|
+
return { workspaceId: null, chartWorkspace: workspace };
|
|
38777
|
+
}
|
|
38778
|
+
}
|
|
38779
|
+
return { workspaceId: null, chartWorkspace: null };
|
|
38780
|
+
}
|
|
38781
|
+
deriveWorkspaceFromSelections(selections) {
|
|
38782
|
+
const levelSelection = (selections ?? []).find((selection) => /^Level:/i.test(selection.selector ?? ''));
|
|
38783
|
+
return this.deriveWorkspaceFromLevelSelector(levelSelection?.selector);
|
|
38784
|
+
}
|
|
38785
|
+
deriveWorkspaceFromLevelSelector(levelSelector) {
|
|
38786
|
+
const selector = this.firstSelector(levelSelector);
|
|
38787
|
+
if (!selector)
|
|
38788
|
+
return null;
|
|
38789
|
+
const tree = this.dashboardService.treeData().length > 0
|
|
38790
|
+
? this.dashboardService.treeData()
|
|
38791
|
+
: (this.dashboardService.getCachedModulesTree({
|
|
38792
|
+
services: this.services() ? [...(this.services() ?? [])] : [],
|
|
38793
|
+
}) ??
|
|
38794
|
+
this.dashboardService.getCachedModulesTree() ??
|
|
38795
|
+
[]);
|
|
38796
|
+
for (const service of tree) {
|
|
38797
|
+
for (const module of service.modules ?? []) {
|
|
38798
|
+
if (module.id !== 'Level')
|
|
38799
|
+
continue;
|
|
38800
|
+
for (const parent of module.values ?? []) {
|
|
38801
|
+
if ((parent.children ?? []).some((child) => child.selector === selector)) {
|
|
38802
|
+
return parent.selector;
|
|
38803
|
+
}
|
|
38804
|
+
}
|
|
38805
|
+
}
|
|
38806
|
+
}
|
|
38807
|
+
return null;
|
|
38808
|
+
}
|
|
38809
|
+
firstSelector(selector) {
|
|
38810
|
+
if (!selector)
|
|
38811
|
+
return null;
|
|
38812
|
+
const [moduleType, ids] = selector.split(':');
|
|
38813
|
+
if (!moduleType || !ids)
|
|
38814
|
+
return selector;
|
|
38815
|
+
return `${moduleType}:${ids.split(',')[0]}`;
|
|
38816
|
+
}
|
|
38376
38817
|
applyBulkSelectionFilters(sourceSelections, operation) {
|
|
38377
38818
|
const normalizedSource = sourceSelections.filter((selection) => (selection.filters ?? []).some((filter) => !!filter?.propertyKey));
|
|
38378
38819
|
if (!normalizedSource.length)
|
|
@@ -43437,4 +43878,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
43437
43878
|
*/
|
|
43438
43879
|
|
|
43439
43880
|
export { SPlusChartHandler as $, TopbarCardComponent as A, ChartDataService as B, CardContentComponent as C, DashboardItemStoreService as D, EChartComponent as E, FilterUtilsService as F, BarChartHandler as G, HeaderCardComponent as H, PieChartHandler as I, StackBarChartHandler as J, axisFormatters as K, LastHistoryLevelCardComponent as L, groupDatesByYearAndMonth as M, GaugeChartHandler as N, TableViewHandler as O, PropertiesCardComponent as P, OverviewCardHandler as Q, TimelineHandler as R, StaticFiltersComponent as S, TableCardComponent as T, LineChartHandler as U, SnapshotHandler as V, ComparisonChartHandler as W, SplitterChartHandler as X, LevelCardHandler as Y, MapChartHandler as Z, RingGaugeChartHandler as _, DashboardItem as a, moduleIdFromSelector as a$, PhaseGateStepperHandler as a0, formatCurrency as a1, getCurrencySuffix as a2, formatPercentage as a3, formatNumber as a4, formatDate as a5, createAxisFormatter as a6, createTooltipFormatter as a7, formatWordsUnderBar as a8, formatXAxis as a9, expandResetPatches as aA, StyleField as aB, SegmentedField as aC, ColorListField as aD, ArrayBuilderField as aE, KeyValueMapField as aF, LegendOrderField as aG, ItemCardMenuComponent as aH, ChartFilterDrawer as aI, ItemContextToolbarComponent as aJ, ItemConfigPopoverComponent as aK, GuidedConfigDialogComponent as aL, FilterChipsBarComponent as aM, FilterBuilderComponent as aN, DatasourcePanelComponent as aO, SchemaControlRendererComponent as aP, FilterByGroupPipe as aQ, GetChartActionsPipe as aR, CHART_CAPABILITIES as aS, getCapabilityById as aT, resolveCapability as aU, toBackendChartType as aV, normalizeChartTypeForRequest as aW, normalizeFilterOperation as aX, normalizeAggregateFunction as aY, normalizeFilters as aZ, selectorFromLegacy as a_, handleFiltersForCustom as aa, handleFilterForCard as ab, handleFilterForSnapshot as ac, DashboardList as ad, HTTPMethod as ae, DashboardBuilderService as af, DashboardStoreService as ag, ManagePages as ah, ManageBreadcrumb as ai, ManageFilterOnPage as aj, DynamicFiltersConfig as ak, ChartSettingsDrawer as al, DisplaySettings as am, DefaultControlUi as an, PieControlUi as ao, BarControlUi as ap, StackBarControlUi as aq, ManageItem as ar, CHART_TYPES as as, ManageItemService as at, GeneralSettings as au, DataSourceSettings as av, ActionsSettings as aw, ChartViewer as ax, StyleStudioDrawer as ay, StyleSettingsRenderer as az, DashboardBuilder as b, toBackendSourceLink as b0, toFormSourceLink as b1, normalizeOnLoad as b2, normalizeBeforeSave as b3, normalizeBeforeRequest as b4, CONFIG_DOMAINS as b5, domainsForCapability as b6, findDomain as b7, POPOVER_TABS as b8, POPOVER_TAB_SPECS as b9, setByPath as bA, applyControlPatchToPersisted as bB, applyControlPatchesToPersisted as bC, getControlSchema as bD, listControlSchemaIds as bE, listControlSchemas as bF, getFallbackControlSchema as bG, flattenSchema as bH, resolveDisplayFields as bI, buildDisplayFieldPredicate as bJ, bindingKey as bK, getBinding as bL, listBindings as bM, listBindingsForChart as bN, readBoundValue as bO, ITEM_GUIDANCE_REGISTRY as bP, describeGuidance as bQ, ItemGuidanceService as bR, titleToUi as ba, applyTitleToPersisted as bb, datasourceToUi as bc, fieldsToUi as bd, filtersToUi as be, styleToUi as bf, applyStyleToPersisted as bg, layoutToUi as bh, applyLayoutToPersisted as bi, labelLegendFormatToUi as bj, applyLabelLegendFormatToPersisted as bk, behaviorToUi as bl, applyBehaviorToPersisted as bm, applyFilterChipsToPersisted as bn, persistedToUi as bo, buildAssembly as bp, STYLE_PRESETS as bq, presetsForCapability as br, findPreset as bs, validate as bt, hasBlockingIssues as bu, groupIssuesByDomain as bv, parseAdvancedJson as bw, deepMerge$1 as bx, formatForEditor as by, readByPath$1 as bz, cloneDeep$1 as c, DashboardViewer as d, switchAllKeysSmall$1 as e, dynamicTextReplace as f, getNestedData as g, dynamicReorder as h, generalConfiguration as i, formatValue as j, getLocalizedTitle as k, sortChartData as l, addCommasToNumber as m, sortDataTableView as n, isMobilePlatform$1 as o, getColorFromConditions as p, CardFilterComponent as q, DynamicFiltersComponent as r, switchAllKeysToLower as s, CardInfoComponent as t, ChartCardComponent as u, EntityInfoComponent as v, EntityPreviewCardComponent as w, ListStatisticCardComponent as x, SkeletonCardComponent as y, StatisticCardComponent as z };
|
|
43440
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
43881
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-78XZqtjp.mjs.map
|