@masterteam/dashboard-builder 0.0.80 → 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/assets/dashboard-builder.css +1 -1
- package/assets/i18n/ar.json +10 -0
- package/assets/i18n/en.json +10 -0
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-BsX3GS-x.mjs → masterteam-dashboard-builder-dashboard-dialog.component-B5jqgAas.mjs} +10 -5
- package/fesm2022/masterteam-dashboard-builder-dashboard-dialog.component-B5jqgAas.mjs.map +1 -0
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-DwcYTQ0c.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-B_mWi5v-.mjs} +573 -145
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-B_mWi5v-.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +3 -4
- package/types/masterteam-dashboard-builder.d.ts +60 -11
- package/fesm2022/masterteam-dashboard-builder-dashboard-dialog.component-BsX3GS-x.mjs.map +0 -1
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-DwcYTQ0c.mjs.map +0 -1
|
@@ -44,7 +44,7 @@ import * as i5 from 'primeng/popover';
|
|
|
44
44
|
import { PopoverModule, Popover } from 'primeng/popover';
|
|
45
45
|
import * as i6 from 'primeng/select';
|
|
46
46
|
import { SelectModule } from 'primeng/select';
|
|
47
|
-
import {
|
|
47
|
+
import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog';
|
|
48
48
|
import { DynamicDrawerConfig, DrawerController } from '@masterteam/components/dynamic-drawer';
|
|
49
49
|
import { Tooltip as Tooltip$1, TruncateTooltip } from '@masterteam/components/tooltip';
|
|
50
50
|
import { ToastService } from '@masterteam/components/toast';
|
|
@@ -60,7 +60,7 @@ import { ColorPickerField } from '@masterteam/components/color-picker-field';
|
|
|
60
60
|
import { IconField } from '@masterteam/components/icon-field';
|
|
61
61
|
import * as i2$2 from '@angular/cdk/drag-drop';
|
|
62
62
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
63
|
-
import {
|
|
63
|
+
import { createOperatorToken, createTextToken, createPropertyToken, FormulaToolbar, FormulaEditor } from '@masterteam/components/formula';
|
|
64
64
|
import { RadioCards } from '@masterteam/components/radio-cards';
|
|
65
65
|
import { Menu } from '@masterteam/components/menu';
|
|
66
66
|
import { Chip } from '@masterteam/components/chip';
|
|
@@ -71,10 +71,25 @@ import * as i2$5 from 'primeng/inputnumber';
|
|
|
71
71
|
import { InputNumberModule } from 'primeng/inputnumber';
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* `ModuleClassificationEnum.Log
|
|
75
|
-
*
|
|
74
|
+
* `ModuleClassificationEnum.Log` — `1` is `Process`.
|
|
75
|
+
*
|
|
76
|
+
* Enum serialization is NOT uniform across the API: `GET Modules?LevelId=`
|
|
77
|
+
* emits the enum **name** (`"Log"` / `"Process"`) while other endpoints emit
|
|
78
|
+
* the ordinal. Compare through `isLogClassification`, never with a bare `===`
|
|
79
|
+
* against this constant — a strict ordinal check silently drops every module.
|
|
76
80
|
*/
|
|
77
81
|
const MODULE_CLASSIFICATION_LOG = 0;
|
|
82
|
+
/** The name form of `MODULE_CLASSIFICATION_LOG`. */
|
|
83
|
+
const MODULE_CLASSIFICATION_LOG_NAME = 'Log';
|
|
84
|
+
/** True when a `ModuleDto.classification` means `Log`, in either serialization. */
|
|
85
|
+
function isLogClassification(classification) {
|
|
86
|
+
if (classification === null || classification === undefined)
|
|
87
|
+
return false;
|
|
88
|
+
return typeof classification === 'number'
|
|
89
|
+
? classification === MODULE_CLASSIFICATION_LOG
|
|
90
|
+
: classification.toLowerCase() ===
|
|
91
|
+
MODULE_CLASSIFICATION_LOG_NAME.toLowerCase();
|
|
92
|
+
}
|
|
78
93
|
/**
|
|
79
94
|
* HTTP methods for custom API
|
|
80
95
|
*/
|
|
@@ -799,11 +814,14 @@ class DashboardBuilderService {
|
|
|
799
814
|
* `Modules?LevelId=` returns the whole module catalog and flags the level's
|
|
800
815
|
* own modules with `isActive`, so both predicates are required: `isActive`
|
|
801
816
|
* scopes to the level, `classification` keeps logs and drops Process modules.
|
|
817
|
+
*
|
|
818
|
+
* The classification test goes through `isLogClassification` because this
|
|
819
|
+
* endpoint serializes the enum as its **name**, not its ordinal.
|
|
802
820
|
*/
|
|
803
821
|
toLevelLogs(modules) {
|
|
804
822
|
return modules
|
|
805
823
|
.filter((module) => module.isActive === true &&
|
|
806
|
-
module.classification
|
|
824
|
+
isLogClassification(module.classification))
|
|
807
825
|
.map((module) => ({
|
|
808
826
|
id: module.id,
|
|
809
827
|
description: module.name?.display || module.name?.en || module.key || '',
|
|
@@ -3295,6 +3313,72 @@ function readPropertyKey(value) {
|
|
|
3295
3313
|
return typeof value === 'string' ? value.trim() : '';
|
|
3296
3314
|
}
|
|
3297
3315
|
|
|
3316
|
+
/**
|
|
3317
|
+
* Convert the scoped property references and inter-token whitespace emitted by
|
|
3318
|
+
* Formula Engine into the compact legacy Dashboard Builder backend dialect.
|
|
3319
|
+
* Whitespace inside quoted custom values remains significant.
|
|
3320
|
+
*/
|
|
3321
|
+
function normalizeDashboardFormula(expression) {
|
|
3322
|
+
const unscoped = expression.replace(/@Current::/g, '');
|
|
3323
|
+
let compact = '';
|
|
3324
|
+
let quote = null;
|
|
3325
|
+
let escaped = false;
|
|
3326
|
+
for (const character of unscoped) {
|
|
3327
|
+
if (quote) {
|
|
3328
|
+
compact += character;
|
|
3329
|
+
if (escaped) {
|
|
3330
|
+
escaped = false;
|
|
3331
|
+
}
|
|
3332
|
+
else if (character === '\\') {
|
|
3333
|
+
escaped = true;
|
|
3334
|
+
}
|
|
3335
|
+
else if (character === quote) {
|
|
3336
|
+
quote = null;
|
|
3337
|
+
}
|
|
3338
|
+
continue;
|
|
3339
|
+
}
|
|
3340
|
+
if (character === '"' || character === "'") {
|
|
3341
|
+
quote = character;
|
|
3342
|
+
compact += character;
|
|
3343
|
+
continue;
|
|
3344
|
+
}
|
|
3345
|
+
if (!/\s/.test(character)) {
|
|
3346
|
+
compact += character;
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
return compact;
|
|
3350
|
+
}
|
|
3351
|
+
/**
|
|
3352
|
+
* Normalize formula-bearing GeneralQuery series without touching other query
|
|
3353
|
+
* shapes. Pure: returns the original reference when no migration is needed.
|
|
3354
|
+
*/
|
|
3355
|
+
function normalizeDashboardQueryFormulas(query) {
|
|
3356
|
+
if (!query || typeof query !== 'object' || Array.isArray(query)) {
|
|
3357
|
+
return query;
|
|
3358
|
+
}
|
|
3359
|
+
const source = query;
|
|
3360
|
+
if (!Array.isArray(source['series'])) {
|
|
3361
|
+
return query;
|
|
3362
|
+
}
|
|
3363
|
+
let changed = false;
|
|
3364
|
+
const series = source['series'].map((item) => {
|
|
3365
|
+
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
3366
|
+
return item;
|
|
3367
|
+
}
|
|
3368
|
+
const current = item;
|
|
3369
|
+
if (typeof current['formula'] !== 'string') {
|
|
3370
|
+
return item;
|
|
3371
|
+
}
|
|
3372
|
+
const formula = normalizeDashboardFormula(current['formula']);
|
|
3373
|
+
if (formula === current['formula']) {
|
|
3374
|
+
return item;
|
|
3375
|
+
}
|
|
3376
|
+
changed = true;
|
|
3377
|
+
return { ...current, formula };
|
|
3378
|
+
});
|
|
3379
|
+
return changed ? { ...source, series } : query;
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3298
3382
|
/**
|
|
3299
3383
|
* Chart Config Normalizer.
|
|
3300
3384
|
*
|
|
@@ -3551,7 +3635,7 @@ function normalizeOnLoad(config) {
|
|
|
3551
3635
|
serviceConfig['customApi'] = ca;
|
|
3552
3636
|
}
|
|
3553
3637
|
if (serviceConfig['query']) {
|
|
3554
|
-
serviceConfig['query'] = normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(serviceConfig['query']));
|
|
3638
|
+
serviceConfig['query'] = normalizeDashboardQueryFormulas(normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(serviceConfig['query'])));
|
|
3555
3639
|
}
|
|
3556
3640
|
// 4b. Pass-2: also normalize Equal→Equals in additional filter buckets so
|
|
3557
3641
|
// legacy `Equal` from clientConfig.filter.configs / serviceConfig.filters
|
|
@@ -3724,7 +3808,7 @@ function normalizeBeforeSave(config) {
|
|
|
3724
3808
|
});
|
|
3725
3809
|
}
|
|
3726
3810
|
if (serviceConfig['query']) {
|
|
3727
|
-
serviceConfig['query'] = normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(serviceConfig['query']));
|
|
3811
|
+
serviceConfig['query'] = normalizeDashboardQueryFormulas(normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(serviceConfig['query'])));
|
|
3728
3812
|
if (isPhaseGateTableQuery(serviceConfig['query'])) {
|
|
3729
3813
|
serviceConfig['query'] = toCanonicalPhaseGateTableQuery(serviceConfig['query']);
|
|
3730
3814
|
delete serviceConfig['groupByMultiple'];
|
|
@@ -3760,7 +3844,7 @@ function normalizeBeforeRequest(serviceConfig) {
|
|
|
3760
3844
|
next['chartType'] = normalizeChartTypeForRequest(String(next['chartType']));
|
|
3761
3845
|
}
|
|
3762
3846
|
if (next['query']) {
|
|
3763
|
-
next['query'] = normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(next['query']));
|
|
3847
|
+
next['query'] = normalizeDashboardQueryFormulas(normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(next['query'])));
|
|
3764
3848
|
const isPhaseGateTable = next['componentName'] === 'phaseGateTable';
|
|
3765
3849
|
if (isPhaseGateTable || isPhaseGateTableQuery(next['query'])) {
|
|
3766
3850
|
next['query'] = toCanonicalPhaseGateTableQuery(next['query'], {
|
|
@@ -6269,6 +6353,59 @@ function selectedPropertyOptions(cfg, options) {
|
|
|
6269
6353
|
/* ============================================================================
|
|
6270
6354
|
* Common section factories
|
|
6271
6355
|
* ========================================================================== */
|
|
6356
|
+
/**
|
|
6357
|
+
* Dialog header — the ONLY place a linked dialog's header is authored.
|
|
6358
|
+
*
|
|
6359
|
+
* A dialog item never sits on the canvas, so it has no card menu and no
|
|
6360
|
+
* "Edit title" action; without these fields its header text stayed frozen at
|
|
6361
|
+
* whatever the parent chart was called when the dialog was created (the config
|
|
6362
|
+
* is cloned from it). The inner table also renders with `hideHeader`, so the
|
|
6363
|
+
* shared "Title & icon" controls were phantom controls here — this section
|
|
6364
|
+
* replaces them with the values the dialog header actually renders.
|
|
6365
|
+
*
|
|
6366
|
+
* Paths are the existing persisted ones (`clientConfig.title`, the icon picker's
|
|
6367
|
+
* `configAsType.icon` + its `headerCardConfig.icon` mirror), so dialogs saved
|
|
6368
|
+
* before this section keep resolving the same values.
|
|
6369
|
+
*/
|
|
6370
|
+
const DIALOG_HEADER_SECTION = {
|
|
6371
|
+
key: 'dialog-header',
|
|
6372
|
+
label: 'Dialog header',
|
|
6373
|
+
icon: 'layout.maximize-01',
|
|
6374
|
+
domain: 'title',
|
|
6375
|
+
scope: 'simple',
|
|
6376
|
+
description: 'Title and icon shown in the dialog header bar.',
|
|
6377
|
+
fields: [
|
|
6378
|
+
{
|
|
6379
|
+
key: 'dialogTitleEn',
|
|
6380
|
+
label: 'Title (English)',
|
|
6381
|
+
type: 'text',
|
|
6382
|
+
path: 'clientConfig.title.en',
|
|
6383
|
+
placeholder: 'Dialog title',
|
|
6384
|
+
},
|
|
6385
|
+
{
|
|
6386
|
+
key: 'dialogTitleAr',
|
|
6387
|
+
label: 'Title (Arabic)',
|
|
6388
|
+
type: 'text',
|
|
6389
|
+
path: 'clientConfig.title.ar',
|
|
6390
|
+
placeholder: 'Dialog title',
|
|
6391
|
+
},
|
|
6392
|
+
{
|
|
6393
|
+
key: 'dialogIcon',
|
|
6394
|
+
label: 'Header icon',
|
|
6395
|
+
type: 'iconPicker',
|
|
6396
|
+
path: 'clientConfig.configAsType.icon',
|
|
6397
|
+
mirrorPaths: ['clientConfig.configAsType.headerCardConfig.icon'],
|
|
6398
|
+
description: 'Icon shown before the title in the dialog header.',
|
|
6399
|
+
},
|
|
6400
|
+
{
|
|
6401
|
+
key: 'dialogIconColor',
|
|
6402
|
+
label: 'Header icon color',
|
|
6403
|
+
type: 'color',
|
|
6404
|
+
path: 'clientConfig.displayConfig.StyleConfig.iconColor',
|
|
6405
|
+
scope: 'advanced',
|
|
6406
|
+
},
|
|
6407
|
+
],
|
|
6408
|
+
};
|
|
6272
6409
|
const TITLE_STYLE_SECTION = {
|
|
6273
6410
|
key: 'title-style',
|
|
6274
6411
|
label: 'Title & icon',
|
|
@@ -7859,6 +7996,19 @@ const RING_GAUGE_SECTION = {
|
|
|
7859
7996
|
type: 'text',
|
|
7860
7997
|
path: 'clientConfig.configAsType.labelCenter.text.ar',
|
|
7861
7998
|
},
|
|
7999
|
+
{
|
|
8000
|
+
// Handler reads `configAsType.labelCenter.fontSize` — sizes the
|
|
8001
|
+
// on-chart center label (and its value, when a Center Property is
|
|
8002
|
+
// bound and shown alongside it).
|
|
8003
|
+
key: 'centerLabelSize',
|
|
8004
|
+
label: 'Center label size',
|
|
8005
|
+
type: 'number',
|
|
8006
|
+
min: 10,
|
|
8007
|
+
max: 40,
|
|
8008
|
+
step: 1,
|
|
8009
|
+
path: 'clientConfig.configAsType.labelCenter.fontSize',
|
|
8010
|
+
default: 15,
|
|
8011
|
+
},
|
|
7862
8012
|
{
|
|
7863
8013
|
// Handler reads `configAsType.overrideSelectedPropertiesLabels`
|
|
7864
8014
|
// (ring-gauge-chart.handler.ts) to rename a property's ring
|
|
@@ -8691,9 +8841,13 @@ const SCHEMA_DEFS = [
|
|
|
8691
8841
|
},
|
|
8692
8842
|
{
|
|
8693
8843
|
id: 'dialog',
|
|
8844
|
+
// A dialog owns its header instead of a card header, so it swaps the shared
|
|
8845
|
+
// "Title & icon" section (which drives a card header the dialog hides) for
|
|
8846
|
+
// DIALOG_HEADER_SECTION.
|
|
8694
8847
|
name: 'Dialog Table',
|
|
8695
8848
|
sections: [
|
|
8696
|
-
|
|
8849
|
+
DIALOG_HEADER_SECTION,
|
|
8850
|
+
...COMMON_CHART_BASE.filter((section) => section.key !== TITLE_STYLE_SECTION.key),
|
|
8697
8851
|
TABLE_SECTION,
|
|
8698
8852
|
TABLE_LEGEND_SECTION,
|
|
8699
8853
|
FORMAT_SECTION,
|
|
@@ -10201,6 +10355,17 @@ const RING_GAUGE_BINDINGS = [
|
|
|
10201
10355
|
rendererReadPaths: ['clientConfig.configAsType.labelCenter.text.ar'],
|
|
10202
10356
|
simpleOrAdvanced: 'simple',
|
|
10203
10357
|
},
|
|
10358
|
+
{
|
|
10359
|
+
chartId: 'ring-gauge-chart',
|
|
10360
|
+
controlId: 'centerLabelSize',
|
|
10361
|
+
domain: 'gauge',
|
|
10362
|
+
label: 'Center label size',
|
|
10363
|
+
uiPath: 'gauge.centerLabelSize',
|
|
10364
|
+
persistedPath: 'clientConfig.configAsType.labelCenter.fontSize',
|
|
10365
|
+
runtimePath: 'clientConfig.configAsType.labelCenter.fontSize',
|
|
10366
|
+
rendererReadPaths: ['clientConfig.configAsType.labelCenter.fontSize'],
|
|
10367
|
+
simpleOrAdvanced: 'simple',
|
|
10368
|
+
},
|
|
10204
10369
|
{
|
|
10205
10370
|
chartId: 'ring-gauge-chart',
|
|
10206
10371
|
controlId: 'propertyLabels',
|
|
@@ -10674,6 +10839,68 @@ const TOPBAR_WIDGET_BINDINGS = [
|
|
|
10674
10839
|
simpleOrAdvanced: 'simple',
|
|
10675
10840
|
},
|
|
10676
10841
|
];
|
|
10842
|
+
/**
|
|
10843
|
+
* Dialog header — the `dialog` schema's DIALOG_HEADER_SECTION.
|
|
10844
|
+
*
|
|
10845
|
+
* The "renderer" here is not a card header: it is the dialog's own header bar,
|
|
10846
|
+
* read by `resolveDashboardDialogHeader()` and rendered by
|
|
10847
|
+
* `DashboardDialogHeader` through `DynamicDialogConfig.templates.header`.
|
|
10848
|
+
*/
|
|
10849
|
+
const DIALOG_HEADER_BINDINGS = [
|
|
10850
|
+
{
|
|
10851
|
+
chartId: 'dialog',
|
|
10852
|
+
controlId: 'dialogTitleEn',
|
|
10853
|
+
domain: 'title',
|
|
10854
|
+
label: 'Title (English)',
|
|
10855
|
+
uiPath: 'dialogHeader.titleEn',
|
|
10856
|
+
persistedPath: 'clientConfig.title.en',
|
|
10857
|
+
runtimePath: 'clientConfig.title.en',
|
|
10858
|
+
rendererReadPaths: ['clientConfig.title.en', 'clientConfig.title.ar'],
|
|
10859
|
+
simpleOrAdvanced: 'simple',
|
|
10860
|
+
},
|
|
10861
|
+
{
|
|
10862
|
+
chartId: 'dialog',
|
|
10863
|
+
controlId: 'dialogTitleAr',
|
|
10864
|
+
domain: 'title',
|
|
10865
|
+
label: 'Title (Arabic)',
|
|
10866
|
+
uiPath: 'dialogHeader.titleAr',
|
|
10867
|
+
persistedPath: 'clientConfig.title.ar',
|
|
10868
|
+
runtimePath: 'clientConfig.title.ar',
|
|
10869
|
+
rendererReadPaths: ['clientConfig.title.ar'],
|
|
10870
|
+
simpleOrAdvanced: 'simple',
|
|
10871
|
+
},
|
|
10872
|
+
{
|
|
10873
|
+
chartId: 'dialog',
|
|
10874
|
+
controlId: 'dialogIcon',
|
|
10875
|
+
domain: 'title',
|
|
10876
|
+
label: 'Header icon',
|
|
10877
|
+
uiPath: 'dialogHeader.icon',
|
|
10878
|
+
persistedPath: 'clientConfig.configAsType.icon',
|
|
10879
|
+
runtimePath: 'clientConfig.configAsType.icon',
|
|
10880
|
+
rendererReadPaths: [
|
|
10881
|
+
'clientConfig.configAsType.icon',
|
|
10882
|
+
'clientConfig.configAsType.headerCardConfig.icon',
|
|
10883
|
+
],
|
|
10884
|
+
legacyPersistPaths: ['clientConfig.configAsType.headerCardConfig.icon'],
|
|
10885
|
+
simpleOrAdvanced: 'simple',
|
|
10886
|
+
notes: [
|
|
10887
|
+
'Mirrored to headerCardConfig.icon so dialogs configured through the ' +
|
|
10888
|
+
'shared "Title & icon" control before DIALOG_HEADER_SECTION existed ' +
|
|
10889
|
+
'still resolve an icon.',
|
|
10890
|
+
],
|
|
10891
|
+
},
|
|
10892
|
+
{
|
|
10893
|
+
chartId: 'dialog',
|
|
10894
|
+
controlId: 'dialogIconColor',
|
|
10895
|
+
domain: 'title',
|
|
10896
|
+
label: 'Header icon color',
|
|
10897
|
+
uiPath: 'dialogHeader.iconColor',
|
|
10898
|
+
persistedPath: 'clientConfig.displayConfig.StyleConfig.iconColor',
|
|
10899
|
+
runtimePath: 'clientConfig.displayConfig.StyleConfig.iconColor',
|
|
10900
|
+
rendererReadPaths: ['clientConfig.displayConfig.StyleConfig.iconColor'],
|
|
10901
|
+
simpleOrAdvanced: 'advanced',
|
|
10902
|
+
},
|
|
10903
|
+
];
|
|
10677
10904
|
/* ============================================================================
|
|
10678
10905
|
* Build registry
|
|
10679
10906
|
* ========================================================================== */
|
|
@@ -10711,6 +10938,7 @@ const ALL_BINDINGS = [
|
|
|
10711
10938
|
...MAP_BINDINGS,
|
|
10712
10939
|
...HEADER_WIDGET_BINDINGS,
|
|
10713
10940
|
...TOPBAR_WIDGET_BINDINGS,
|
|
10941
|
+
...DIALOG_HEADER_BINDINGS,
|
|
10714
10942
|
];
|
|
10715
10943
|
const BINDING_INDEX = new Map(ALL_BINDINGS.map((b) => [bindingKey(b.chartId, b.controlId), b]));
|
|
10716
10944
|
function getBinding(chartId, controlId) {
|
|
@@ -10761,6 +10989,91 @@ function readByPath(cfg, path) {
|
|
|
10761
10989
|
* Pass 4/5 - Control Schema public surface.
|
|
10762
10990
|
*/
|
|
10763
10991
|
|
|
10992
|
+
/**
|
|
10993
|
+
* Dashboard Dialog Header
|
|
10994
|
+
*
|
|
10995
|
+
* Renders a linked dialog's own header bar: the configured icon followed by the
|
|
10996
|
+
* configured title. PrimeNG's DynamicDialog only accepts a plain string for
|
|
10997
|
+
* `header`, so anything richer has to go through `config.templates.header` — a
|
|
10998
|
+
* component rendered by `*ngComponentOutlet` INSIDE the dialog, which reaches
|
|
10999
|
+
* `DynamicDialogConfig` through the dialog's element injector.
|
|
11000
|
+
*
|
|
11001
|
+
* Both values are authored in the Style Studio's "Dialog header" section
|
|
11002
|
+
* (schema id `dialog`) and handed over by `ActionService.showDialog` under
|
|
11003
|
+
* `data.dialogHeader`.
|
|
11004
|
+
*/
|
|
11005
|
+
/**
|
|
11006
|
+
* Read a dialog item's header (title + icon) off its own persisted config.
|
|
11007
|
+
*
|
|
11008
|
+
* Single source of truth for every caller that opens a dialog, so the header
|
|
11009
|
+
* always matches what the Style Studio's "Dialog header" section writes.
|
|
11010
|
+
*/
|
|
11011
|
+
function resolveDashboardDialogHeader(config, languageCode) {
|
|
11012
|
+
const lang = languageCode || localStorage.getItem('langCode') || 'en';
|
|
11013
|
+
const clientConfig = config?.clientConfig;
|
|
11014
|
+
const title = clientConfig?.title?.[lang] ||
|
|
11015
|
+
clientConfig?.title?.['en'] ||
|
|
11016
|
+
clientConfig?.title?.['ar'] ||
|
|
11017
|
+
'';
|
|
11018
|
+
// `configAsType.icon` is the canonical path the icon picker writes;
|
|
11019
|
+
// `headerCardConfig.icon` is its mirror, so dialogs configured before the
|
|
11020
|
+
// "Dialog header" section existed still resolve an icon.
|
|
11021
|
+
const configAsType = clientConfig?.configAsType;
|
|
11022
|
+
const icon = configAsType?.icon || configAsType?.['headerCardConfig']?.icon || '';
|
|
11023
|
+
const iconColor = clientConfig?.displayConfig?.StyleConfig?.['iconColor'] || '';
|
|
11024
|
+
return { title, icon, iconColor };
|
|
11025
|
+
}
|
|
11026
|
+
class DashboardDialogHeader {
|
|
11027
|
+
dialogConfig = inject(DynamicDialogConfig, {
|
|
11028
|
+
optional: true,
|
|
11029
|
+
});
|
|
11030
|
+
// The dialog config is built once per open and never mutated, so plain
|
|
11031
|
+
// fields are enough — a static header needs no signal plumbing.
|
|
11032
|
+
data = (this.dialogConfig?.data?.['dialogHeader'] ??
|
|
11033
|
+
{});
|
|
11034
|
+
title = this.data.title ?? '';
|
|
11035
|
+
icon = this.data.icon ?? '';
|
|
11036
|
+
iconColor = this.data.iconColor || 'inherit';
|
|
11037
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11038
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardDialogHeader, isStandalone: true, selector: "mt-dashboard-dialog-header", ngImport: i0, template: `
|
|
11039
|
+
<div class="flex min-w-0 items-center gap-2">
|
|
11040
|
+
@if (icon) {
|
|
11041
|
+
<mt-icon
|
|
11042
|
+
[icon]="$any(icon)"
|
|
11043
|
+
class="shrink-0 text-lg"
|
|
11044
|
+
[style.color]="iconColor"
|
|
11045
|
+
/>
|
|
11046
|
+
}
|
|
11047
|
+
<span class="p-dialog-title truncate" role="heading" aria-level="2">{{
|
|
11048
|
+
title
|
|
11049
|
+
}}</span>
|
|
11050
|
+
</div>
|
|
11051
|
+
`, isInline: true, dependencies: [{ kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11052
|
+
}
|
|
11053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardDialogHeader, decorators: [{
|
|
11054
|
+
type: Component,
|
|
11055
|
+
args: [{
|
|
11056
|
+
selector: 'mt-dashboard-dialog-header',
|
|
11057
|
+
standalone: true,
|
|
11058
|
+
imports: [Icon],
|
|
11059
|
+
template: `
|
|
11060
|
+
<div class="flex min-w-0 items-center gap-2">
|
|
11061
|
+
@if (icon) {
|
|
11062
|
+
<mt-icon
|
|
11063
|
+
[icon]="$any(icon)"
|
|
11064
|
+
class="shrink-0 text-lg"
|
|
11065
|
+
[style.color]="iconColor"
|
|
11066
|
+
/>
|
|
11067
|
+
}
|
|
11068
|
+
<span class="p-dialog-title truncate" role="heading" aria-level="2">{{
|
|
11069
|
+
title
|
|
11070
|
+
}}</span>
|
|
11071
|
+
</div>
|
|
11072
|
+
`,
|
|
11073
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11074
|
+
}]
|
|
11075
|
+
}] });
|
|
11076
|
+
|
|
10764
11077
|
const GUIDED = 'dashboardBuilder.guided';
|
|
10765
11078
|
const ITEM_ACTIONS = 'dashboardBuilder.actions';
|
|
10766
11079
|
const ITEM_GUIDANCE_REGISTRY = {
|
|
@@ -20234,6 +20547,9 @@ class RingGaugeChartHandler {
|
|
|
20234
20547
|
rawLabelCenter?.text?.['ar'] ??
|
|
20235
20548
|
(typeof rawLabelCenter === 'string' ? rawLabelCenter : undefined);
|
|
20236
20549
|
const hideLabelCenter = typeof rawLabelCenter === 'object' ? rawLabelCenter?.hide : false;
|
|
20550
|
+
const labelCenterFontSize = typeof rawLabelCenter?.fontSize === 'number'
|
|
20551
|
+
? rawLabelCenter.fontSize
|
|
20552
|
+
: undefined;
|
|
20237
20553
|
// Get override labels for translation
|
|
20238
20554
|
const overrideSelectedPropertiesLabels = switchAllKeysToLower(configAsType['overrideSelectedPropertiesLabels'] || {});
|
|
20239
20555
|
// Data should be a single entry array, take the first object
|
|
@@ -20302,20 +20618,26 @@ class RingGaugeChartHandler {
|
|
|
20302
20618
|
const foldedCenterValue = foldSoleBarIntoCenter
|
|
20303
20619
|
? this.extractNumericValue(gaugeValues[0].value)
|
|
20304
20620
|
: null;
|
|
20305
|
-
// Whether the center
|
|
20306
|
-
// value, a folded sole-bar value, or a static "Center
|
|
20307
|
-
// typed with no Center Property selected.
|
|
20308
|
-
// title/detail offsets below must reserve the same vertical slot for it,
|
|
20309
|
-
// otherwise the center label lands on top of the topmost ring's own
|
|
20310
|
-
// title/value.
|
|
20621
|
+
// Whether the tooltip's consolidated center row will render — a
|
|
20622
|
+
// property-bound value, a folded sole-bar value, or a static "Center
|
|
20623
|
+
// label" override typed with no Center Property selected.
|
|
20311
20624
|
const showsCenterValue = hasCenterValue || foldedCenterValue !== null;
|
|
20312
20625
|
const resolvedCenterLabel = centerLabel || labelCenterTextOverride || '';
|
|
20313
|
-
const
|
|
20626
|
+
const showsCenterSummary = !hideLabelCenter &&
|
|
20314
20627
|
(showsCenterValue || Boolean(labelCenterTextOverride));
|
|
20315
|
-
//
|
|
20316
|
-
//
|
|
20317
|
-
//
|
|
20318
|
-
//
|
|
20628
|
+
// Whether the ON-CHART center graphic renders. Same as the tooltip,
|
|
20629
|
+
// except a folded sole-bar value with no configured label text is
|
|
20630
|
+
// suppressed: its number is already shown big and bold as that bar's
|
|
20631
|
+
// own `detail` text, so an unlabeled graphic would just be an empty
|
|
20632
|
+
// overlay reserving space for nothing. The gauge bars' own title/detail
|
|
20633
|
+
// offsets below must reserve the same vertical slot as this graphic,
|
|
20634
|
+
// otherwise the center label lands on top of the topmost ring's own
|
|
20635
|
+
// title/value.
|
|
20636
|
+
const showsCenterGraphic = showsCenterSummary && !(foldSoleBarIntoCenter && !resolvedCenterLabel);
|
|
20637
|
+
// Text for the hover tooltip's center row — a text-only override (no
|
|
20638
|
+
// Center Property) shows just the label; a bound (or folded) value
|
|
20639
|
+
// appends the number; a bare value with no configured label skips the
|
|
20640
|
+
// empty "` : `" prefix.
|
|
20319
20641
|
const centerText = showsCenterValue
|
|
20320
20642
|
? [
|
|
20321
20643
|
resolvedCenterLabel || null,
|
|
@@ -20324,6 +20646,15 @@ class RingGaugeChartHandler {
|
|
|
20324
20646
|
.filter((part) => part !== null && part !== undefined)
|
|
20325
20647
|
.join(': ')
|
|
20326
20648
|
: resolvedCenterLabel;
|
|
20649
|
+
// Text for the ON-CHART center graphic. When the value was folded from
|
|
20650
|
+
// the gauge's sole bar, that same number is already shown big and bold
|
|
20651
|
+
// as that bar's own `detail` text right above — repeating it here would
|
|
20652
|
+
// be a visible duplicate, so the graphic shows the label alone. A real
|
|
20653
|
+
// bound Center Property has no such duplicate (its ring is excluded
|
|
20654
|
+
// from the gauge entirely), so it keeps the label + value.
|
|
20655
|
+
const graphicText = foldSoleBarIntoCenter
|
|
20656
|
+
? resolvedCenterLabel
|
|
20657
|
+
: centerText;
|
|
20327
20658
|
// Now convert numeric values for gauge bars only
|
|
20328
20659
|
const processedGaugeValues = gaugeValues.map((prop) => ({
|
|
20329
20660
|
...prop,
|
|
@@ -20424,7 +20755,7 @@ class RingGaugeChartHandler {
|
|
|
20424
20755
|
</div>`;
|
|
20425
20756
|
});
|
|
20426
20757
|
}
|
|
20427
|
-
if (
|
|
20758
|
+
if (showsCenterSummary) {
|
|
20428
20759
|
tooltipContent += `<div style="margin: 5px 0;">
|
|
20429
20760
|
<span style="display:inline-block;width:10px;height:10px;background-color:${statusColor};border-radius:50%;margin-right:8px;"></span>
|
|
20430
20761
|
<span>${centerText}</span>
|
|
@@ -20504,8 +20835,9 @@ class RingGaugeChartHandler {
|
|
|
20504
20835
|
left: 'center',
|
|
20505
20836
|
top: 'middle',
|
|
20506
20837
|
style: {
|
|
20507
|
-
text:
|
|
20508
|
-
fontSize:
|
|
20838
|
+
text: graphicText,
|
|
20839
|
+
fontSize: labelCenterFontSize ??
|
|
20840
|
+
generalConfiguration?.fontConfig?.fontSizeConfig?.label,
|
|
20509
20841
|
fontFamily: fontFamily,
|
|
20510
20842
|
fill: statusColor,
|
|
20511
20843
|
textAlign: 'center',
|
|
@@ -23154,17 +23486,22 @@ class ActionService {
|
|
|
23154
23486
|
console.warn(`[ActionService] No dialog config found for action id "${action.id}". ` +
|
|
23155
23487
|
'The linked dialog may have been deleted or failed to load.');
|
|
23156
23488
|
}
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23160
|
-
dialogConfig?.clientConfig?.title?.['ar'] ||
|
|
23161
|
-
'';
|
|
23489
|
+
// Header title + icon come from the dialog's OWN config (Style Studio →
|
|
23490
|
+
// "Dialog header"), not from the chart that opened it.
|
|
23491
|
+
const header = resolveDashboardDialogHeader(dialogConfig);
|
|
23162
23492
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
23163
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
23493
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-B5jqgAas.mjs').then(({ DashboardDialogComponent }) => {
|
|
23164
23494
|
// Open dialog using ModalService
|
|
23165
23495
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
23166
|
-
header: title,
|
|
23496
|
+
header: header.title,
|
|
23167
23497
|
styleClass: 'w-2/3',
|
|
23498
|
+
// PrimeNG's `header` is a plain string, so an icon needs the header
|
|
23499
|
+
// template component. Only opt in when there IS an icon — a
|
|
23500
|
+
// title-only dialog keeps the untouched native header.
|
|
23501
|
+
...(header.icon
|
|
23502
|
+
? { templates: { header: DashboardDialogHeader } }
|
|
23503
|
+
: {}),
|
|
23504
|
+
data: { dialogHeader: header },
|
|
23168
23505
|
inputValues: {
|
|
23169
23506
|
config: dialogConfig ?? null,
|
|
23170
23507
|
// Preserve both contracts: current consumers can address
|
|
@@ -32223,6 +32560,15 @@ class ChartViewer {
|
|
|
32223
32560
|
config = input(null, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
32224
32561
|
/** Chart type ID */
|
|
32225
32562
|
chartTypeId = input('', ...(ngDevMode ? [{ debugName: "chartTypeId" }] : /* istanbul ignore next */ []));
|
|
32563
|
+
/**
|
|
32564
|
+
* Drop the viewer's own "Preview" toolbar and panel chrome.
|
|
32565
|
+
*
|
|
32566
|
+
* For hosts that already frame the preview themselves — the Style Studio's
|
|
32567
|
+
* dialog chrome, where a second toolbar inside the mocked dialog body would
|
|
32568
|
+
* read as part of the dialog. Refresh stays available programmatically via
|
|
32569
|
+
* `refresh()`, which is how the Style Studio drives it anyway.
|
|
32570
|
+
*/
|
|
32571
|
+
hideHeader = input(false, ...(ngDevMode ? [{ debugName: "hideHeader" }] : /* istanbul ignore next */ []));
|
|
32226
32572
|
/** Loading state for refresh */
|
|
32227
32573
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
32228
32574
|
destroyRef = inject(DestroyRef);
|
|
@@ -32289,12 +32635,12 @@ class ChartViewer {
|
|
|
32289
32635
|
}, 450);
|
|
32290
32636
|
}
|
|
32291
32637
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartViewer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32292
|
-
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'\">\r\n <div
|
|
32638
|
+
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 }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <div\r\n class=\"h-full flex flex-col\"\r\n [class.bg-surface-50]=\"!hideHeader()\"\r\n [class.border-l]=\"!hideHeader()\"\r\n [class.border-surface-200]=\"!hideHeader()\"\r\n >\r\n <!-- Header -->\r\n @if (!hideHeader()) {\r\n <div\r\n class=\"flex items-center justify-between px-4 py-3 bg-surface-0 border-b border-surface-200\"\r\n >\r\n <span class=\"text-sm font-medium text-surface-700\">{{\r\n t(\"preview\")\r\n }}</span>\r\n <mt-button\r\n icon=\"arrow.refresh-cw-01\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n severity=\"help\"\r\n [tooltip]=\"t('refresh')\"\r\n (onClick)=\"refresh()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Preview Content. The inset is the panel's own presentation: a host that\r\n framed the preview itself (hideHeader) renders edge-to-edge, matching\r\n the dialog body, which is `p-0`. -->\r\n <div class=\"relative flex-1 overflow-auto\" [class.p-4]=\"!hideHeader()\">\r\n @if (config() && chartTypeId() && canPreview()) {\r\n <!-- The card frame is the panel's own presentation. A host that already\r\n framed the preview (hideHeader) would otherwise show a card inside\r\n its frame. -->\r\n <div\r\n class=\"h-full overflow-hidden\"\r\n [class.bg-surface-0]=\"!hideHeader()\"\r\n [class.rounded-lg]=\"!hideHeader()\"\r\n [class.shadow-sm]=\"!hideHeader()\"\r\n [class.border]=\"!hideHeader()\"\r\n [class.border-surface-200]=\"!hideHeader()\"\r\n >\r\n <mt-dashboard-item\r\n [config]=\"config()\"\r\n [chartTypeId]=\"chartTypeId()\"\r\n [readonly]=\"true\"\r\n [pageName]=\"\r\n config()?.clientConfig?.title?.['en'] ||\r\n config()?.clientConfig?.title?.['ar'] ||\r\n ''\r\n \"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-full text-muted-color\"\r\n >\r\n <mt-icon icon=\"chart.bar-chart-10\" class=\"text-4xl mb-3 opacity-50\" />\r\n <p class=\"text-sm\">{{ t(\"noPreviewAvailable\") }}</p>\r\n <p class=\"text-xs opacity-70\">{{ t(\"configureChartToPreview\") }}</p>\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div\r\n class=\"pointer-events-none absolute z-10 flex items-center justify-center rounded-lg bg-surface-0/70\"\r\n [class.inset-4]=\"!hideHeader()\"\r\n [class.inset-0]=\"hideHeader()\"\r\n role=\"status\"\r\n aria-live=\"polite\"\r\n [attr.aria-label]=\"t('styleStudio.refreshing')\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-02\"\r\n class=\"animate-spin text-3xl text-primary\"\r\n />\r\n <span class=\"sr-only\">{{ t(\"styleStudio.refreshing\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-container>\r\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", "ariaLabel"], 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", "reportId", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32293
32639
|
}
|
|
32294
32640
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ChartViewer, decorators: [{
|
|
32295
32641
|
type: Component,
|
|
32296
|
-
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'\">\r\n <div
|
|
32297
|
-
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartTypeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartTypeId", required: false }] }] } });
|
|
32642
|
+
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'\">\r\n <div\r\n class=\"h-full flex flex-col\"\r\n [class.bg-surface-50]=\"!hideHeader()\"\r\n [class.border-l]=\"!hideHeader()\"\r\n [class.border-surface-200]=\"!hideHeader()\"\r\n >\r\n <!-- Header -->\r\n @if (!hideHeader()) {\r\n <div\r\n class=\"flex items-center justify-between px-4 py-3 bg-surface-0 border-b border-surface-200\"\r\n >\r\n <span class=\"text-sm font-medium text-surface-700\">{{\r\n t(\"preview\")\r\n }}</span>\r\n <mt-button\r\n icon=\"arrow.refresh-cw-01\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n severity=\"help\"\r\n [tooltip]=\"t('refresh')\"\r\n (onClick)=\"refresh()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Preview Content. The inset is the panel's own presentation: a host that\r\n framed the preview itself (hideHeader) renders edge-to-edge, matching\r\n the dialog body, which is `p-0`. -->\r\n <div class=\"relative flex-1 overflow-auto\" [class.p-4]=\"!hideHeader()\">\r\n @if (config() && chartTypeId() && canPreview()) {\r\n <!-- The card frame is the panel's own presentation. A host that already\r\n framed the preview (hideHeader) would otherwise show a card inside\r\n its frame. -->\r\n <div\r\n class=\"h-full overflow-hidden\"\r\n [class.bg-surface-0]=\"!hideHeader()\"\r\n [class.rounded-lg]=\"!hideHeader()\"\r\n [class.shadow-sm]=\"!hideHeader()\"\r\n [class.border]=\"!hideHeader()\"\r\n [class.border-surface-200]=\"!hideHeader()\"\r\n >\r\n <mt-dashboard-item\r\n [config]=\"config()\"\r\n [chartTypeId]=\"chartTypeId()\"\r\n [readonly]=\"true\"\r\n [pageName]=\"\r\n config()?.clientConfig?.title?.['en'] ||\r\n config()?.clientConfig?.title?.['ar'] ||\r\n ''\r\n \"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-full text-muted-color\"\r\n >\r\n <mt-icon icon=\"chart.bar-chart-10\" class=\"text-4xl mb-3 opacity-50\" />\r\n <p class=\"text-sm\">{{ t(\"noPreviewAvailable\") }}</p>\r\n <p class=\"text-xs opacity-70\">{{ t(\"configureChartToPreview\") }}</p>\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div\r\n class=\"pointer-events-none absolute z-10 flex items-center justify-center rounded-lg bg-surface-0/70\"\r\n [class.inset-4]=\"!hideHeader()\"\r\n [class.inset-0]=\"hideHeader()\"\r\n role=\"status\"\r\n aria-live=\"polite\"\r\n [attr.aria-label]=\"t('styleStudio.refreshing')\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-02\"\r\n class=\"animate-spin text-3xl text-primary\"\r\n />\r\n <span class=\"sr-only\">{{ t(\"styleStudio.refreshing\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}\n"] }]
|
|
32643
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartTypeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartTypeId", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }] } });
|
|
32298
32644
|
|
|
32299
32645
|
/**
|
|
32300
32646
|
* The canonical list of configuration domains. Order is the order of
|
|
@@ -33962,6 +34308,29 @@ class StyleStudioDrawer {
|
|
|
33962
34308
|
const langCode = this.dashboardStore.languageCode() || this.transloco.getActiveLang();
|
|
33963
34309
|
return title?.[langCode] || title?.['en'] || title?.['ar'] || '';
|
|
33964
34310
|
}, ...(ngDevMode ? [{ debugName: "previewTitle" }] : /* istanbul ignore next */ []));
|
|
34311
|
+
/**
|
|
34312
|
+
* A linked dialog is edited here but never drawn on the canvas: at runtime it
|
|
34313
|
+
* renders inside a modal whose header carries the title + icon that the
|
|
34314
|
+
* "Dialog header" section writes, and the inner table hides its own card
|
|
34315
|
+
* header. Without the chrome below, the preview showed a bare table and every
|
|
34316
|
+
* header edit looked like it did nothing.
|
|
34317
|
+
*/
|
|
34318
|
+
isDialogPreview = computed(() => this.capability()?.id === 'dialog', ...(ngDevMode ? [{ debugName: "isDialogPreview" }] : /* istanbul ignore next */ []));
|
|
34319
|
+
/**
|
|
34320
|
+
* Live dialog header, resolved exactly the way the runtime resolves it — so
|
|
34321
|
+
* the Arabic title only shows while the UI is in Arabic, same as production.
|
|
34322
|
+
*/
|
|
34323
|
+
dialogHeaderPreview = computed(() => {
|
|
34324
|
+
this.activeLang();
|
|
34325
|
+
const langCode = this.dashboardStore.languageCode() || this.transloco.getActiveLang();
|
|
34326
|
+
return resolveDashboardDialogHeader(this.itemConfig(), langCode);
|
|
34327
|
+
}, ...(ngDevMode ? [{ debugName: "dialogHeaderPreview" }] : /* istanbul ignore next */ []));
|
|
34328
|
+
/** `contents` keeps the non-dialog preview layout byte-for-byte unchanged. */
|
|
34329
|
+
previewFrameClass = computed(() => this.isDialogPreview()
|
|
34330
|
+
? 'flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-surface-200 bg-surface-0 shadow-sm'
|
|
34331
|
+
: 'contents', ...(ngDevMode ? [{ debugName: "previewFrameClass" }] : /* istanbul ignore next */ []));
|
|
34332
|
+
// No padding here: with `hideHeader` the viewer's own content area owns it.
|
|
34333
|
+
previewBodyClass = computed(() => this.isDialogPreview() ? 'min-h-0 flex-1' : 'contents', ...(ngDevMode ? [{ debugName: "previewBodyClass" }] : /* istanbul ignore next */ []));
|
|
33965
34334
|
/**
|
|
33966
34335
|
* Preview data — the source for the legend-order entries. Reads the isolated
|
|
33967
34336
|
* preview store, which `syncPreviewStore()` keeps re-processed against the
|
|
@@ -34080,7 +34449,7 @@ class StyleStudioDrawer {
|
|
|
34080
34449
|
return out === full ? fallback : out;
|
|
34081
34450
|
}
|
|
34082
34451
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34083
|
-
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 [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <mt-chart-viewer\r\n
|
|
34452
|
+
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 [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\r\n not a card header \u2014 is what the \"Dialog header\" section edits.\r\n Both wrappers collapse to `contents` for every other widget, so\r\n the ordinary preview layout is untouched. -->\r\n <div [class]=\"previewFrameClass()\">\r\n @if (isDialogPreview()) {\r\n <div\r\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\r\n >\r\n @if (dialogHeaderPreview().icon) {\r\n <mt-icon\r\n [icon]=\"$any(dialogHeaderPreview().icon)\"\r\n class=\"shrink-0 text-lg\"\r\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\r\n mtTruncateTooltip\r\n >{{\r\n dialogHeaderPreview().title ||\r\n t(\"styleStudio.messages.untitledDialog\")\r\n }}</span\r\n >\r\n <span\r\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\r\n </span>\r\n </div>\r\n }\r\n <div [class]=\"previewBodyClass()\">\r\n <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n [hideHeader]=\"isDialogPreview()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\r\n<div\r\n [class]=\"\r\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\r\n \"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <mt-button\r\n [label]=\"t('styleStudio.resetAll')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n class=\"mr-auto\"\r\n (onClick)=\"resetAll()\"\r\n />\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }, { kind: "component", type: StyleSettingsRenderer, selector: "mt-style-settings-renderer", inputs: ["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", "hideHeader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
34084
34453
|
}
|
|
34085
34454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleStudioDrawer, decorators: [{
|
|
34086
34455
|
type: Component,
|
|
@@ -34095,7 +34464,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
34095
34464
|
StyleSettingsRenderer,
|
|
34096
34465
|
SegmentedField,
|
|
34097
34466
|
ChartViewer,
|
|
34098
|
-
], 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 [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <mt-chart-viewer\r\n
|
|
34467
|
+
], 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 [attr.aria-label]=\"t('styleStudio.messages.resizePreview')\"\r\n (pointerdown)=\"startResize($event)\"\r\n (pointermove)=\"onResizeMove($event)\"\r\n (pointerup)=\"endResize()\"\r\n (pointercancel)=\"endResize()\"\r\n ></div>\r\n\r\n <!-- Live preview (renders ALL widget types via the dashboard item) -->\r\n <div\r\n class=\"db-style-studio__preview hidden shrink-0 flex-col bg-surface-50 p-4 lg:flex\"\r\n [style.width.px]=\"previewWidth()\"\r\n >\r\n <div\r\n class=\"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-muted-color\"\r\n >\r\n <mt-icon icon=\"general.eye\" class=\"text-sm\" />\r\n <span>{{ t(\"styleStudio.livePreview\") }}</span>\r\n </div>\r\n <div class=\"min-h-0 flex-1 overflow-auto\">\r\n <!-- Dialog chrome. A linked dialog opens in a modal, so its header \u2014\r\n not a card header \u2014 is what the \"Dialog header\" section edits.\r\n Both wrappers collapse to `contents` for every other widget, so\r\n the ordinary preview layout is untouched. -->\r\n <div [class]=\"previewFrameClass()\">\r\n @if (isDialogPreview()) {\r\n <div\r\n class=\"flex shrink-0 items-center gap-2 border-b border-surface-200 bg-surface-100 px-5 py-4\"\r\n >\r\n @if (dialogHeaderPreview().icon) {\r\n <mt-icon\r\n [icon]=\"$any(dialogHeaderPreview().icon)\"\r\n class=\"shrink-0 text-lg\"\r\n [style.color]=\"dialogHeaderPreview().iconColor || 'inherit'\"\r\n />\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate font-semibold text-color\"\r\n mtTruncateTooltip\r\n >{{\r\n dialogHeaderPreview().title ||\r\n t(\"styleStudio.messages.untitledDialog\")\r\n }}</span\r\n >\r\n <span\r\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-0 text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-sm\" />\r\n </span>\r\n </div>\r\n }\r\n <div [class]=\"previewBodyClass()\">\r\n <mt-chart-viewer\r\n [config]=\"previewConfig()\"\r\n [chartTypeId]=\"previewChartTypeId()\"\r\n [hideHeader]=\"isDialogPreview()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- Footer \u2014 sibling of content so the drawer pins it to the bottom -->\r\n<div\r\n [class]=\"\r\n modal.footerClass + ' border-t border-surface-200 bg-surface-0 px-4 py-3'\r\n \"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n <mt-button\r\n [label]=\"t('styleStudio.resetAll')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"text\"\r\n class=\"mr-auto\"\r\n (onClick)=\"resetAll()\"\r\n />\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n <mt-button [label]=\"t('apply')\" icon=\"general.check\" (onClick)=\"apply()\" />\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.db-style-studio mt-style-field,.db-style-studio mt-text-field,.db-style-studio mt-number-field,.db-style-studio mt-select-field,.db-style-studio mt-multi-select-field,.db-style-studio mt-textarea-field,.db-style-studio mt-slider-field,.db-style-studio mt-color-picker-field{display:block;width:100%}\n"] }]
|
|
34099
34468
|
}], ctorParameters: () => [], propDecorators: { scrollPane: [{ type: i0.ViewChild, args: ['scrollPane', { isSignal: true }] }], previewViewer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => ChartViewer), { isSignal: true }] }] } });
|
|
34100
34469
|
|
|
34101
34470
|
/**
|
|
@@ -35216,32 +35585,6 @@ const LEGACY_DASHBOARD_FUNCTIONS = [
|
|
|
35216
35585
|
{ name: 'Median', key: 'median', hint: 'Middle value for numeric fields' },
|
|
35217
35586
|
{ name: 'Standard Deviation', key: 'stddev', hint: '' },
|
|
35218
35587
|
{ name: 'Min Max', key: 'range', hint: ' Returns the range (max - min)' },
|
|
35219
|
-
{ name: 'Max', key: 'max' },
|
|
35220
|
-
{ name: 'Min', key: 'min' },
|
|
35221
|
-
{ name: 'Abs', key: 'Abs' },
|
|
35222
|
-
{ name: 'Contains', key: 'Contains' },
|
|
35223
|
-
{ name: 'Get Days', key: 'CommonHelper.GetDays' },
|
|
35224
|
-
{ name: 'Today', key: 'CommonHelper.GetDateNow' },
|
|
35225
|
-
{ name: 'Get Month', key: 'CommonHelper.GetMonth' },
|
|
35226
|
-
{ name: 'Get Current Month', key: 'CommonHelper.GetCurrentMonth' },
|
|
35227
|
-
{ name: 'Get Year', key: 'CommonHelper.GetYear' },
|
|
35228
|
-
{ name: 'Get Current Year', key: 'CommonHelper.GetCurrentYear' },
|
|
35229
|
-
{
|
|
35230
|
-
name: 'Get Months In Duration',
|
|
35231
|
-
key: 'CommonHelper.GetMonthsInDuration',
|
|
35232
|
-
},
|
|
35233
|
-
{ name: 'Get Days For Valid Dates', key: 'GetDaysForValidDates' },
|
|
35234
|
-
{ name: 'Add Days', key: 'AddDays' },
|
|
35235
|
-
{ name: 'Remove Decimal Part', key: 'RemoveDecimalPart' },
|
|
35236
|
-
{
|
|
35237
|
-
name: 'Truncate To Two Decimal Places',
|
|
35238
|
-
key: 'TruncateToTwoDecimalPlaces',
|
|
35239
|
-
},
|
|
35240
|
-
{
|
|
35241
|
-
name: 'Add Days After End Of Month',
|
|
35242
|
-
key: 'AddDaysAfterEndOfMonth',
|
|
35243
|
-
},
|
|
35244
|
-
{ name: 'Get Last Date In Month', key: 'GetLastDateInMonth' },
|
|
35245
35588
|
];
|
|
35246
35589
|
const functions = LEGACY_DASHBOARD_FUNCTIONS.map(({ name, key, hint = '' }) => ({
|
|
35247
35590
|
name,
|
|
@@ -35315,64 +35658,129 @@ const DASHBOARD_FORMULA_OPERATORS = [
|
|
|
35315
35658
|
description: 'Value separator',
|
|
35316
35659
|
precedence: 0,
|
|
35317
35660
|
},
|
|
35318
|
-
{
|
|
35319
|
-
symbol: '?',
|
|
35320
|
-
name: 'Conditional',
|
|
35321
|
-
type: 'logical',
|
|
35322
|
-
description: 'Conditional value',
|
|
35323
|
-
precedence: 1,
|
|
35324
|
-
},
|
|
35325
|
-
{
|
|
35326
|
-
symbol: ':',
|
|
35327
|
-
name: 'Conditional separator',
|
|
35328
|
-
type: 'logical',
|
|
35329
|
-
description: 'Conditional separator',
|
|
35330
|
-
precedence: 1,
|
|
35331
|
-
},
|
|
35332
|
-
{
|
|
35333
|
-
symbol: '==',
|
|
35334
|
-
name: 'Equal',
|
|
35335
|
-
type: 'comparison',
|
|
35336
|
-
description: 'Equal to',
|
|
35337
|
-
precedence: 3,
|
|
35338
|
-
},
|
|
35339
|
-
{
|
|
35340
|
-
symbol: '!=',
|
|
35341
|
-
name: 'Not Equal',
|
|
35342
|
-
type: 'comparison',
|
|
35343
|
-
description: 'Not equal to',
|
|
35344
|
-
precedence: 3,
|
|
35345
|
-
},
|
|
35346
|
-
{
|
|
35347
|
-
symbol: '>=',
|
|
35348
|
-
name: 'Greater or Equal',
|
|
35349
|
-
type: 'comparison',
|
|
35350
|
-
description: 'Greater than or equal',
|
|
35351
|
-
precedence: 3,
|
|
35352
|
-
},
|
|
35353
|
-
{
|
|
35354
|
-
symbol: '<=',
|
|
35355
|
-
name: 'Less or Equal',
|
|
35356
|
-
type: 'comparison',
|
|
35357
|
-
description: 'Less than or equal',
|
|
35358
|
-
precedence: 3,
|
|
35359
|
-
},
|
|
35360
|
-
{
|
|
35361
|
-
symbol: '>',
|
|
35362
|
-
name: 'Greater',
|
|
35363
|
-
type: 'comparison',
|
|
35364
|
-
description: 'Greater than',
|
|
35365
|
-
precedence: 3,
|
|
35366
|
-
},
|
|
35367
|
-
{
|
|
35368
|
-
symbol: '<',
|
|
35369
|
-
name: 'Less',
|
|
35370
|
-
type: 'comparison',
|
|
35371
|
-
description: 'Less than',
|
|
35372
|
-
precedence: 3,
|
|
35373
|
-
},
|
|
35374
35661
|
];
|
|
35375
35662
|
|
|
35663
|
+
const LEGACY_TOKEN_PATTERN = /"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[()+\-/*,;]|[^\s()+\-/*,;]+/g;
|
|
35664
|
+
/**
|
|
35665
|
+
* Rebuild the simple token list used by the P+4 Dashboard Builder. Functions,
|
|
35666
|
+
* operators, properties, and values remain independent reorderable chips.
|
|
35667
|
+
*/
|
|
35668
|
+
function tokenizeLegacyDashboardFormula(expression, properties) {
|
|
35669
|
+
const propertyByKey = new Map(properties.map((property) => [property.key, property]));
|
|
35670
|
+
const functionByKey = new Map(LEGACY_DASHBOARD_FUNCTIONS.map((fn) => [fn.key, fn]));
|
|
35671
|
+
const operatorSymbols = new Set(DASHBOARD_FORMULA_OPERATORS.map((operator) => operator.symbol));
|
|
35672
|
+
const normalized = normalizeDashboardFormula(expression).trim();
|
|
35673
|
+
const parts = normalized.match(LEGACY_TOKEN_PATTERN) ?? [];
|
|
35674
|
+
return parts.map((part) => {
|
|
35675
|
+
if (operatorSymbols.has(part)) {
|
|
35676
|
+
return createOperatorToken(part);
|
|
35677
|
+
}
|
|
35678
|
+
const fn = functionByKey.get(part);
|
|
35679
|
+
if (fn) {
|
|
35680
|
+
return { ...createTextToken(part), display: fn.name };
|
|
35681
|
+
}
|
|
35682
|
+
const property = propertyByKey.get(part);
|
|
35683
|
+
if (property) {
|
|
35684
|
+
return createLegacyPropertyToken(property);
|
|
35685
|
+
}
|
|
35686
|
+
return createTextToken(part);
|
|
35687
|
+
});
|
|
35688
|
+
}
|
|
35689
|
+
function createLegacyPropertyToken(property) {
|
|
35690
|
+
return {
|
|
35691
|
+
...createPropertyToken(`@Current::${property.key}`, 'current', 0, undefined, undefined, property.name || property.key),
|
|
35692
|
+
value: property.key,
|
|
35693
|
+
};
|
|
35694
|
+
}
|
|
35695
|
+
/**
|
|
35696
|
+
* Dashboard-only visual builder for the legacy chart formula dialect. Unlike
|
|
35697
|
+
* Formula Engine, selected properties serialize as bare keys (no @Current::).
|
|
35698
|
+
*/
|
|
35699
|
+
class LegacyDashboardFormulaBuilder {
|
|
35700
|
+
editor = viewChild('formulaEditor', ...(ngDevMode ? [{ debugName: "editor" }] : /* istanbul ignore next */ []));
|
|
35701
|
+
properties = input([], ...(ngDevMode ? [{ debugName: "properties" }] : /* istanbul ignore next */ []));
|
|
35702
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
35703
|
+
functionCategories = DASHBOARD_FORMULA_FUNCTION_CATEGORIES;
|
|
35704
|
+
operators = DASHBOARD_FORMULA_OPERATORS;
|
|
35705
|
+
tokens = signal([], ...(ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []));
|
|
35706
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
35707
|
+
expression = '';
|
|
35708
|
+
onChange = () => { };
|
|
35709
|
+
onTouched = () => { };
|
|
35710
|
+
constructor() {
|
|
35711
|
+
effect(() => {
|
|
35712
|
+
const properties = this.properties();
|
|
35713
|
+
const expression = untracked(() => this.expression);
|
|
35714
|
+
if (!expression)
|
|
35715
|
+
return;
|
|
35716
|
+
const tokens = tokenizeLegacyDashboardFormula(expression, properties);
|
|
35717
|
+
this.tokens.set(tokens);
|
|
35718
|
+
this.editor()?.writeValue(tokens);
|
|
35719
|
+
});
|
|
35720
|
+
}
|
|
35721
|
+
writeValue(value) {
|
|
35722
|
+
this.expression =
|
|
35723
|
+
typeof value === 'string' ? normalizeDashboardFormula(value) : '';
|
|
35724
|
+
const tokens = tokenizeLegacyDashboardFormula(this.expression, this.properties());
|
|
35725
|
+
this.tokens.set(tokens);
|
|
35726
|
+
this.editor()?.writeValue(tokens);
|
|
35727
|
+
}
|
|
35728
|
+
registerOnChange(fn) {
|
|
35729
|
+
this.onChange = fn;
|
|
35730
|
+
}
|
|
35731
|
+
registerOnTouched(fn) {
|
|
35732
|
+
this.onTouched = fn;
|
|
35733
|
+
}
|
|
35734
|
+
setDisabledState(isDisabled) {
|
|
35735
|
+
this.disabled.set(isDisabled);
|
|
35736
|
+
}
|
|
35737
|
+
onBlockInsert(block) {
|
|
35738
|
+
if (this.disabled())
|
|
35739
|
+
return;
|
|
35740
|
+
const editor = this.editor();
|
|
35741
|
+
if (!editor)
|
|
35742
|
+
return;
|
|
35743
|
+
if (block.type === 'property') {
|
|
35744
|
+
const key = normalizeDashboardFormula(block.propertyKey || block.value).replace(/^@/, '');
|
|
35745
|
+
const property = this.properties().find((item) => item.key === key) ?? {
|
|
35746
|
+
key,
|
|
35747
|
+
name: block.display || key,
|
|
35748
|
+
};
|
|
35749
|
+
editor.addTokens([createLegacyPropertyToken(property)]);
|
|
35750
|
+
return;
|
|
35751
|
+
}
|
|
35752
|
+
editor.addBlock(block);
|
|
35753
|
+
}
|
|
35754
|
+
onFormulaChange(value) {
|
|
35755
|
+
this.expression = normalizeDashboardFormula(value);
|
|
35756
|
+
this.onChange(this.expression);
|
|
35757
|
+
}
|
|
35758
|
+
onTokensChange(tokens) {
|
|
35759
|
+
this.tokens.set(tokens);
|
|
35760
|
+
}
|
|
35761
|
+
markTouched() {
|
|
35762
|
+
this.onTouched();
|
|
35763
|
+
}
|
|
35764
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegacyDashboardFormulaBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35765
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.8", type: LegacyDashboardFormulaBuilder, isStandalone: true, selector: "mt-dashboard-formula-builder", inputs: { properties: { classPropertyName: "properties", publicName: "properties", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
35766
|
+
{
|
|
35767
|
+
provide: NG_VALUE_ACCESSOR,
|
|
35768
|
+
useExisting: forwardRef(() => LegacyDashboardFormulaBuilder),
|
|
35769
|
+
multi: true,
|
|
35770
|
+
},
|
|
35771
|
+
], viewQueries: [{ propertyName: "editor", first: true, predicate: ["formulaEditor"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"overflow-hidden rounded-lg border border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-800\"\n [class.pointer-events-none]=\"disabled()\"\n [class.opacity-60]=\"disabled()\"\n>\n <mt-formula-toolbar\n [functionCategories]=\"functionCategories\"\n [operators]=\"operators\"\n [knownProperties]=\"properties()\"\n (onBlockInsert)=\"onBlockInsert($event)\"\n />\n\n <div class=\"border-t border-surface-200 dark:border-surface-700\">\n <mt-formula-editor\n #formulaEditor\n [initialTokens]=\"tokens()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [borderless]=\"true\"\n (formulaChange)=\"onFormulaChange($event)\"\n (tokensChange)=\"onTokensChange($event)\"\n (onBlur)=\"markTouched()\"\n />\n </div>\n</div>\n", dependencies: [{ kind: "component", type: FormulaToolbar, selector: "mt-formula-toolbar", inputs: ["knownProperties", "propertiesTemplate", "functionCategories", "operators", "initialTab", "visibleTabs", "searchPlaceholder", "labels"], outputs: ["onBlockInsert", "onTabChange"] }, { kind: "component", type: FormulaEditor, selector: "mt-formula-editor", inputs: ["placeholder", "initialTokens", "disabled", "borderless"], outputs: ["formulaChange", "tokensChange", "onBlur", "onFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
35772
|
+
}
|
|
35773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegacyDashboardFormulaBuilder, decorators: [{
|
|
35774
|
+
type: Component,
|
|
35775
|
+
args: [{ selector: 'mt-dashboard-formula-builder', standalone: true, imports: [FormulaToolbar, FormulaEditor], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
35776
|
+
{
|
|
35777
|
+
provide: NG_VALUE_ACCESSOR,
|
|
35778
|
+
useExisting: forwardRef(() => LegacyDashboardFormulaBuilder),
|
|
35779
|
+
multi: true,
|
|
35780
|
+
},
|
|
35781
|
+
], template: "<div\n class=\"overflow-hidden rounded-lg border border-surface-200 bg-surface-0 dark:border-surface-700 dark:bg-surface-800\"\n [class.pointer-events-none]=\"disabled()\"\n [class.opacity-60]=\"disabled()\"\n>\n <mt-formula-toolbar\n [functionCategories]=\"functionCategories\"\n [operators]=\"operators\"\n [knownProperties]=\"properties()\"\n (onBlockInsert)=\"onBlockInsert($event)\"\n />\n\n <div class=\"border-t border-surface-200 dark:border-surface-700\">\n <mt-formula-editor\n #formulaEditor\n [initialTokens]=\"tokens()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [borderless]=\"true\"\n (formulaChange)=\"onFormulaChange($event)\"\n (tokensChange)=\"onTokensChange($event)\"\n (onBlur)=\"markTouched()\"\n />\n </div>\n</div>\n" }]
|
|
35782
|
+
}], ctorParameters: () => [], propDecorators: { editor: [{ type: i0.ViewChild, args: ['formulaEditor', { isSignal: true }] }], properties: [{ type: i0.Input, args: [{ isSignal: true, alias: "properties", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
|
|
35783
|
+
|
|
35376
35784
|
/**
|
|
35377
35785
|
* General Query Component
|
|
35378
35786
|
*
|
|
@@ -35397,17 +35805,11 @@ class GeneralQuery {
|
|
|
35397
35805
|
optionLabel: 'name',
|
|
35398
35806
|
items: this.propertiesFlat(),
|
|
35399
35807
|
}), ...(ngDevMode ? [{ debugName: "optionsConfig" }] : /* istanbul ignore next */ []));
|
|
35400
|
-
/**
|
|
35401
|
-
|
|
35402
|
-
|
|
35403
|
-
|
|
35404
|
-
|
|
35405
|
-
viewType: property.viewType,
|
|
35406
|
-
})),
|
|
35407
|
-
}), ...(ngDevMode ? [{ debugName: "formulaPropertiesByPath" }] : /* istanbul ignore next */ []));
|
|
35408
|
-
/** Exact P+4 chart-formula functions and composition operators. */
|
|
35409
|
-
dashboardFormulaFunctionCategories = DASHBOARD_FORMULA_FUNCTION_CATEGORIES;
|
|
35410
|
-
dashboardFormulaOperators = DASHBOARD_FORMULA_OPERATORS;
|
|
35808
|
+
/** Flat P+4 property list; stored formulas use the raw property key. */
|
|
35809
|
+
formulaProperties = computed(() => this.propertiesFlat().map((property) => ({
|
|
35810
|
+
key: property.key,
|
|
35811
|
+
name: property.name || property.label || property.key,
|
|
35812
|
+
})), ...(ngDevMode ? [{ debugName: "formulaProperties" }] : /* istanbul ignore next */ []));
|
|
35411
35813
|
/** Aggregate function options */
|
|
35412
35814
|
aggregateFunctions = [
|
|
35413
35815
|
{ value: 'Sum', label: 'Sum' },
|
|
@@ -35627,7 +36029,12 @@ class GeneralQuery {
|
|
|
35627
36029
|
autoStackByProperty: [s.autoStackByProperty ?? null],
|
|
35628
36030
|
filters: this.fb.array((s.filters || []).map((f) => this.createFilterFormGroup(f))),
|
|
35629
36031
|
extraProperties: [s.extraProperties || []],
|
|
35630
|
-
formula: [
|
|
36032
|
+
formula: [
|
|
36033
|
+
typeof s.formula === 'string'
|
|
36034
|
+
? normalizeDashboardFormula(s.formula)
|
|
36035
|
+
: '',
|
|
36036
|
+
formulaValidators,
|
|
36037
|
+
],
|
|
35631
36038
|
showAdvancedSettings: [s.showAdvancedSettings ?? false],
|
|
35632
36039
|
barType: [s.barType || 'bar'],
|
|
35633
36040
|
}, {
|
|
@@ -35792,7 +36199,7 @@ class GeneralQuery {
|
|
|
35792
36199
|
useExisting: forwardRef(() => GeneralQuery),
|
|
35793
36200
|
multi: true,
|
|
35794
36201
|
},
|
|
35795
|
-
], ngImport: i0, template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series 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 bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (shouldShowField(\"formula\")) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\r\n [id]=\"advancedSettingsToggleId(i)\"\r\n [attr.aria-expanded]=\"\r\n series.value.showAdvancedSettings ? 'true' : 'false'\r\n \"\r\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggleAdvanced(i)\"\r\n >\r\n <mt-icon\r\n icon=\"general.settings-02\"\r\n class=\"text-base\"\r\n aria-hidden=\"true\"\r\n />\r\n <span>\r\n {{\r\n t(\r\n advancedSettingsActionKey(\r\n series.value.showAdvancedSettings\r\n )\r\n )\r\n }}\r\n </span>\r\n </button>\r\n }\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)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n [id]=\"advancedSettingsPanelId(i)\"\r\n role=\"region\"\r\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [functionCategories]=\"dashboardFormulaFunctionCategories\"\r\n [operators]=\"dashboardFormulaOperators\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\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\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\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 </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { 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", "ariaLabel"], 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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { 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: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextKey", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
36202
|
+
], ngImport: i0, template: "<div\n class=\"flex flex-col gap-4\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n [formGroup]=\"queryForm\"\n>\n <!-- Category Property (shown for certain chart types) -->\n @if (shouldShowField(\"categoryProperty\")) {\n <div class=\"mb-2\">\n <mt-select-field\n [label]=\"t('categoryProperty')\"\n formControlName=\"categoryProperty\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectCategoryProperty')\"\n [filter]=\"true\"\n />\n </div>\n }\n\n <!-- Add Series Button -->\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\n <div class=\"flex justify-end\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n\n <!-- Series List -->\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\n @for (\n series of seriesArray.controls;\n track trackByIndex(i);\n let i = $index\n ) {\n <div\n class=\"p-4 rounded-lg border transition-all\"\n [class.border-red-500]=\"series.invalid\"\n [class.border-surface-200]=\"!series.invalid\"\n [formGroupName]=\"i\"\n >\n <!-- Series Header -->\n <div class=\"flex items-center justify-between mb-4\">\n <div class=\"flex items-center gap-2\">\n <span\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\n >\n {{ i + 1 }}\n </span>\n <span class=\"text-sm font-medium text-muted-color\">{{\n t(\"series\")\n }}</span>\n </div>\n <div class=\"flex items-center gap-2\">\n @if (shouldShowField(\"formula\")) {\n <button\n type=\"button\"\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\n [id]=\"advancedSettingsToggleId(i)\"\n [attr.aria-expanded]=\"\n series.value.showAdvancedSettings ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\n [disabled]=\"disabled\"\n (click)=\"toggleAdvanced(i)\"\n >\n <mt-icon\n icon=\"general.settings-02\"\n class=\"text-base\"\n aria-hidden=\"true\"\n />\n <span>\n {{\n t(\n advancedSettingsActionKey(\n series.value.showAdvancedSettings\n )\n )\n }}\n </span>\n </button>\n }\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"deleteSeries(i)\"\n />\n </div>\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <!-- Auto Stack Toggle -->\n @if (shouldShowField(\"autoStack\")) {\n <div class=\"md:col-span-2 lg:col-span-3\">\n <mt-toggle-field\n [label]=\"t('autoStack')\"\n formControlName=\"autoStack\"\n />\n </div>\n }\n\n <!-- Value Property -->\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\n <mt-select-field\n [label]=\"t('valueProperty')\"\n formControlName=\"valueProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectValueProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Aggregate Function -->\n @if (shouldShowField(\"aggregateFunction\")) {\n <mt-select-field\n [label]=\"t('aggregateFunction')\"\n formControlName=\"aggregateFunction\"\n [options]=\"aggregateFunctions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n }\n\n <!-- Color Picker -->\n @if (shouldShowField(\"color\")) {\n <mt-color-picker-field\n [label]=\"t('seriesColor')\"\n formControlName=\"color\"\n />\n }\n\n <!-- Bar Type (for stacked bar charts) -->\n @if (shouldShowField(\"barType\")) {\n <mt-select-field\n [label]=\"t('barType')\"\n formControlName=\"barType\"\n [options]=\"barTypes\"\n optionLabel=\"name\"\n optionValue=\"key\"\n />\n }\n\n <!-- Auto Stack By Property -->\n @if (\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\n ) {\n <mt-select-field\n [label]=\"t('autoStackByProperty')\"\n formControlName=\"autoStackByProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Group By Properties -->\n @if (shouldShowField(\"groupByProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('groupByProperties')\"\n formControlName=\"groupByProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Stack Properties (for stacked charts) -->\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('stackProperties')\"\n formControlName=\"stackProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Extra Properties -->\n @if (shouldShowField(\"extraProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n formControlName=\"extraProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n </div>\n\n <!-- Advanced Settings (Formula) -->\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\n <div\n [id]=\"advancedSettingsPanelId(i)\"\n role=\"region\"\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <div class=\"text-sm font-medium mb-2\">\n {{ t(\"advancedSettings\") }}\n </div>\n <label class=\"mb-2 block text-sm font-medium\">\n {{ t(\"formula\") }}\n </label>\n <mt-dashboard-formula-builder\n formControlName=\"formula\"\n [properties]=\"formulaProperties()\"\n [placeholder]=\"t('enterFormula')\"\n />\n </div>\n }\n\n <!-- Filters Section -->\n @if (shouldShowField(\"filters\")) {\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\n <div class=\"flex items-center justify-between mb-3\">\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\n <mt-button\n icon=\"general.plus\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addFilter(i)\"\n [pTooltip]=\"t('addFilter')\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\n @for (\n filter of getFilters(series).controls;\n track trackByIndex(j);\n let j = $index\n ) {\n <div\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\n [formGroupName]=\"j\"\n >\n <!-- Property Key -->\n <div class=\"col-span-4\">\n <mt-select-field\n [label]=\"j === 0 ? t('property') : ''\"\n formControlName=\"propertyKey\"\n [options]=\"\n useGroupedSelect()\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n </div>\n\n <!-- Operator -->\n <div class=\"col-span-2\">\n <mt-select-field\n [label]=\"j === 0 ? t('operator') : ''\"\n formControlName=\"operator\"\n [options]=\"operators\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n </div>\n\n <!-- Value -->\n <div class=\"col-span-4\">\n <mt-text-field\n [label]=\"j === 0 ? t('value') : ''\"\n formControlName=\"value\"\n [placeholder]=\"t('enterValue')\"\n />\n </div>\n\n <!-- Remove Filter -->\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"removeFilter(i, j)\"\n />\n </div>\n </div>\n }\n\n @if (getFilters(series).length === 0) {\n <div class=\"text-center py-3 text-muted-color text-sm\">\n {{ t(\"noFiltersConfigured\") }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (seriesArray.length === 0) {\n <div\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\n >\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n severity=\"secondary\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { 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", "ariaLabel"], 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: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { 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: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: LegacyDashboardFormulaBuilder, selector: "mt-dashboard-formula-builder", inputs: ["properties", "placeholder"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
35796
36203
|
}
|
|
35797
36204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: GeneralQuery, decorators: [{
|
|
35798
36205
|
type: Component,
|
|
@@ -35806,7 +36213,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
35806
36213
|
TextField,
|
|
35807
36214
|
ToggleField,
|
|
35808
36215
|
ColorPickerField,
|
|
35809
|
-
|
|
36216
|
+
LegacyDashboardFormulaBuilder,
|
|
35810
36217
|
Icon,
|
|
35811
36218
|
StringArrayInput,
|
|
35812
36219
|
Tooltip,
|
|
@@ -35821,7 +36228,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
35821
36228
|
useExisting: forwardRef(() => GeneralQuery),
|
|
35822
36229
|
multi: true,
|
|
35823
36230
|
},
|
|
35824
|
-
], template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series 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 bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (shouldShowField(\"formula\")) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\r\n [id]=\"advancedSettingsToggleId(i)\"\r\n [attr.aria-expanded]=\"\r\n series.value.showAdvancedSettings ? 'true' : 'false'\r\n \"\r\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggleAdvanced(i)\"\r\n >\r\n <mt-icon\r\n icon=\"general.settings-02\"\r\n class=\"text-base\"\r\n aria-hidden=\"true\"\r\n />\r\n <span>\r\n {{\r\n t(\r\n advancedSettingsActionKey(\r\n series.value.showAdvancedSettings\r\n )\r\n )\r\n }}\r\n </span>\r\n </button>\r\n }\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)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n [id]=\"advancedSettingsPanelId(i)\"\r\n role=\"region\"\r\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [functionCategories]=\"dashboardFormulaFunctionCategories\"\r\n [operators]=\"dashboardFormulaOperators\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\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\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\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 </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
36231
|
+
], template: "<div\n class=\"flex flex-col gap-4\"\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\n [formGroup]=\"queryForm\"\n>\n <!-- Category Property (shown for certain chart types) -->\n @if (shouldShowField(\"categoryProperty\")) {\n <div class=\"mb-2\">\n <mt-select-field\n [label]=\"t('categoryProperty')\"\n formControlName=\"categoryProperty\"\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectCategoryProperty')\"\n [filter]=\"true\"\n />\n </div>\n }\n\n <!-- Add Series Button -->\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\n <div class=\"flex justify-end\">\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n\n <!-- Series List -->\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\n @for (\n series of seriesArray.controls;\n track trackByIndex(i);\n let i = $index\n ) {\n <div\n class=\"p-4 rounded-lg border transition-all\"\n [class.border-red-500]=\"series.invalid\"\n [class.border-surface-200]=\"!series.invalid\"\n [formGroupName]=\"i\"\n >\n <!-- Series Header -->\n <div class=\"flex items-center justify-between mb-4\">\n <div class=\"flex items-center gap-2\">\n <span\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\n >\n {{ i + 1 }}\n </span>\n <span class=\"text-sm font-medium text-muted-color\">{{\n t(\"series\")\n }}</span>\n </div>\n <div class=\"flex items-center gap-2\">\n @if (shouldShowField(\"formula\")) {\n <button\n type=\"button\"\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\n [id]=\"advancedSettingsToggleId(i)\"\n [attr.aria-expanded]=\"\n series.value.showAdvancedSettings ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\n [disabled]=\"disabled\"\n (click)=\"toggleAdvanced(i)\"\n >\n <mt-icon\n icon=\"general.settings-02\"\n class=\"text-base\"\n aria-hidden=\"true\"\n />\n <span>\n {{\n t(\n advancedSettingsActionKey(\n series.value.showAdvancedSettings\n )\n )\n }}\n </span>\n </button>\n }\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"deleteSeries(i)\"\n />\n </div>\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n <!-- Auto Stack Toggle -->\n @if (shouldShowField(\"autoStack\")) {\n <div class=\"md:col-span-2 lg:col-span-3\">\n <mt-toggle-field\n [label]=\"t('autoStack')\"\n formControlName=\"autoStack\"\n />\n </div>\n }\n\n <!-- Value Property -->\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\n <mt-select-field\n [label]=\"t('valueProperty')\"\n formControlName=\"valueProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectValueProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Aggregate Function -->\n @if (shouldShowField(\"aggregateFunction\")) {\n <mt-select-field\n [label]=\"t('aggregateFunction')\"\n formControlName=\"aggregateFunction\"\n [options]=\"aggregateFunctions\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n }\n\n <!-- Color Picker -->\n @if (shouldShowField(\"color\")) {\n <mt-color-picker-field\n [label]=\"t('seriesColor')\"\n formControlName=\"color\"\n />\n }\n\n <!-- Bar Type (for stacked bar charts) -->\n @if (shouldShowField(\"barType\")) {\n <mt-select-field\n [label]=\"t('barType')\"\n formControlName=\"barType\"\n [options]=\"barTypes\"\n optionLabel=\"name\"\n optionValue=\"key\"\n />\n }\n\n <!-- Auto Stack By Property -->\n @if (\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\n ) {\n <mt-select-field\n [label]=\"t('autoStackByProperty')\"\n formControlName=\"autoStackByProperty\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n }\n\n <!-- Group By Properties -->\n @if (shouldShowField(\"groupByProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('groupByProperties')\"\n formControlName=\"groupByProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Stack Properties (for stacked charts) -->\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('stackProperties')\"\n formControlName=\"stackProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n\n <!-- Extra Properties -->\n @if (shouldShowField(\"extraProperties\")) {\n <div class=\"col-span-full\">\n <mt-string-array-input\n [label]=\"t('extraProperties')\"\n formControlName=\"extraProperties\"\n [options]=\"\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n [placeholder]=\"t('selectProperties')\"\n />\n </div>\n }\n </div>\n\n <!-- Advanced Settings (Formula) -->\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\n <div\n [id]=\"advancedSettingsPanelId(i)\"\n role=\"region\"\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\n >\n <div class=\"text-sm font-medium mb-2\">\n {{ t(\"advancedSettings\") }}\n </div>\n <label class=\"mb-2 block text-sm font-medium\">\n {{ t(\"formula\") }}\n </label>\n <mt-dashboard-formula-builder\n formControlName=\"formula\"\n [properties]=\"formulaProperties()\"\n [placeholder]=\"t('enterFormula')\"\n />\n </div>\n }\n\n <!-- Filters Section -->\n @if (shouldShowField(\"filters\")) {\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\n <div class=\"flex items-center justify-between mb-3\">\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\n <mt-button\n icon=\"general.plus\"\n severity=\"secondary\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addFilter(i)\"\n [pTooltip]=\"t('addFilter')\"\n />\n </div>\n\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\n @for (\n filter of getFilters(series).controls;\n track trackByIndex(j);\n let j = $index\n ) {\n <div\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\n [formGroupName]=\"j\"\n >\n <!-- Property Key -->\n <div class=\"col-span-4\">\n <mt-select-field\n [label]=\"j === 0 ? t('property') : ''\"\n formControlName=\"propertyKey\"\n [options]=\"\n useGroupedSelect()\n ? propertiesGrouped()\n : propertiesFlat()\n \"\n [group]=\"useGroupedSelect()\"\n optionLabel=\"name\"\n optionValue=\"key\"\n optionGroupLabel=\"label\"\n optionGroupChildren=\"items\"\n [placeholder]=\"t('selectProperty')\"\n [filter]=\"true\"\n />\n </div>\n\n <!-- Operator -->\n <div class=\"col-span-2\">\n <mt-select-field\n [label]=\"j === 0 ? t('operator') : ''\"\n formControlName=\"operator\"\n [options]=\"operators\"\n optionLabel=\"label\"\n optionValue=\"value\"\n />\n </div>\n\n <!-- Value -->\n <div class=\"col-span-4\">\n <mt-text-field\n [label]=\"j === 0 ? t('value') : ''\"\n formControlName=\"value\"\n [placeholder]=\"t('enterValue')\"\n />\n </div>\n\n <!-- Remove Filter -->\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\n <mt-button\n icon=\"general.trash-01\"\n severity=\"danger\"\n [rounded]=\"true\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"removeFilter(i, j)\"\n />\n </div>\n </div>\n }\n\n @if (getFilters(series).length === 0) {\n <div class=\"text-center py-3 text-muted-color text-sm\">\n {{ t(\"noFiltersConfigured\") }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (seriesArray.length === 0) {\n <div\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\n >\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\n <mt-button\n icon=\"general.plus\"\n [label]=\"t('addSeries')\"\n severity=\"secondary\"\n size=\"small\"\n [disabled]=\"disabled\"\n (onClick)=\"addSeries()\"\n />\n </div>\n }\n </div>\n</div>\n" }]
|
|
35825
36232
|
}], ctorParameters: () => [], propDecorators: { chartType: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartType", required: false }] }], querySchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "querySchema", required: false }] }], propertiesFlat: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesFlat", required: false }] }], propertiesGrouped: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesGrouped", required: false }] }] } });
|
|
35826
36233
|
|
|
35827
36234
|
/**
|
|
@@ -38171,7 +38578,7 @@ class ManageItem {
|
|
|
38171
38578
|
this._manageItemService.updateServiceConfig(partialConfig);
|
|
38172
38579
|
}
|
|
38173
38580
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38174
|
-
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'\">\r\n <div class=\"flex flex-col h-full\" [class]=\"modal.contentClass\">\r\n <div class=\"flex flex-1 min-h-0\">\r\n <!-- Left: Datasource configuration -->\r\n <div\r\n class=\"db-sectioned-drawer flex min-w-0 flex-col\"\r\n [class.flex-1]=\"previewCollapsed()\"\r\n [class.border-r]=\"!previewCollapsed()\"\r\n [class.border-surface-200]=\"!previewCollapsed()\"\r\n [style.width]=\"previewCollapsed() ? '100%' : '60%'\"\r\n >\r\n <!-- Header: chart type badge + preview toggle -->\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-2.5\"\r\n >\r\n @if (selectedChartType()) {\r\n <span\r\n class=\"flex h-9 w-9 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"selectedChartType()?.icon\" class=\"text-lg\" />\r\n </span>\r\n <div class=\"min-w-0 flex-1\">\r\n <h3 class=\"truncate text-sm font-semibold text-surface-700\">\r\n {{ isNew() ? t(\"newItem\") : t(\"editItem\") }}\r\n </h3>\r\n <p class=\"truncate text-xs text-muted-color\">\r\n {{ selectedChartType()?.name }}\r\n </p>\r\n </div>\r\n } @else {\r\n <div class=\"flex-1\"></div>\r\n }\r\n\r\n <mt-button\r\n [label]=\"previewCollapsed() ? t('showPreview') : t('hidePreview')\"\r\n [icon]=\"previewCollapsed() ? 'general.eye' : 'general.eye-off'\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"togglePreview()\"\r\n />\r\n </div>\r\n\r\n <!-- Datasource is intentionally the only concern in this drawer. -->\r\n <div class=\"flex-1 overflow-auto p-4\">\r\n <mt-data-source-settings\r\n [config]=\"config()\"\r\n [chartType]=\"selectedChartType()\"\r\n [informativeContext]=\"informativeContext()\"\r\n (serviceConfigChange)=\"onServiceConfigUpdate($event)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <!-- Right: collapsible chart preview -->\r\n @if (!previewCollapsed()) {\r\n <div class=\"h-full min-w-[350px]\" [style.width]=\"'40%'\">\r\n <mt-chart-viewer [config]=\"config()\" [chartTypeId]=\"chartTypeId()\" />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <!-- Validation Status -->\r\n <div class=\"flex items-center gap-2 text-sm flex-1\">\r\n @if (isValid()) {\r\n <span class=\"flex items-center gap-1 text-green-600\">\r\n <mt-icon icon=\"general.check-circle\" class=\"text-base\" />\r\n {{ t(\"ready\") }}\r\n </span>\r\n } @else {\r\n <span class=\"flex items-center gap-1 text-amber-600\">\r\n <mt-icon icon=\"general.alert-circle\" class=\"text-base\" />\r\n {{ t(\"incomplete\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"cancel()\" />\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"!isValid()\"\r\n (onClick)=\"save()\"\r\n />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: 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: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
38581
|
+
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'\">\r\n <div class=\"flex flex-col h-full\" [class]=\"modal.contentClass\">\r\n <div class=\"flex flex-1 min-h-0\">\r\n <!-- Left: Datasource configuration -->\r\n <div\r\n class=\"db-sectioned-drawer flex min-w-0 flex-col\"\r\n [class.flex-1]=\"previewCollapsed()\"\r\n [class.border-r]=\"!previewCollapsed()\"\r\n [class.border-surface-200]=\"!previewCollapsed()\"\r\n [style.width]=\"previewCollapsed() ? '100%' : '60%'\"\r\n >\r\n <!-- Header: chart type badge + preview toggle -->\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 bg-surface-50 px-4 py-2.5\"\r\n >\r\n @if (selectedChartType()) {\r\n <span\r\n class=\"flex h-9 w-9 items-center justify-center rounded-lg bg-primary-100 text-primary-600\"\r\n >\r\n <mt-icon [icon]=\"selectedChartType()?.icon\" class=\"text-lg\" />\r\n </span>\r\n <div class=\"min-w-0 flex-1\">\r\n <h3 class=\"truncate text-sm font-semibold text-surface-700\">\r\n {{ isNew() ? t(\"newItem\") : t(\"editItem\") }}\r\n </h3>\r\n <p class=\"truncate text-xs text-muted-color\">\r\n {{ selectedChartType()?.name }}\r\n </p>\r\n </div>\r\n } @else {\r\n <div class=\"flex-1\"></div>\r\n }\r\n\r\n <mt-button\r\n [label]=\"previewCollapsed() ? t('showPreview') : t('hidePreview')\"\r\n [icon]=\"previewCollapsed() ? 'general.eye' : 'general.eye-off'\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"togglePreview()\"\r\n />\r\n </div>\r\n\r\n <!-- Datasource is intentionally the only concern in this drawer. -->\r\n <div class=\"flex-1 overflow-auto p-4\">\r\n <mt-data-source-settings\r\n [config]=\"config()\"\r\n [chartType]=\"selectedChartType()\"\r\n [informativeContext]=\"informativeContext()\"\r\n (serviceConfigChange)=\"onServiceConfigUpdate($event)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <!-- Right: collapsible chart preview -->\r\n @if (!previewCollapsed()) {\r\n <div class=\"h-full min-w-[350px]\" [style.width]=\"'40%'\">\r\n <mt-chart-viewer [config]=\"config()\" [chartTypeId]=\"chartTypeId()\" />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <!-- Validation Status -->\r\n <div class=\"flex items-center gap-2 text-sm flex-1\">\r\n @if (isValid()) {\r\n <span class=\"flex items-center gap-1 text-green-600\">\r\n <mt-icon icon=\"general.check-circle\" class=\"text-base\" />\r\n {{ t(\"ready\") }}\r\n </span>\r\n } @else {\r\n <span class=\"flex items-center gap-1 text-amber-600\">\r\n <mt-icon icon=\"general.alert-circle\" class=\"text-base\" />\r\n {{ t(\"incomplete\") }}\r\n </span>\r\n }\r\n </div>\r\n\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"cancel()\" />\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"!isValid()\"\r\n (onClick)=\"save()\"\r\n />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: DataSourceSettings, selector: "mt-data-source-settings", inputs: ["config", "chartType", "informativeContext"], outputs: ["serviceConfigChange"] }, { kind: "component", type: ChartViewer, selector: "mt-chart-viewer", inputs: ["config", "chartTypeId", "hideHeader"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
38175
38582
|
}
|
|
38176
38583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ManageItem, decorators: [{
|
|
38177
38584
|
type: Component,
|
|
@@ -43140,7 +43547,8 @@ class DashboardBuilder {
|
|
|
43140
43547
|
filtersConfig = signal([], ...(ngDevMode ? [{ debugName: "filtersConfig" }] : /* istanbul ignore next */ []));
|
|
43141
43548
|
selectedCharts = signal([], ...(ngDevMode ? [{ debugName: "selectedCharts" }] : /* istanbul ignore next */ []));
|
|
43142
43549
|
contextPos = signal({ x: 0, y: 0 }, ...(ngDevMode ? [{ debugName: "contextPos" }] : /* istanbul ignore next */ []));
|
|
43143
|
-
|
|
43550
|
+
preview = signal(false, ...(ngDevMode ? [{ debugName: "preview" }] : /* istanbul ignore next */ []));
|
|
43551
|
+
isReadonly = computed(() => this.readonly() || this.preview(), ...(ngDevMode ? [{ debugName: "isReadonly" }] : /* istanbul ignore next */ []));
|
|
43144
43552
|
pendingWidgetType = signal(null, ...(ngDevMode ? [{ debugName: "pendingWidgetType" }] : /* istanbul ignore next */ []));
|
|
43145
43553
|
/** Whether the most recent action can be reverted (drives the Undo button). */
|
|
43146
43554
|
canUndo = signal(false, ...(ngDevMode ? [{ debugName: "canUndo" }] : /* istanbul ignore next */ []));
|
|
@@ -43222,6 +43630,18 @@ class DashboardBuilder {
|
|
|
43222
43630
|
emptyCellContextMenuCallback: this.onContextMenu.bind(this),
|
|
43223
43631
|
emptyCellDropCallback: this.onDrop.bind(this),
|
|
43224
43632
|
};
|
|
43633
|
+
gridsterEditableEffect = effect(() => {
|
|
43634
|
+
const editable = !this.isReadonly();
|
|
43635
|
+
if (this.options.draggable)
|
|
43636
|
+
this.options.draggable.enabled = editable;
|
|
43637
|
+
if (this.options.resizable)
|
|
43638
|
+
this.options.resizable.enabled = editable;
|
|
43639
|
+
this.options.enableEmptyCellClick = editable;
|
|
43640
|
+
this.options.enableEmptyCellContextMenu = editable;
|
|
43641
|
+
this.options.enableEmptyCellDrag = editable;
|
|
43642
|
+
this.options.enableEmptyCellDrop = editable;
|
|
43643
|
+
this.options.api?.optionsChanged?.();
|
|
43644
|
+
}, ...(ngDevMode ? [{ debugName: "gridsterEditableEffect" }] : /* istanbul ignore next */ []));
|
|
43225
43645
|
// ============================================
|
|
43226
43646
|
// Private
|
|
43227
43647
|
// ============================================
|
|
@@ -43719,6 +44139,8 @@ class DashboardBuilder {
|
|
|
43719
44139
|
}
|
|
43720
44140
|
/** Handle drop on empty cell from widget palette */
|
|
43721
44141
|
onDrop(event, item) {
|
|
44142
|
+
if (this.isReadonly())
|
|
44143
|
+
return;
|
|
43722
44144
|
const data = event.dataTransfer?.getData('application/json');
|
|
43723
44145
|
if (!data)
|
|
43724
44146
|
return;
|
|
@@ -43761,6 +44183,8 @@ class DashboardBuilder {
|
|
|
43761
44183
|
}
|
|
43762
44184
|
}
|
|
43763
44185
|
onSelect(chart, event) {
|
|
44186
|
+
if (this.isReadonly())
|
|
44187
|
+
return;
|
|
43764
44188
|
if (event.ctrlKey || event.metaKey) {
|
|
43765
44189
|
const chartId = chart.config?.serviceConfig?.dashboardId;
|
|
43766
44190
|
this.selectedCharts.update((selected) => {
|
|
@@ -43772,6 +44196,8 @@ class DashboardBuilder {
|
|
|
43772
44196
|
}
|
|
43773
44197
|
}
|
|
43774
44198
|
pasteSelectedCharts() {
|
|
44199
|
+
if (this.isReadonly())
|
|
44200
|
+
return;
|
|
43775
44201
|
if (!this.selectedCharts().length)
|
|
43776
44202
|
return;
|
|
43777
44203
|
const actualSelectedCharts = this.charts().filter((chart) => this.selectedCharts().includes(chart.config?.serviceConfig?.dashboardId));
|
|
@@ -44067,7 +44493,7 @@ class DashboardBuilder {
|
|
|
44067
44493
|
}
|
|
44068
44494
|
/** Whether the kebab menu should appear on this chart card. */
|
|
44069
44495
|
showContextToolbar(chart) {
|
|
44070
|
-
if (this.
|
|
44496
|
+
if (this.isReadonly())
|
|
44071
44497
|
return false;
|
|
44072
44498
|
const componentName = chart.config?.clientConfig?.componentName;
|
|
44073
44499
|
// Layout widgets (header/topbar) and group containers keep their
|
|
@@ -45189,11 +45615,13 @@ class DashboardBuilder {
|
|
|
45189
45615
|
}
|
|
45190
45616
|
}
|
|
45191
45617
|
// ============================================
|
|
45192
|
-
//
|
|
45618
|
+
// Preview Toggle
|
|
45193
45619
|
// ============================================
|
|
45194
|
-
|
|
45195
|
-
this.
|
|
45196
|
-
|
|
45620
|
+
togglePreview() {
|
|
45621
|
+
this.preview.update((v) => !v);
|
|
45622
|
+
if (this.preview()) {
|
|
45623
|
+
this.selectedCharts.set([]);
|
|
45624
|
+
}
|
|
45197
45625
|
}
|
|
45198
45626
|
// ============================================
|
|
45199
45627
|
// Helpers
|
|
@@ -45354,7 +45782,7 @@ class DashboardBuilder {
|
|
|
45354
45782
|
* which is a bug in its own right rather than part of the undone state.
|
|
45355
45783
|
*/
|
|
45356
45784
|
undo() {
|
|
45357
|
-
if (this.
|
|
45785
|
+
if (this.isReadonly())
|
|
45358
45786
|
return;
|
|
45359
45787
|
// A change may still be sitting in the debounce window — record it first so
|
|
45360
45788
|
// this undo reverts that action instead of skipping past it.
|
|
@@ -45595,7 +46023,7 @@ class DashboardBuilder {
|
|
|
45595
46023
|
return current;
|
|
45596
46024
|
}
|
|
45597
46025
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45598
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardBuilder, isStandalone: true, selector: "mt-dashboard-builder", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, services: { classPropertyName: "services", publicName: "services", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogsResolver: { classPropertyName: "levelLogsResolver", publicName: "levelLogsResolver", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardData: "dashboardDataChange", pageChange: "pageChange", chartsChange: "chartsChange", onSave: "onSave", onBack: "onBack", onAddChart: "onAddChart", onEditChart: "onEditChart" }, host: { listeners: { "window:keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["contextMenu"], descendants: true, isSignal: true }, { propertyName: "gridsterContainer", first: true, predicate: ["gridsterContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo() || readonly()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [icon]=\"stopActionsOnCards() ? 'media.play' : 'media.stop'\"\r\n [tooltip]=\"stopActionsOnCards() ? t('activateActions') : t('stopActions')\"\r\n (onClick)=\"stopAndActiveActions()\"\r\n [severity]=\"'warn'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n [class.pointer-events-none]=\"readonly()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!readonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !readonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"readonly()\"\r\n [builderMode]=\"!readonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!readonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div class=\"h-full min-h-0\">\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"readonly()\"\r\n [builderMode]=\"!readonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: GridsterModule }, { kind: "component", type: i2$3.GridsterComponent, selector: "gridster", inputs: ["options"] }, { kind: "component", type: i2$3.GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "ngmodule", type: ContextMenuModule }, { kind: "component", type: i3$1.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "reportId", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: ItemCardMenuComponent, selector: "mt-item-card-menu", inputs: ["allowDuplicate", "hasLinkedDialog", "canLinkDialog"], outputs: ["action"] }, { kind: "pipe", type: FilterByGroupPipe, name: "filterByGroup" }], encapsulation: i0.ViewEncapsulation.None });
|
|
46026
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardBuilder, isStandalone: true, selector: "mt-dashboard-builder", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, backButton: { classPropertyName: "backButton", publicName: "backButton", isSignal: true, isRequired: false, transformFunction: null }, pageId: { classPropertyName: "pageId", publicName: "pageId", isSignal: true, isRequired: false, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, services: { classPropertyName: "services", publicName: "services", isSignal: true, isRequired: false, transformFunction: null }, dashboardData: { classPropertyName: "dashboardData", publicName: "dashboardData", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null }, extraFilters: { classPropertyName: "extraFilters", publicName: "extraFilters", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, statuses: { classPropertyName: "statuses", publicName: "statuses", isSignal: true, isRequired: false, transformFunction: null }, levelsSchema: { classPropertyName: "levelsSchema", publicName: "levelsSchema", isSignal: true, isRequired: false, transformFunction: null }, levelLogsResolver: { classPropertyName: "levelLogsResolver", publicName: "levelLogsResolver", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardData: "dashboardDataChange", pageChange: "pageChange", chartsChange: "chartsChange", onSave: "onSave", onBack: "onBack", onAddChart: "onAddChart", onEditChart: "onEditChart" }, host: { listeners: { "window:keydown": "onKeyDown($event)" } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["contextMenu"], descendants: true, isSignal: true }, { propertyName: "gridsterContainer", first: true, predicate: ["gridsterContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div class=\"h-full min-h-0\">\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: GridsterModule }, { kind: "component", type: i2$3.GridsterComponent, selector: "gridster", inputs: ["options"] }, { kind: "component", type: i2$3.GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }, { kind: "ngmodule", type: ContextMenuModule }, { kind: "component", type: i3$1.ContextMenu, selector: "p-contextMenu, p-contextmenu, p-context-menu", inputs: ["model", "triggerEvent", "target", "global", "style", "styleClass", "autoZIndex", "baseZIndex", "id", "breakpoint", "ariaLabel", "ariaLabelledBy", "pressDelay", "appendTo", "motionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: DashboardItem, selector: "mt-dashboard-item", inputs: ["config", "chartTypeId", "readonly", "pageName", "inGroup", "isDialog", "queryParams", "extraFilters", "reportId", "ignoreQueryFilter", "builderMode"], outputs: ["actionTriggered", "configureRequested", "titleEdited"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: ItemCardMenuComponent, selector: "mt-item-card-menu", inputs: ["allowDuplicate", "hasLinkedDialog", "canLinkDialog"], outputs: ["action"] }, { kind: "pipe", type: FilterByGroupPipe, name: "filterByGroup" }], encapsulation: i0.ViewEncapsulation.None });
|
|
45599
46027
|
}
|
|
45600
46028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardBuilder, decorators: [{
|
|
45601
46029
|
type: Component,
|
|
@@ -45611,7 +46039,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
45611
46039
|
DashboardItem,
|
|
45612
46040
|
CardContentComponent,
|
|
45613
46041
|
ItemCardMenuComponent,
|
|
45614
|
-
], encapsulation: ViewEncapsulation.None, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo() || readonly()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [icon]=\"stopActionsOnCards() ? 'media.play' : 'media.stop'\"\r\n [tooltip]=\"stopActionsOnCards() ? t('activateActions') : t('stopActions')\"\r\n (onClick)=\"stopAndActiveActions()\"\r\n [severity]=\"'warn'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n [class.pointer-events-none]=\"readonly()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!readonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !readonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"readonly()\"\r\n [builderMode]=\"!readonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!readonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div class=\"h-full min-h-0\">\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"readonly()\"\r\n [builderMode]=\"!readonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"] }]
|
|
46042
|
+
], encapsulation: ViewEncapsulation.None, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Shared Actions Template -->\r\n <ng-template #actionsTemplate let-inPage=\"inPage\">\r\n @if (!isReadonly()) {\r\n <mt-button\r\n [label]=\"t('addWidget')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"toggleWidgetPalette()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n [label]=\"t('save')\"\r\n icon=\"general.save-02\"\r\n [loading]=\"saving()\"\r\n [disabled]=\"saving()\"\r\n (onClick)=\"saveDash()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <span [class]=\"'w-px h-5 bg-surface-300'\"></span>\r\n\r\n <mt-button\r\n icon=\"arrow.reverse-left\"\r\n [tooltip]=\"t('undo')\"\r\n (onClick)=\"undo()\"\r\n [disabled]=\"!canUndo()\"\r\n [severity]=\"'secondary'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n <!--\r\n Preview toggle: switches the builder into a read-only, end-user-style view\r\n (all edit affordances hidden). Offered only in a real (non-readonly) builder.\r\n -->\r\n @if (!readonly()) {\r\n <mt-button\r\n [icon]=\"preview() ? 'general.eye-off' : 'general.eye'\"\r\n [tooltip]=\"preview() ? t('exitPreview') : t('preview')\"\r\n (onClick)=\"togglePreview()\"\r\n [severity]=\"preview() ? 'warn' : 'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n\r\n @if (!isReadonly()) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('pageSettings')\"\r\n (onClick)=\"addOrEditPage(pageConfig()!)\"\r\n [severity]=\"'help'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n\r\n <mt-button\r\n icon=\"general.filter-lines\"\r\n [tooltip]=\"t('manageFilter')\"\r\n (click)=\"$event.stopPropagation(); openManageFilter()\"\r\n [severity]=\"'info'\"\r\n [outlined]=\"true\"\r\n size=\"small\"\r\n [rounded]=\"!inPage\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page\r\n [title]=\"\r\n pageTitle() ||\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n t('builder')\r\n \"\r\n [backButton]=\"backButton()\"\r\n (backButtonClick)=\"onBack.emit()\"\r\n >\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n <div class=\"flex items-center gap-2\">\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: true }\"\r\n />\r\n </div>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <ng-container *ngTemplateOutlet=\"builderContent\" />\r\n }\r\n\r\n <!-- Reusable builder content template -->\r\n <ng-template #builderContent>\r\n <div\r\n class=\"db-manage-dashboard-container relative h-full min-h-[600px]\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Loading State -->\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-64\">\r\n <i class=\"mti mti-spinner-third mti-spin text-4xl text-primary\"></i>\r\n </div>\r\n }\r\n\r\n <!-- Main Content -->\r\n @if (!loading() && pageConfig()) {\r\n <!-- Fixed Actions Bar (only when NOT page mode) -->\r\n @if (!isPage()) {\r\n <div\r\n class=\"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 bg-surface-0 rounded-full shadow-lg px-4 py-2 border border-surface-200\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"actionsTemplate; context: { inPage: false }\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Gridster Container -->\r\n <gridster\r\n #gridsterContainer\r\n [attr.dir]=\"direction()\"\r\n [options]=\"options\"\r\n class=\"db-gridster-container h-full min-h-[500px] bg-surface-50!\"\r\n [class.is-page]=\"isPage()\"\r\n (dragover)=\"onGridDragOver($event)\"\r\n (drop)=\"onGridDrop($event)\"\r\n >\r\n @for (chart of charts() | filterByGroup: undefined; track $index) {\r\n <gridster-item\r\n [item]=\"chart\"\r\n class=\"db-gridster-item bg-surface-0 rounded-lg shadow-sm border border-surface-200 overflow-hidden hover:shadow-md hover:border-surface-300\"\r\n [class.db-gridster-item--properties-list]=\"\r\n isPropertiesListChart(chart)\r\n \"\r\n [class.db-gridster-item--topbar]=\"isTopbarChart(chart)\"\r\n [class.ring-2]=\"isSelected(chart)\"\r\n [class.ring-primary]=\"isSelected(chart)\"\r\n [class.ring-offset-2]=\"isSelected(chart)\"\r\n [attr.data-chart-id]=\"chart.config?.serviceConfig?.dashboardId\"\r\n (click)=\"onSelect(chart, $event)\"\r\n >\r\n <!-- Chart Content -->\r\n <div\r\n class=\"db-gridster-item-content h-full w-full relative group\"\r\n [attr.dir]=\"direction()\"\r\n >\r\n <!-- Drag Handle -->\r\n @if (!isReadonly()) {\r\n <div\r\n class=\"drag-handler absolute top-0 left-0 right-0 h-6 cursor-move bg-gradient-to-b from-black/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center z-10\"\r\n >\r\n <i\r\n class=\"mti mti-grip-horizontal text-white/70 text-sm\"\r\n ></i>\r\n </div>\r\n }\r\n\r\n <!--\r\n Pass 7 \u2014 Single top-end Manage menu per chart card.\r\n Layout widgets (header/topbar/group) keep their dedicated\r\n affordances; chart cards have **only** the kebab.\r\n -->\r\n @if (\r\n !isReadonly() &&\r\n chart.config?.clientConfig?.componentName !== \"Group\"\r\n ) {\r\n <div\r\n class=\"db-card-actions absolute top-1 end-1 flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity z-20\"\r\n >\r\n <!-- Single kebab for chart cards (Pass 7 sole owner). -->\r\n @if (showContextToolbar(chart)) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"hasLinkedDialog(chart)\"\r\n [canLinkDialog]=\"canLinkDialog(chart)\"\r\n (action)=\"onItemCardMenuAction(chart, $event)\"\r\n />\r\n }\r\n\r\n <!-- Topbar: breadcrumb editor (layout-specific). -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.slash-divider\"\r\n [tooltip]=\"t('manageBreadcrumb')\"\r\n (onClick)=\"openBreadcrumb(chart)\"\r\n severity=\"info\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n\r\n <!--\r\n Header / topbar \u2014 quick style + delete.\r\n These widgets don't have a datasource so they don't\r\n use the chart kebab; the affordances stay minimal.\r\n -->\r\n @if (\r\n chart.config?.clientConfig?.componentName === \"header\" ||\r\n chart.config?.clientConfig?.componentName === \"topbar\"\r\n ) {\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"editor.palette\"\r\n [tooltip]=\"t('actions.style')\"\r\n (onClick)=\"openQuickManage($event, chart)\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('actions.delete')\"\r\n (onClick)=\"deleteItem(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Chart Rendering -->\r\n @if (chart.config?.clientConfig?.componentName !== \"Group\") {\r\n @if (!chart.loading) {\r\n <mt-dashboard-item\r\n [config]=\"chart.config\"\r\n [chartTypeId]=\"chart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"configureChart(chart)\"\r\n (titleEdited)=\"onChartTitleEdited(chart, $event)\"\r\n />\r\n } @else {\r\n <div class=\"flex items-center justify-center h-full\">\r\n <i\r\n class=\"mti mti-spinner-third mti-spin text-2xl text-primary\"\r\n ></i>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Group Children -->\r\n @if (chart.config?.clientConfig?.componentName === \"Group\") {\r\n <mt-card-content\r\n [title]=\"getGroupTitle(chart)\"\r\n [headerConfig]=\"getGroupHeaderConfig(chart)\"\r\n [styleConfig]=\"getGroupStyleConfig(chart)\"\r\n [cardStyleConfig]=\"getGroupCardStyleConfig(chart)\"\r\n [groupHeader]=\"true\"\r\n [isNoTopEnd]=\"false\"\r\n >\r\n <ng-container topEnd>\r\n <div\r\n class=\"db-group-card-top-end flex min-w-0 items-center justify-end gap-2\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n <div\r\n class=\"db-group-card-tabs flex min-w-0 items-center gap-1 overflow-x-auto\"\r\n >\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"db-group-card-tab h-8 max-w-48 shrink-0 truncate rounded-md px-3 text-sm font-medium transition-colors\"\r\n [class.bg-primary]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-white]=\"\r\n idx === (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.text-muted-color]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [class.hover:bg-surface-100]=\"\r\n idx !== (chart.selectedGroupIndex ?? 0)\r\n \"\r\n [title]=\"getItemTitle(childChart, idx)\"\r\n (click)=\"selectGroupChild(chart, idx, $event)\"\r\n >\r\n {{ getItemTitle(childChart, idx) }}\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (!isReadonly()) {\r\n <div class=\"flex shrink-0 items-center gap-1\">\r\n @if (\r\n getSelectedGroupChild(chart);\r\n as selectedChild\r\n ) {\r\n <mt-item-card-menu\r\n [allowDuplicate]=\"true\"\r\n [hasLinkedDialog]=\"\r\n hasLinkedDialog(selectedChild)\r\n \"\r\n [canLinkDialog]=\"canLinkDialog(selectedChild)\"\r\n (action)=\"\r\n onItemCardMenuAction(\r\n selectedChild,\r\n $event,\r\n chart\r\n )\r\n \"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.edit-05\"\r\n [tooltip]=\"t('actions.editTitle')\"\r\n (onClick)=\"requestLayoutTitleEdit(chart, $event)\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [tooltip]=\"t('removeGroup')\"\r\n (onClick)=\"removeGroup(chart)\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [rounded]=\"true\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container body>\r\n @for (\r\n childChart of getGroupChildren(chart);\r\n track childChart.config?.serviceConfig?.dashboardId;\r\n let idx = $index\r\n ) {\r\n @if (idx === (chart.selectedGroupIndex ?? 0)) {\r\n <div class=\"h-full min-h-0\">\r\n <mt-dashboard-item\r\n [config]=\"childChart.config\"\r\n [chartTypeId]=\"childChart.chartTypeId\"\r\n [readonly]=\"isReadonly()\"\r\n [builderMode]=\"!isReadonly()\"\r\n [extraFilters]=\"extraFilters()\"\r\n [reportId]=\"pageId()\"\r\n [inGroup]=\"true\"\r\n [pageName]=\"\r\n pageConfig()?.name?.[languageCode()] ||\r\n pageConfig()?.name?.['en'] ||\r\n pageConfig()?.name?.['ar'] ||\r\n ''\r\n \"\r\n (configureRequested)=\"\r\n editItem(childChart, chart, 'dataSource')\r\n \"\r\n (titleEdited)=\"\r\n onChartTitleEdited(childChart, $event)\r\n \"\r\n />\r\n </div>\r\n }\r\n }\r\n </ng-container>\r\n </mt-card-content>\r\n }\r\n </div>\r\n </gridster-item>\r\n }\r\n </gridster>\r\n\r\n <!-- Context Menu -->\r\n <p-contextMenu #contextMenu [model]=\"menuItems()\" appendTo=\"body\" />\r\n }\r\n\r\n <!-- Empty State -->\r\n @if (!loading() && !pageConfig()) {\r\n <div\r\n class=\"flex flex-col items-center justify-center h-64 text-muted-color\"\r\n >\r\n <i class=\"mti mti-layout text-6xl mb-4\"></i>\r\n <p class=\"text-lg\">{{ t(\"noPageSelected\") }}</p>\r\n <p class=\"text-sm\">{{ t(\"selectPageToStart\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n", styles: [":host{display:block;height:100%}gridster.db-gridster-container{min-height:calc(100vh - 120px);height:100%}gridster.db-gridster-container .gridster-column{border-left:1px solid var(--p-primary-100)!important;border-right:1px solid var(--p-primary-100)!important}gridster.db-gridster-container .gridster-row{border-top:1px solid var(--p-primary-100)!important;border-bottom:1px solid var(--p-primary-100)!important}gridster.db-gridster-container.is-page{min-height:calc(100vh - 200px)}gridster-item.db-gridster-item{transition:none!important}gridster-item.db-gridster-item.db-gridster-item--properties-list{background:transparent!important;border-color:transparent!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--properties-list:hover{border-color:transparent!important;box-shadow:none!important}gridster-item.db-gridster-item.db-gridster-item--topbar{background:transparent!important;border-color:transparent!important;border-width:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important}gridster-item.db-gridster-item.db-gridster-item--topbar:hover{border-color:transparent!important;box-shadow:none!important}.mti-spin{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gridster-drop-indicator{position:absolute;background:var(--p-primary-100);border:2px dashed var(--p-primary-400);border-radius:8px;pointer-events:none;z-index:100}.db-card-actions{pointer-events:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.25rem;max-width:calc(100% - 2.5rem)}@media(max-width:640px){.db-card-actions{top:.25rem;right:.25rem}}.mt-item-config-popover-host .p-dialog-content{padding:0!important;height:clamp(420px,70vh,720px);max-height:80vh}.mt-item-config-popover-host .p-dialog-header{display:none}@media(max-width:768px){.mt-item-config-popover-host{width:100%!important;max-width:100%!important;margin:0!important;inset:auto 0 0!important;border-radius:1rem 1rem 0 0!important;transform:none!important}.mt-item-config-popover-host .p-dialog-content{height:80vh;border-radius:1rem 1rem 0 0}}.db-context-popover{--p-popover-content-padding: .4rem;min-width:200px}.db-group-card-top-end{width:100%}.db-group-card-tabs{flex:1 1 auto;scrollbar-width:none}.db-group-card-tabs::-webkit-scrollbar{display:none}.db-group-card-tab{min-width:0}\n"] }]
|
|
45615
46043
|
}], ctorParameters: () => [], propDecorators: { isPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPage", required: false }] }], pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], backButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "backButton", required: false }] }], pageId: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageId", required: false }] }], standalone: [{ type: i0.Input, args: [{ isSignal: true, alias: "standalone", required: false }] }], services: [{ type: i0.Input, args: [{ isSignal: true, alias: "services", required: false }] }], dashboardData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardData", required: false }] }, { type: i0.Output, args: ["dashboardDataChange"] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], informativeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "informativeContext", required: false }] }], extraFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "extraFilters", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], statuses: [{ type: i0.Input, args: [{ isSignal: true, alias: "statuses", required: false }] }], levelsSchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelsSchema", required: false }] }], levelLogsResolver: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelLogsResolver", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], chartsChange: [{ type: i0.Output, args: ["chartsChange"] }], onSave: [{ type: i0.Output, args: ["onSave"] }], onBack: [{ type: i0.Output, args: ["onBack"] }], onAddChart: [{ type: i0.Output, args: ["onAddChart"] }], onEditChart: [{ type: i0.Output, args: ["onEditChart"] }], contextMenu: [{ type: i0.ViewChild, args: ['contextMenu', { isSignal: true }] }], gridsterContainer: [{ type: i0.ViewChild, args: ['gridsterContainer', { isSignal: true }] }], onKeyDown: [{
|
|
45616
46044
|
type: HostListener,
|
|
45617
46045
|
args: ['window:keydown', ['$event']]
|
|
@@ -46895,7 +47323,7 @@ class DashboardList {
|
|
|
46895
47323
|
this.dashboards.reload();
|
|
46896
47324
|
}
|
|
46897
47325
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46898
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page [title]=\"pageTitle() || t('dashboards')\">\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <div class=\"flex justify-between items-center gap-4\">\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
47326
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DashboardList, isStandalone: true, selector: "mt-dashboard-list", inputs: { isPage: { classPropertyName: "isPage", publicName: "isPage", isSignal: true, isRequired: false, transformFunction: null }, pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, baseRoute: { classPropertyName: "baseRoute", publicName: "baseRoute", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, showViewButton: { classPropertyName: "showViewButton", publicName: "showViewButton", isSignal: true, isRequired: false, transformFunction: null }, showEditButton: { classPropertyName: "showEditButton", publicName: "showEditButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dashboardAction: "dashboardAction", dashboardCreated: "dashboardCreated" }, viewQueries: [{ propertyName: "nameTpl", first: true, predicate: ["nameTpl"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder.dashboard'\">\r\n <!-- Page mode -->\r\n @if (isPage()) {\r\n <mt-page [title]=\"pageTitle() || t('dashboards')\">\r\n <!-- Header actions -->\r\n <ng-template #headerEnd>\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n size=\"small\"\r\n />\r\n }\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </mt-page>\r\n } @else {\r\n <!-- Non-page mode -->\r\n <div class=\"dashboard-list space-y-3\">\r\n <!-- Header -->\r\n <div class=\"flex justify-between items-center gap-4\">\r\n <h2 class=\"text-2xl font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ t(\"dashboards\") }}\r\n </h2>\r\n\r\n @if (showCreateButton()) {\r\n <mt-button\r\n [label]=\"t('createDashboard')\"\r\n icon=\"general.plus\"\r\n (onClick)=\"openCreateModal()\"\r\n severity=\"primary\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- Content -->\r\n <ng-container *ngTemplateOutlet=\"tableContent\" />\r\n </div>\r\n }\r\n\r\n <!-- Reusable table content template -->\r\n <ng-template #tableContent>\r\n <!-- Custom cell templates -->\r\n <ng-template #nameTpl let-row>\r\n <span class=\"font-semibold text-surface-900 dark:text-surface-0\">\r\n {{ getDashboardName(row) }}\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Dashboard Table -->\r\n <mt-table\r\n [data]=\"dashboardList()\"\r\n [columns]=\"tableColumns()\"\r\n [rowActions]=\"rowActions()\"\r\n [loading]=\"isLoading()\"\r\n [showFilters]=\"true\"\r\n [generalSearch]=\"true\"\r\n dataKey=\"id\"\r\n storageKey=\"dashboard-list-table\"\r\n (cellChange)=\"onToggleChange($event)\"\r\n />\r\n </ng-template>\r\n</ng-container>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Page, selector: "mt-page", inputs: ["backButton", "backButtonIcon", "avatarIcon", "avatarStyle", "avatarShape", "title", "tabs", "activeTab", "contentClass", "contentId"], outputs: ["backButtonClick", "tabChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
46899
47327
|
}
|
|
46900
47328
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, decorators: [{
|
|
46901
47329
|
type: Component,
|
|
@@ -49914,5 +50342,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
49914
50342
|
* Generated bundle index. Do not edit.
|
|
49915
50343
|
*/
|
|
49916
50344
|
|
|
49917
|
-
export {
|
|
49918
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
50345
|
+
export { ComparisonChartHandler as $, EntityPreviewCardComponent as A, ListStatisticCardComponent as B, CardContentComponent as C, DashboardItemStoreService as D, EChartComponent as E, FilterUtilsService as F, SkeletonCardComponent as G, HeaderCardComponent as H, resolveStatisticIconPlacement as I, StatisticCardComponent as J, TopbarCardComponent as K, LastHistoryLevelCardComponent as L, ChartDataService as M, BarChartHandler as N, PieChartHandler as O, PropertiesCardComponent as P, StackBarChartHandler as Q, axisFormatters as R, StaticFiltersComponent as S, TableCardComponent as T, groupDatesByYearAndMonth as U, GaugeChartHandler as V, TableViewHandler as W, OverviewCardHandler as X, TimelineHandler as Y, LineChartHandler as Z, SnapshotHandler as _, DashboardItem as a, GetChartActionsPipe as a$, SplitterChartHandler as a0, LevelCardHandler as a1, MapChartHandler as a2, RingGaugeChartHandler as a3, SPlusChartHandler as a4, PhaseGateStepperHandler as a5, formatCurrency as a6, getCurrencySuffix as a7, formatPercentage as a8, formatNumber as a9, StackBarControlUi as aA, ManageItem as aB, CHART_TYPES as aC, ManageItemService as aD, GeneralSettings as aE, DataSourceSettings as aF, ActionsSettings as aG, ChartViewer as aH, StyleStudioDrawer as aI, StyleSettingsRenderer as aJ, expandResetPatches as aK, StyleField as aL, SegmentedField as aM, ColorListField as aN, ArrayBuilderField as aO, KeyValueMapField as aP, LegendOrderField as aQ, ItemCardMenuComponent as aR, ChartFilterDrawer as aS, ItemContextToolbarComponent as aT, ItemConfigPopoverComponent as aU, GuidedConfigDialogComponent as aV, FilterChipsBarComponent as aW, FilterBuilderComponent as aX, DatasourcePanelComponent as aY, SchemaControlRendererComponent as aZ, FilterByGroupPipe as a_, formatDate as aa, createAxisFormatter as ab, createTooltipFormatter as ac, formatAxisLabel as ad, formatWordsUnderBar as ae, formatXAxis as af, handleFiltersForCustom as ag, handleFilterForCard as ah, handleFilterForSnapshot as ai, DashboardList as aj, MODULE_CLASSIFICATION_LOG as ak, MODULE_CLASSIFICATION_LOG_NAME as al, isLogClassification as am, HTTPMethod as an, DashboardBuilderService as ao, DashboardStoreService as ap, isManagePagesDeleteResult as aq, ManagePages as ar, ManageBreadcrumb as as, ManageFilterOnPage as at, DynamicFiltersConfig as au, ChartSettingsDrawer as av, DisplaySettings as aw, DefaultControlUi as ax, PieControlUi as ay, BarControlUi as az, DashboardDialogHeader as b, ItemGuidanceService as b$, CHART_CAPABILITIES as b0, getCapabilityById as b1, resolveCapability as b2, toBackendChartType as b3, normalizeChartTypeForRequest as b4, normalizeFilterOperation as b5, normalizeAggregateFunction as b6, normalizeFilters as b7, selectorFromLegacy as b8, moduleIdFromSelector as b9, STYLE_PRESETS as bA, presetsForCapability as bB, findPreset as bC, validate as bD, hasBlockingIssues as bE, groupIssuesByDomain as bF, parseAdvancedJson as bG, deepMerge$1 as bH, formatForEditor as bI, readByPath$1 as bJ, setByPath as bK, applyControlPatchToPersisted as bL, applyControlPatchesToPersisted as bM, getControlSchema as bN, listControlSchemaIds as bO, listControlSchemas as bP, getFallbackControlSchema as bQ, flattenSchema as bR, resolveDisplayFields as bS, buildDisplayFieldPredicate as bT, bindingKey as bU, getBinding as bV, listBindings as bW, listBindingsForChart as bX, readBoundValue as bY, ITEM_GUIDANCE_REGISTRY as bZ, describeGuidance as b_, toBackendSourceLink as ba, toFormSourceLink as bb, normalizeOnLoad as bc, normalizeBeforeSave as bd, normalizeBeforeRequest as be, CONFIG_DOMAINS as bf, domainsForCapability as bg, findDomain as bh, POPOVER_TABS as bi, POPOVER_TAB_SPECS as bj, titleToUi as bk, applyTitleToPersisted as bl, datasourceToUi as bm, fieldsToUi as bn, filtersToUi as bo, styleToUi as bp, applyStyleToPersisted as bq, layoutToUi as br, applyLayoutToPersisted as bs, labelLegendFormatToUi as bt, applyLabelLegendFormatToPersisted as bu, behaviorToUi as bv, applyBehaviorToPersisted as bw, applyFilterChipsToPersisted as bx, persistedToUi as by, buildAssembly as bz, cloneDeep$1 as c, DashboardBuilder as d, DashboardViewer as e, switchAllKeysSmall$1 as f, getNestedData as g, dynamicTextReplace as h, dynamicReorder as i, generalConfiguration as j, formatValue as k, getLocalizedTitle as l, sortChartData as m, addCommasToNumber as n, sortDataTableView as o, isMobilePlatform$1 as p, getColorFromConditions as q, resolveDashboardDialogHeader as r, switchAllKeysToLower as s, CardFilterComponent as t, DynamicFiltersComponent as u, CardInfoComponent as v, ChartCardComponent as w, resolveEntityUserPhoto as x, EntityInfoComponent as y, normalizeDashboardCardEntityValue as z };
|
|
50346
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-B_mWi5v-.mjs.map
|