@masterteam/dashboard-builder 0.0.67 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/i18n/ar.json +7 -1
- package/assets/i18n/en.json +7 -1
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-CvDixqmc.mjs → masterteam-dashboard-builder-dashboard-dialog.component-4s23U4uK.mjs} +2 -2
- package/fesm2022/{masterteam-dashboard-builder-dashboard-dialog.component-CvDixqmc.mjs.map → masterteam-dashboard-builder-dashboard-dialog.component-4s23U4uK.mjs.map} +1 -1
- package/fesm2022/{masterteam-dashboard-builder-masterteam-dashboard-builder-AOC8TnU0.mjs → masterteam-dashboard-builder-masterteam-dashboard-builder-Dz2al1ZI.mjs} +420 -101
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-Dz2al1ZI.mjs.map +1 -0
- package/fesm2022/masterteam-dashboard-builder.mjs +1 -1
- package/package.json +4 -4
- package/types/masterteam-dashboard-builder.d.ts +84 -17
- package/fesm2022/masterteam-dashboard-builder-masterteam-dashboard-builder-AOC8TnU0.mjs.map +0 -1
|
@@ -4,6 +4,7 @@ import * as i1$1 from '@angular/common';
|
|
|
4
4
|
import { CommonModule, DatePipe, isPlatformBrowser, DecimalPipe } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR, FormBuilder, Validators, ReactiveFormsModule, NG_VALIDATORS, FormRecord, FormControl, FormGroup } from '@angular/forms';
|
|
7
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
7
8
|
import { TranslocoService, TranslocoDirective } from '@jsverse/transloco';
|
|
8
9
|
import * as i2$3 from 'angular-gridster2';
|
|
9
10
|
import { DirTypes, GridsterModule } from 'angular-gridster2';
|
|
@@ -17,7 +18,6 @@ import { Subject, map, of, forkJoin, throwError, Observable, ReplaySubject, EMPT
|
|
|
17
18
|
import { HttpClient, HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
18
19
|
import { catchError, tap, shareReplay, share, mergeMap, takeUntil, retry, finalize, filter, map as map$1, distinctUntilChanged, switchMap, debounceTime as debounceTime$1 } from 'rxjs/operators';
|
|
19
20
|
import { REQUEST_CONTEXT } from '@masterteam/components';
|
|
20
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
21
21
|
import { TextField } from '@masterteam/components/text-field';
|
|
22
22
|
import { CheckboxField } from '@masterteam/components/checkbox-field';
|
|
23
23
|
import { ModalRef } from '@masterteam/components/dialog';
|
|
@@ -2325,7 +2325,9 @@ const CHART_CAPABILITIES = [
|
|
|
2325
2325
|
id: 'chart-map-chart',
|
|
2326
2326
|
name: 'Map Chart',
|
|
2327
2327
|
icon: 'map.globe-01',
|
|
2328
|
-
|
|
2328
|
+
// Grouped under Charts, not Tables: `category` only drives the palette tab
|
|
2329
|
+
// and a map is not something a user looks for under "Tables" (issue #1248).
|
|
2330
|
+
category: 'chart',
|
|
2329
2331
|
products: ['pplus', 'splus'],
|
|
2330
2332
|
hasManageItem: true,
|
|
2331
2333
|
defaultSize: { cols: 18, rows: 8 },
|
|
@@ -3527,6 +3529,44 @@ function normalizeBeforeRequest(serviceConfig) {
|
|
|
3527
3529
|
return next;
|
|
3528
3530
|
}
|
|
3529
3531
|
|
|
3532
|
+
/**
|
|
3533
|
+
* A boolean's two values are not modelled by the property-items API, so they
|
|
3534
|
+
* are synthesized locally instead of requesting them (issue #1237).
|
|
3535
|
+
*/
|
|
3536
|
+
const CHECKBOX_VIEW_TYPES = new Set(['checkbox', 'boolean', 'bool']);
|
|
3537
|
+
/**
|
|
3538
|
+
* View types that definitively have no fixed value list. Requesting
|
|
3539
|
+
* `property-items/{key}` for one can only fail, so we skip the call.
|
|
3540
|
+
*
|
|
3541
|
+
* Deliberately a DENY-list: any view type not named here still goes to the API
|
|
3542
|
+
* exactly as before, so an unfamiliar (or newly added) list-bearing type keeps
|
|
3543
|
+
* working rather than silently losing its Values tab.
|
|
3544
|
+
*/
|
|
3545
|
+
const NO_VALUE_LIST_VIEW_TYPES = new Set([
|
|
3546
|
+
'text',
|
|
3547
|
+
'longtext',
|
|
3548
|
+
'title',
|
|
3549
|
+
'number',
|
|
3550
|
+
'float',
|
|
3551
|
+
'decimal',
|
|
3552
|
+
'currency',
|
|
3553
|
+
'percentage',
|
|
3554
|
+
'date',
|
|
3555
|
+
'datetime',
|
|
3556
|
+
'time',
|
|
3557
|
+
'user',
|
|
3558
|
+
'multiuser',
|
|
3559
|
+
'attachment',
|
|
3560
|
+
'location',
|
|
3561
|
+
'formula',
|
|
3562
|
+
'calculated',
|
|
3563
|
+
]);
|
|
3564
|
+
/** Normalize a catalog viewType for comparison ("Request_Status" → "request_status"). */
|
|
3565
|
+
function normalizeViewType(value) {
|
|
3566
|
+
return String(value ?? '')
|
|
3567
|
+
.trim()
|
|
3568
|
+
.toLowerCase();
|
|
3569
|
+
}
|
|
3530
3570
|
/**
|
|
3531
3571
|
* Filter Value Field Component
|
|
3532
3572
|
*
|
|
@@ -3535,6 +3575,7 @@ function normalizeBeforeRequest(serviceConfig) {
|
|
|
3535
3575
|
*/
|
|
3536
3576
|
class FilterValueField {
|
|
3537
3577
|
dashboardService = inject(DashboardBuilderService);
|
|
3578
|
+
transloco = inject(TranslocoService);
|
|
3538
3579
|
popover;
|
|
3539
3580
|
/** Label for the field */
|
|
3540
3581
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -3674,11 +3715,14 @@ class FilterValueField {
|
|
|
3674
3715
|
}
|
|
3675
3716
|
});
|
|
3676
3717
|
});
|
|
3677
|
-
//
|
|
3678
|
-
//
|
|
3679
|
-
//
|
|
3718
|
+
// Resolve the targeted property's selectable values into the "Values" tab.
|
|
3719
|
+
// Lazy + cached per key; properties with no fixed value list yield no tab.
|
|
3720
|
+
// Reads `propertyOptions()` so the view type is re-evaluated once module
|
|
3721
|
+
// metadata arrives (it is usually empty on the first pass).
|
|
3680
3722
|
effect(() => {
|
|
3681
3723
|
const key = this.propertyKey();
|
|
3724
|
+
this.propertyOptions();
|
|
3725
|
+
this.extraProperties();
|
|
3682
3726
|
if (key)
|
|
3683
3727
|
untracked(() => this.loadPropertyValues(key));
|
|
3684
3728
|
});
|
|
@@ -3722,10 +3766,44 @@ class FilterValueField {
|
|
|
3722
3766
|
buildExtraValuePath(propertyKey) {
|
|
3723
3767
|
return `extraValues.${propertyKey.charAt(0).toLowerCase()}${propertyKey.slice(1)}.rawValue`;
|
|
3724
3768
|
}
|
|
3725
|
-
/**
|
|
3769
|
+
/**
|
|
3770
|
+
* Where a property's selectable values come from (issue #1237).
|
|
3771
|
+
*
|
|
3772
|
+
* - `checkbox` — a boolean has exactly two values and the backend does not
|
|
3773
|
+
* model them, so the list is synthesized locally. Asking
|
|
3774
|
+
* `property-items/{key}` for a Checkbox is what surfaced an error in the
|
|
3775
|
+
* picker.
|
|
3776
|
+
* - `none` — text, number, date, user, …: no fixed value list exists,
|
|
3777
|
+
* so no request is made at all (it could only ever fail).
|
|
3778
|
+
* - `remote` — everything else (lookup / status / phase-gate, and any view
|
|
3779
|
+
* type we do not recognise): fetch from the API, exactly as before.
|
|
3780
|
+
*/
|
|
3781
|
+
resolvePropertyValueSource(propertyKey) {
|
|
3782
|
+
const viewType = normalizeViewType(this.findPropertyReference(propertyKey)?.viewType);
|
|
3783
|
+
if (!viewType)
|
|
3784
|
+
return 'remote';
|
|
3785
|
+
if (CHECKBOX_VIEW_TYPES.has(viewType))
|
|
3786
|
+
return 'checkbox';
|
|
3787
|
+
return NO_VALUE_LIST_VIEW_TYPES.has(viewType) ? 'none' : 'remote';
|
|
3788
|
+
}
|
|
3789
|
+
/** Lazily resolve a property's value list into the "Values" tab. */
|
|
3726
3790
|
loadPropertyValues(propertyKey) {
|
|
3727
3791
|
if (this.fetchedValueKeys.has(propertyKey))
|
|
3728
3792
|
return;
|
|
3793
|
+
const source = this.resolvePropertyValueSource(propertyKey);
|
|
3794
|
+
if (source === 'none') {
|
|
3795
|
+
this.fetchedValueKeys.add(propertyKey);
|
|
3796
|
+
this.setPropertyValueOptions([]);
|
|
3797
|
+
return;
|
|
3798
|
+
}
|
|
3799
|
+
if (source === 'checkbox') {
|
|
3800
|
+
this.fetchedValueKeys.add(propertyKey);
|
|
3801
|
+
this.setPropertyValueOptions([
|
|
3802
|
+
{ label: this.translateOrFallback('yes', 'Yes'), value: 'true' },
|
|
3803
|
+
{ label: this.translateOrFallback('no', 'No'), value: 'false' },
|
|
3804
|
+
]);
|
|
3805
|
+
return;
|
|
3806
|
+
}
|
|
3729
3807
|
this.fetchedValueKeys.add(propertyKey);
|
|
3730
3808
|
this.valuesLoading.set(true);
|
|
3731
3809
|
this.dashboardService.getPropertyItems(propertyKey).subscribe({
|
|
@@ -3749,6 +3827,18 @@ class FilterValueField {
|
|
|
3749
3827
|
},
|
|
3750
3828
|
});
|
|
3751
3829
|
}
|
|
3830
|
+
/** Publish the Values-tab options and re-derive which tabs are visible. */
|
|
3831
|
+
setPropertyValueOptions(values) {
|
|
3832
|
+
this.quickOptions.update((opts) => ({ ...opts, values }));
|
|
3833
|
+
this.valuesLoading.set(false);
|
|
3834
|
+
this.updateVisibleTabs();
|
|
3835
|
+
}
|
|
3836
|
+
/** Translate a `dashboardBuilder.*` key, falling back when it is missing. */
|
|
3837
|
+
translateOrFallback(key, fallback) {
|
|
3838
|
+
const path = `dashboardBuilder.${key}`;
|
|
3839
|
+
const translated = this.transloco.translate(path);
|
|
3840
|
+
return !translated || translated === path ? fallback : translated;
|
|
3841
|
+
}
|
|
3752
3842
|
updateVisibleTabs() {
|
|
3753
3843
|
const opts = this.quickOptions();
|
|
3754
3844
|
// "Values" leads when present — picking a concrete value is the primary
|
|
@@ -6097,6 +6187,18 @@ const CARD_STYLE_SECTION = {
|
|
|
6097
6187
|
},
|
|
6098
6188
|
],
|
|
6099
6189
|
};
|
|
6190
|
+
/**
|
|
6191
|
+
* Charts that own a purpose-built color control and therefore drop the generic
|
|
6192
|
+
* positional Palette (an opaque index-ordered swatch list):
|
|
6193
|
+
* - plain bar: BAR_COLORS_SECTION — one base color + per-bar overrides.
|
|
6194
|
+
* - stacked / cluster-stacked bar: LEGEND_SECTION — every stack IS a legend
|
|
6195
|
+
* entry, so "Legend order" already colors them by name.
|
|
6196
|
+
*/
|
|
6197
|
+
const CHARTS_WITHOUT_PALETTE = new Set([
|
|
6198
|
+
'chart-bar-chart',
|
|
6199
|
+
'chart-stacked-bar-chart',
|
|
6200
|
+
'chart-stacked-bar-cluster-chart',
|
|
6201
|
+
]);
|
|
6100
6202
|
const PALETTE_SECTION = {
|
|
6101
6203
|
key: 'palette',
|
|
6102
6204
|
label: 'Palette',
|
|
@@ -6105,7 +6207,7 @@ const PALETTE_SECTION = {
|
|
|
6105
6207
|
scope: 'simple',
|
|
6106
6208
|
// Series colors only apply to series charts (bar/pie/line/gauge/…), not
|
|
6107
6209
|
// tables / timeline / map (category 'table') or cards.
|
|
6108
|
-
visibleWhen: (_cfg, cap) => cap?.category === 'chart',
|
|
6210
|
+
visibleWhen: (_cfg, cap) => cap?.category === 'chart' && !CHARTS_WITHOUT_PALETTE.has(cap?.id ?? ''),
|
|
6109
6211
|
fields: [
|
|
6110
6212
|
{
|
|
6111
6213
|
key: 'palette',
|
|
@@ -6116,6 +6218,58 @@ const PALETTE_SECTION = {
|
|
|
6116
6218
|
},
|
|
6117
6219
|
],
|
|
6118
6220
|
};
|
|
6221
|
+
/**
|
|
6222
|
+
* Bar colors — the plain bar chart's replacement for Palette.
|
|
6223
|
+
*
|
|
6224
|
+
* A plain bar chart is a SINGLE series whose data points are the categories, so
|
|
6225
|
+
* "series colors" never described it. It has no legend either (LEGEND_SECTION is
|
|
6226
|
+
* hidden for it), which is why it needs its own color surface.
|
|
6227
|
+
*
|
|
6228
|
+
* The two controls:
|
|
6229
|
+
* - base color -> configAsType.barBaseColor, a dedicated key. NOT
|
|
6230
|
+
* defaultColors[0]: that array is read positionally (defaultColors[index]),
|
|
6231
|
+
* so index 0 only recolors the FIRST bar as soon as the response carries
|
|
6232
|
+
* per-bar colors — which is the normal case for status-grouped bars.
|
|
6233
|
+
* - per-bar -> configAsType.legend.colorOverrides, which the echart
|
|
6234
|
+
* component already applies per data point by name
|
|
6235
|
+
* (applyLegendColorOverrides), so it needed no renderer change.
|
|
6236
|
+
* Runtime precedence: per-bar override > color-by-condition > base color >
|
|
6237
|
+
* status/lookup color from the data > defaultColors[index] (legacy palette) >
|
|
6238
|
+
* the bar's own color > its barType color.
|
|
6239
|
+
*/
|
|
6240
|
+
const BAR_COLORS_SECTION = {
|
|
6241
|
+
key: 'bar-colors',
|
|
6242
|
+
label: 'Bar colors',
|
|
6243
|
+
icon: 'editor.palette',
|
|
6244
|
+
domain: 'style',
|
|
6245
|
+
scope: 'simple',
|
|
6246
|
+
visibleWhen: (_cfg, cap) => cap?.id === 'chart-bar-chart',
|
|
6247
|
+
fields: [
|
|
6248
|
+
{
|
|
6249
|
+
key: 'barBaseColor',
|
|
6250
|
+
label: 'Bar color',
|
|
6251
|
+
type: 'color',
|
|
6252
|
+
// Its own key on purpose. `defaultColors` is read POSITIONALLY by the bar
|
|
6253
|
+
// handler (`defaultColors[index]`), so binding this to index 0 made it
|
|
6254
|
+
// recolor only the FIRST bar whenever the response carried per-bar colors
|
|
6255
|
+
// — which is the normal case for status-grouped bars.
|
|
6256
|
+
path: 'clientConfig.configAsType.barBaseColor',
|
|
6257
|
+
// Deliberately no `default`: the bars of an unconfigured chart render the
|
|
6258
|
+
// colors the backend sent, so showing a swatch here would claim a color
|
|
6259
|
+
// nothing on the chart uses.
|
|
6260
|
+
description: 'Overrides every bar. Leave empty to keep each bar’s color.',
|
|
6261
|
+
},
|
|
6262
|
+
{
|
|
6263
|
+
key: 'barColorOverrides',
|
|
6264
|
+
label: 'Color by bar',
|
|
6265
|
+
type: 'entryColors',
|
|
6266
|
+
// Reset-section clears the whole override map, which is the right scope
|
|
6267
|
+
// for this control (StyleField writes it through onLegendColorChange).
|
|
6268
|
+
path: 'clientConfig.configAsType.legend.colorOverrides',
|
|
6269
|
+
description: 'Give an individual bar its own color.',
|
|
6270
|
+
},
|
|
6271
|
+
],
|
|
6272
|
+
};
|
|
6119
6273
|
const LEGEND_SECTION = {
|
|
6120
6274
|
key: 'legend',
|
|
6121
6275
|
label: 'Legend',
|
|
@@ -6154,11 +6308,14 @@ const LEGEND_SECTION = {
|
|
|
6154
6308
|
},
|
|
6155
6309
|
{
|
|
6156
6310
|
key: 'legend.order',
|
|
6157
|
-
label: 'Legend order',
|
|
6311
|
+
label: 'Legend order & colors',
|
|
6158
6312
|
type: 'legendOrder',
|
|
6159
6313
|
path: 'clientConfig.configAsType.legend.overrideLegendOrder',
|
|
6160
6314
|
description: 'Reorder legend entries and override each entry color.',
|
|
6161
|
-
scope:
|
|
6315
|
+
// Simple scope on purpose: for stacked / cluster-stacked bars every stack
|
|
6316
|
+
// IS a legend entry, so since those charts dropped Palette this control is
|
|
6317
|
+
// their only color surface and must not hide behind Advanced.
|
|
6318
|
+
scope: 'simple',
|
|
6162
6319
|
visibleWhen: (cfg) => cfg.clientConfig?.configAsType?.legend?.show !== false,
|
|
6163
6320
|
},
|
|
6164
6321
|
],
|
|
@@ -7930,6 +8087,7 @@ const SCHEMA_DEFS = [
|
|
|
7930
8087
|
name: 'Bar Chart',
|
|
7931
8088
|
sections: [
|
|
7932
8089
|
...COMMON_CHART_BASE,
|
|
8090
|
+
BAR_COLORS_SECTION,
|
|
7933
8091
|
BAR_CHART_SECTION,
|
|
7934
8092
|
BAR_AXES_SECTION,
|
|
7935
8093
|
BAR_GRID_TOOLTIP_SECTION,
|
|
@@ -8677,6 +8835,16 @@ const COMMON_CHART_IDS = [
|
|
|
8677
8835
|
'phase-gate-stepper-card',
|
|
8678
8836
|
];
|
|
8679
8837
|
const LAYOUT_CHART_IDS = ['header', 'topbar'];
|
|
8838
|
+
/**
|
|
8839
|
+
* Charts whose schema hides the generic Palette section because they ship a
|
|
8840
|
+
* purpose-built color control instead. Mirrors `CHARTS_WITHOUT_PALETTE` in
|
|
8841
|
+
* control-schema.registry.ts — keep the two in sync.
|
|
8842
|
+
*/
|
|
8843
|
+
const CHART_IDS_WITHOUT_PALETTE = new Set([
|
|
8844
|
+
'chart-bar-chart',
|
|
8845
|
+
'chart-stacked-bar-chart',
|
|
8846
|
+
'chart-stacked-bar-cluster-chart',
|
|
8847
|
+
]);
|
|
8680
8848
|
function commonChartBindings(chartId) {
|
|
8681
8849
|
return [
|
|
8682
8850
|
// -- Title --
|
|
@@ -9115,6 +9283,40 @@ function commonLabelLegendFormatBindings(chartId) {
|
|
|
9115
9283
|
* differ from the common ones. Generic format bindings still apply on top.
|
|
9116
9284
|
* ========================================================================== */
|
|
9117
9285
|
const BAR_CHART_BINDINGS = [
|
|
9286
|
+
// -- Bar colors (replaces the generic Palette for this chart) --------------
|
|
9287
|
+
{
|
|
9288
|
+
chartId: 'chart-bar-chart',
|
|
9289
|
+
controlId: 'barBaseColor',
|
|
9290
|
+
domain: 'style',
|
|
9291
|
+
label: 'Bar color',
|
|
9292
|
+
uiPath: 'style.barBaseColor',
|
|
9293
|
+
persistedPath: 'clientConfig.configAsType.barBaseColor',
|
|
9294
|
+
runtimePath: 'clientConfig.configAsType.barBaseColor',
|
|
9295
|
+
rendererReadPaths: [
|
|
9296
|
+
'clientConfig.configAsType.barBaseColor',
|
|
9297
|
+
'clientConfig.configAsType.defaultColors',
|
|
9298
|
+
],
|
|
9299
|
+
simpleOrAdvanced: 'simple',
|
|
9300
|
+
notes: [
|
|
9301
|
+
'A plain bar chart is one unnamed series whose points are the categories, so "series colors" never described it. Palette is hidden here (CHARTS_WITHOUT_PALETTE) in favor of this + per-bar overrides.',
|
|
9302
|
+
'Dedicated key, NOT defaultColors[0]: the handler reads defaultColors POSITIONALLY (defaultColors[index]), so binding the all-bars control to index 0 only recolored the first bar whenever the response carried per-bar colors.',
|
|
9303
|
+
'The handler also prefers barBaseColor in its defaultColor fallback, so legacy defaultColors[0] configs keep working when barBaseColor is unset.',
|
|
9304
|
+
],
|
|
9305
|
+
},
|
|
9306
|
+
{
|
|
9307
|
+
chartId: 'chart-bar-chart',
|
|
9308
|
+
controlId: 'barColorOverrides',
|
|
9309
|
+
domain: 'style',
|
|
9310
|
+
label: 'Color by bar',
|
|
9311
|
+
uiPath: 'style.barColorOverrides',
|
|
9312
|
+
persistedPath: 'clientConfig.configAsType.legend.colorOverrides',
|
|
9313
|
+
runtimePath: 'clientConfig.configAsType.legend.colorOverrides',
|
|
9314
|
+
rendererReadPaths: ['clientConfig.configAsType.legend.colorOverrides'],
|
|
9315
|
+
simpleOrAdvanced: 'simple',
|
|
9316
|
+
notes: [
|
|
9317
|
+
'Same map the Legend order control writes for other charts; echart.applyLegendColorOverrides already matched it per data point, so no renderer change was needed — only the authoring surface (entryColors) and live-entry extraction for unnamed bar series.',
|
|
9318
|
+
],
|
|
9319
|
+
},
|
|
9118
9320
|
{
|
|
9119
9321
|
chartId: 'chart-bar-chart',
|
|
9120
9322
|
controlId: 'orientation',
|
|
@@ -9236,6 +9438,9 @@ const BAR_CHART_BINDINGS = [
|
|
|
9236
9438
|
},
|
|
9237
9439
|
];
|
|
9238
9440
|
const STACK_BAR_BINDINGS = [
|
|
9441
|
+
// Stacked bars have no Palette binding on purpose: every stack IS a legend
|
|
9442
|
+
// entry, so the common `legend.order` control (Legend order & colors, promoted
|
|
9443
|
+
// to Simple scope) is their color surface. See CHARTS_WITHOUT_PALETTE.
|
|
9239
9444
|
{
|
|
9240
9445
|
chartId: 'chart-stacked-bar-chart',
|
|
9241
9446
|
controlId: 'orientation',
|
|
@@ -9963,7 +10168,11 @@ const TOPBAR_WIDGET_BINDINGS = [
|
|
|
9963
10168
|
* ========================================================================== */
|
|
9964
10169
|
const ALL_BINDINGS = [
|
|
9965
10170
|
// Common per chart (title/style/header/behavior shared per chart capability).
|
|
9966
|
-
|
|
10171
|
+
// Bar / stacked bars drop the generic `palette` binding: the schema hides
|
|
10172
|
+
// Palette for them (CHARTS_WITHOUT_PALETTE) in favor of BAR_COLORS_SECTION
|
|
10173
|
+
// (plain bar) and the legend color control (stacked), so keeping the binding
|
|
10174
|
+
// would document a control those charts no longer render.
|
|
10175
|
+
...COMMON_CHART_IDS.flatMap((id) => commonChartBindings(id).filter((b) => b.controlId !== 'palette' || !CHART_IDS_WITHOUT_PALETTE.has(id))),
|
|
9967
10176
|
// Label/legend/format apply to data charts. The two layout widgets (header,
|
|
9968
10177
|
// topbar) live in LAYOUT_CHART_IDS and never get these bindings.
|
|
9969
10178
|
...COMMON_CHART_IDS.flatMap((id) => commonLabelLegendFormatBindings(id)),
|
|
@@ -13357,7 +13566,12 @@ class BarChartHandler {
|
|
|
13357
13566
|
? false
|
|
13358
13567
|
: !!configAsType?.['isHorizontal'];
|
|
13359
13568
|
const isPercentage = configAsType?.['isPercentage'];
|
|
13360
|
-
|
|
13569
|
+
// The Style Studio "Bar color" control — one explicit color for EVERY bar.
|
|
13570
|
+
// It needs its own key rather than defaultColors[0], because that array is
|
|
13571
|
+
// read positionally (defaultColors[index]) and so index 0 only ever recolors
|
|
13572
|
+
// the first bar whenever the response carries per-bar colors of its own.
|
|
13573
|
+
const barBaseColor = configAsType?.['barBaseColor'] || undefined;
|
|
13574
|
+
const defaultColor = barBaseColor || configAsType?.['defaultColors']?.[0] || '#4caf50';
|
|
13361
13575
|
const overrideLabels = configAsType?.['overrideLabels'];
|
|
13362
13576
|
// Process categories and labels
|
|
13363
13577
|
let barTypes = dataResponse.barTypes || [];
|
|
@@ -13422,7 +13636,14 @@ class BarChartHandler {
|
|
|
13422
13636
|
return {
|
|
13423
13637
|
value: bar.value,
|
|
13424
13638
|
itemStyle: {
|
|
13639
|
+
// Precedence, most specific first: a per-value condition rule, then
|
|
13640
|
+
// the explicit all-bars base color, then everything the DATA supplies
|
|
13641
|
+
// (status/lookup color, legacy positional palette, the bar's own
|
|
13642
|
+
// color, its barType color). A per-bar override set in the Style
|
|
13643
|
+
// Studio is layered on later by echart.applyLegendColorOverrides and
|
|
13644
|
+
// therefore still wins over all of these.
|
|
13425
13645
|
color: colorByCondition ||
|
|
13646
|
+
barBaseColor ||
|
|
13426
13647
|
colorBarByStatus ||
|
|
13427
13648
|
configAsType?.['defaultColors']?.[index] ||
|
|
13428
13649
|
bar.color ||
|
|
@@ -13589,6 +13810,12 @@ class BarChartHandler {
|
|
|
13589
13810
|
data: grayBarData,
|
|
13590
13811
|
barWidth: '45px',
|
|
13591
13812
|
stack: 'total',
|
|
13813
|
+
// Same marker the pie handler puts on its "Remaining" slice: this is the
|
|
13814
|
+
// grey remainder track, not user data. It keeps the Bar-colors control
|
|
13815
|
+
// from tinting the remainder (its points reuse the real bars' `key`, so
|
|
13816
|
+
// a per-bar override would otherwise match here too) and keeps it out of
|
|
13817
|
+
// the colorable-entry list.
|
|
13818
|
+
isStaticProperty: true,
|
|
13592
13819
|
tooltip: { show: false },
|
|
13593
13820
|
label: {
|
|
13594
13821
|
show: false,
|
|
@@ -14118,6 +14345,24 @@ function extractLegendOrderItems(data) {
|
|
|
14118
14345
|
Array.isArray(seriesItem?.data)) {
|
|
14119
14346
|
seriesItem.data.forEach((item) => add(item?.name || item?.label || item?.display || item?.key, item, item?.key));
|
|
14120
14347
|
}
|
|
14348
|
+
// A plain bar chart is ONE unnamed series whose data points are the
|
|
14349
|
+
// categories — the same shape pie/gauge have, so its colorable entries are
|
|
14350
|
+
// the points, not the series. Multi-series bars (grouped / stacked /
|
|
14351
|
+
// comparison) always name their series and are handled above.
|
|
14352
|
+
// Only an explicit identity counts here: the percentage remainder overlay
|
|
14353
|
+
// carries a numeric `value` that legendDataName would happily stringify
|
|
14354
|
+
// into a bogus entry.
|
|
14355
|
+
if (!seriesItem?.name &&
|
|
14356
|
+
seriesItem?.type === 'bar' &&
|
|
14357
|
+
!seriesItem?.isStaticProperty &&
|
|
14358
|
+
!seriesItem?.isTotal &&
|
|
14359
|
+
Array.isArray(seriesItem?.data)) {
|
|
14360
|
+
seriesItem.data.forEach((item) => {
|
|
14361
|
+
const identity = item?.name || item?.label || item?.display;
|
|
14362
|
+
if (identity)
|
|
14363
|
+
add(identity, item, item?.key);
|
|
14364
|
+
});
|
|
14365
|
+
}
|
|
14121
14366
|
});
|
|
14122
14367
|
return dedupeLegendOrderItems(out);
|
|
14123
14368
|
}
|
|
@@ -22209,7 +22454,7 @@ class ActionService {
|
|
|
22209
22454
|
dialogConfig?.clientConfig?.title?.['ar'] ||
|
|
22210
22455
|
'';
|
|
22211
22456
|
// Dynamically import DashboardDialogComponent to avoid circular dependency
|
|
22212
|
-
import('./masterteam-dashboard-builder-dashboard-dialog.component-
|
|
22457
|
+
import('./masterteam-dashboard-builder-dashboard-dialog.component-4s23U4uK.mjs').then(({ DashboardDialogComponent }) => {
|
|
22213
22458
|
// Open dialog using ModalService
|
|
22214
22459
|
this.modalService.openModal(DashboardDialogComponent, 'dialog', {
|
|
22215
22460
|
header: title,
|
|
@@ -27289,6 +27534,12 @@ class TableCardComponent {
|
|
|
27289
27534
|
labels = signal([], ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
27290
27535
|
/** Table legends are visible by default for backward compatibility. */
|
|
27291
27536
|
showLegend = computed(() => this.configurationItem()?.clientConfig?.configAsType?.['legend']?.['show'] !== false, ...(ngDevMode ? [{ debugName: "showLegend" }] : /* istanbul ignore next */ []));
|
|
27537
|
+
/**
|
|
27538
|
+
* Whether there is a legend to render at all. Shared by both hosts (the card
|
|
27539
|
+
* header's top-end slot and, when the header is hidden, the card body) so the
|
|
27540
|
+
* two never disagree about visibility.
|
|
27541
|
+
*/
|
|
27542
|
+
hasLegend = computed(() => this.showLegend() && this.labels().length > 0, ...(ngDevMode ? [{ debugName: "hasLegend" }] : /* istanbul ignore next */ []));
|
|
27292
27543
|
/** Processed table rows */
|
|
27293
27544
|
tableRows = signal([], ...(ngDevMode ? [{ debugName: "tableRows" }] : /* istanbul ignore next */ []));
|
|
27294
27545
|
/** Grouped data */
|
|
@@ -28438,7 +28689,7 @@ class TableCardComponent {
|
|
|
28438
28689
|
this.onAction.emit({ type: 'clickOnHeader', data: {} });
|
|
28439
28690
|
}
|
|
28440
28691
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28441
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardComponent, isStandalone: true, selector: "mt-table-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (showLegend() && labels()?.length) {\r\n <div class=\"flex items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
28692
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableCardComponent, isStandalone: true, selector: "mt-table-card", inputs: { dashboardId: { classPropertyName: "dashboardId", publicName: "dashboardId", isSignal: true, isRequired: true, transformFunction: null }, inGroup: { classPropertyName: "inGroup", publicName: "inGroup", isSignal: true, isRequired: false, transformFunction: null }, hideHeader: { classPropertyName: "hideHeader", publicName: "hideHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<!--\r\n One legend definition, two possible hosts. `mt-card-content` only projects\r\n [topEnd] inside its header block, so when the header is hidden (dialog view)\r\n the legend has to be rendered in the body instead or it is dropped entirely.\r\n-->\r\n<ng-template #legendList>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (hasLegend() && !hideHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\r\n so the legend is rendered above the table instead. -->\r\n @if (hasLegend() && hideHeader()) {\r\n <div class=\"mb-2 flex shrink-0 justify-end\">\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: CardContentComponent, selector: "mt-card-content", inputs: ["title", "inGroup", "groupHeader", "headerConfig", "styleConfig", "cardStyleConfig", "density", "padding", "showHeader", "headerClickable", "isNoTopEnd", "isChart", "titleEditable"], outputs: ["headerClick", "titleChange"] }, { kind: "component", type: EntityInfoComponent, selector: "mt-entity-info", inputs: ["data", "displayType", "extraInfoData", "limitWords", "customClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
28442
28693
|
}
|
|
28443
28694
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableCardComponent, decorators: [{
|
|
28444
28695
|
type: Component,
|
|
@@ -28447,7 +28698,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
28447
28698
|
TranslocoDirective,
|
|
28448
28699
|
CardContentComponent,
|
|
28449
28700
|
EntityInfoComponent,
|
|
28450
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (showLegend() && labels()?.length) {\r\n <div class=\"flex items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"] }]
|
|
28701
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\r\n One legend definition, two possible hosts. `mt-card-content` only projects\r\n [topEnd] inside its header block, so when the header is hidden (dialog view)\r\n the legend has to be rendered in the body instead or it is dropped entirely.\r\n-->\r\n<ng-template #legendList>\r\n <div class=\"flex flex-wrap items-center gap-2\">\r\n @for (label of labels(); track label.key || $index) {\r\n <div class=\"flex items-center gap-1 text-xs\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full\"\r\n [style.backgroundColor]=\"getLegendColor(label)\"\r\n ></span>\r\n <span>{{ getLegendText(label) }}</span>\r\n </div>\r\n }\r\n </div>\r\n</ng-template>\r\n\r\n<mt-card-content\r\n [inGroup]=\"inGroup()\"\r\n [showHeader]=\"!hideHeader()\"\r\n [title]=\"title()\"\r\n [styleConfig]=\"\r\n configurationItem()?.clientConfig?.displayConfig?.['StyleConfig']\r\n \"\r\n [cardStyleConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['cardStyleConfig']\r\n \"\r\n [headerConfig]=\"\r\n configurationItem()?.clientConfig?.configAsType?.['headerCardConfig']\r\n \"\r\n [padding]=\"configurationItem()?.clientConfig?.configAsType?.['padding']\"\r\n (headerClick)=\"onHeaderClick()\"\r\n>\r\n <!-- Status Labels -->\r\n <ng-container topEnd>\r\n @if (hasLegend() && !hideHeader()) {\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n }\r\n </ng-container>\r\n\r\n <ng-container body>\r\n <div\r\n class=\"table-wrapper h-full\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n >\r\n <!-- Headerless (dialog) view: the header's top-end slot does not exist,\r\n so the legend is rendered above the table instead. -->\r\n @if (hasLegend() && hideHeader()) {\r\n <div class=\"mb-2 flex shrink-0 justify-end\">\r\n <ng-container [ngTemplateOutlet]=\"legendList\" />\r\n </div>\r\n }\r\n\r\n @if (loading()) {\r\n <div class=\"flex items-center justify-center h-32\">\r\n <i class=\"pi pi-spin pi-spinner text-2xl\"></i>\r\n </div>\r\n } @else if (hasData()) {\r\n <div\r\n class=\"table-scroll-container overflow-auto h-full\"\r\n (scroll)=\"onTableScroll($event)\"\r\n >\r\n <table class=\"w-full border-collapse text-sm\">\r\n <thead class=\"sticky top-0 z-10\" [hidden]=\"hideSubheader()\">\r\n <tr>\r\n <!-- Index column -->\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n >\r\n #\r\n </th>\r\n }\r\n\r\n <!-- Data columns -->\r\n @for (column of visibleColumns(); track column.key) {\r\n <th\r\n class=\"px-3 py-2 text-left font-semibold bg-surface-100 border-b-2 border-surface-200 whitespace-nowrap\"\r\n [style.minWidth]=\"column.width || 'auto'\"\r\n [style.color]=\"tableStyleConfig()?.thTextColor\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.thBackgroundColor\r\n \"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.thFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.thFontSize\"\r\n [class.cursor-pointer]=\"!isPhaseGateColumn(column)\"\r\n (click)=\"onSort(column)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span>{{ column.label }}</span>\r\n @if (column.isSort) {\r\n <i\r\n class=\"text-xs\"\r\n [class]=\"\r\n column.isAsc\r\n ? 'pi pi-sort-amount-up'\r\n : 'pi pi-sort-amount-down'\r\n \"\r\n ></i>\r\n }\r\n </div>\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <!-- Grouped Mode -->\r\n @if (isGrouped()) {\r\n @if (groupedVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (item of visibleGroupedRows(); track item.trackId) {\r\n @if (item.kind === \"group\") {\r\n <tr class=\"dashboard-table-row\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n class=\"px-3 py-2 font-semibold\"\r\n [style.backgroundColor]=\"\r\n tableStyleConfig()?.groupBackgroundColor || '#e4d1ac'\r\n \"\r\n [style.color]=\"tableStyleConfig()?.groupTextColor\"\r\n >\r\n <mt-entity-info\r\n [data]=\"{\r\n viewType: item.group.prop?.viewType,\r\n value: item.group.prop?.value,\r\n }\"\r\n [displayType]=\"'inTable'\"\r\n ></mt-entity-info>\r\n </td>\r\n </tr>\r\n } @else {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped &&\r\n (item.rowIndex ?? 0) % 2 === 1\r\n \"\r\n (click)=\"onRowClick(item.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ (item.rowIndex ?? 0) + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell = getPhaseGateCell(item.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(item.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n\r\n @if (groupedVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"groupedVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n } @else {\r\n <!-- Non-Grouped Mode -->\r\n @if (flatVirtualTopSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualTopSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n\r\n @for (rowView of visibleTableRows(); track rowView.trackId) {\r\n <tr\r\n class=\"dashboard-table-row hover:bg-surface-50 transition-colors\"\r\n [class.cursor-pointer]=\"isRowClickable()\"\r\n [class.bg-surface-100]=\"\r\n tableStyleConfig()?.striped && rowView.rowIndex % 2 === 1\r\n \"\r\n (click)=\"onRowClick(rowView.row)\"\r\n >\r\n @if (!tableStyleConfig()?.hideIndex && showIndex()) {\r\n <td\r\n class=\"px-3 py-2 text-center border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n {{ rowView.rowIndex + 1 }}\r\n </td>\r\n }\r\n\r\n @for (column of visibleColumns(); track column.key) {\r\n <td\r\n class=\"px-3 py-2 border-b border-surface-100\"\r\n [style.color]=\"tableStyleConfig()?.tdTextColor\"\r\n [style.fontWeight]=\"\r\n tableStyleConfig()?.tdFontBold ? 'bold' : null\r\n \"\r\n [style.fontSize.px]=\"tableStyleConfig()?.tdFontSize\"\r\n >\r\n @if (isPhaseGateColumn(column)) {\r\n @let phaseCell =\r\n getPhaseGateCell(rowView.row, column);\r\n <div\r\n class=\"min-w-36\"\r\n [title]=\"getPhaseGateCellTooltip(phaseCell)\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"w-2.5 h-2.5 rounded-full flex-shrink-0\"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></span>\r\n <span class=\"font-medium truncate\">\r\n {{ getPhaseGateCellText(phaseCell) }}\r\n </span>\r\n </div>\r\n @if (getPhaseGatePercentage(phaseCell) !== null) {\r\n <div\r\n class=\"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-200\"\r\n >\r\n <div\r\n class=\"h-full rounded-full\"\r\n [style.width.%]=\"\r\n getPhaseGatePercentage(phaseCell)\r\n \"\r\n [style.backgroundColor]=\"\r\n getPhaseGateCellColor(phaseCell)\r\n \"\r\n ></div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <mt-entity-info\r\n [data]=\"getCellData(rowView.row, column)\"\r\n [displayType]=\"'inTable'\"\r\n [extraInfoData]=\"tableStyleConfig()\"\r\n ></mt-entity-info>\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n\r\n @if (flatVirtualBottomSpacerHeightPx() > 0) {\r\n <tr class=\"dashboard-table-spacer\" aria-hidden=\"true\">\r\n <td\r\n [attr.colspan]=\"totalColumns()\"\r\n [style.height.px]=\"flatVirtualBottomSpacerHeightPx()\"\r\n ></td>\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n } @else {\r\n <!-- No Data -->\r\n <div\r\n class=\"flex flex-col items-center justify-center h-32 text-muted-color gap-2\"\r\n >\r\n <i class=\"pi pi-info-circle text-2xl\"></i>\r\n <span>{{ t(\"noData\") }}</span>\r\n </div>\r\n }\r\n </div>\r\n </ng-container>\r\n</mt-card-content>\r\n", styles: [":host{display:block;height:100%}.table-wrapper{display:flex;flex-direction:column}.table-scroll-container{flex:1;min-height:0}table{border-collapse:collapse}.dashboard-table-row{height:48px}.dashboard-table-spacer td{border:0;padding:0}th,td{text-align:start}\n"] }]
|
|
28451
28702
|
}], propDecorators: { dashboardId: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashboardId", required: true }] }], inGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "inGroup", required: false }] }], hideHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideHeader", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }] } });
|
|
28452
28703
|
|
|
28453
28704
|
/**
|
|
@@ -32105,10 +32356,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
32105
32356
|
* `clientConfig.configAsType.legend.overrideLegendOrder`. Reset emits `[]`
|
|
32106
32357
|
* (natural order). Every row also exposes an independent color override keyed
|
|
32107
32358
|
* by the rendered legend name.
|
|
32359
|
+
*
|
|
32360
|
+
* With `reorderable` false the rows become a pure color editor (no drag handle,
|
|
32361
|
+
* no reset-order button, no `valueChange`). That is the mode the Bar-colors
|
|
32362
|
+
* control uses: a plain bar chart's bar order comes from the data / the "Sort
|
|
32363
|
+
* bars by" control, so an order override would persist a key the runtime never
|
|
32364
|
+
* reads.
|
|
32108
32365
|
*/
|
|
32109
32366
|
class LegendOrderField {
|
|
32110
32367
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
32111
32368
|
colorOverrides = input({}, ...(ngDevMode ? [{ debugName: "colorOverrides" }] : /* istanbul ignore next */ []));
|
|
32369
|
+
/** When false, render colors only — no drag handle, no order reset. */
|
|
32370
|
+
reorderable = input(true, ...(ngDevMode ? [{ debugName: "reorderable" }] : /* istanbul ignore next */ []));
|
|
32112
32371
|
valueChange = output();
|
|
32113
32372
|
colorChange = output();
|
|
32114
32373
|
/** Working list is just the input — reorder mutates a copy and emits. */
|
|
@@ -32133,7 +32392,7 @@ class LegendOrderField {
|
|
|
32133
32392
|
});
|
|
32134
32393
|
}
|
|
32135
32394
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32136
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, colorOverrides: { classPropertyName: "colorOverrides", publicName: "colorOverrides", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", colorChange: "colorChange" }, ngImport: i0, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n
|
|
32395
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: LegendOrderField, isStandalone: true, selector: "mt-legend-order-field", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, colorOverrides: { classPropertyName: "colorOverrides", publicName: "colorOverrides", isSignal: true, isRequired: false, transformFunction: null }, reorderable: { classPropertyName: "reorderable", publicName: "reorderable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", colorChange: "colorChange" }, ngImport: i0, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n [cdkDropListDisabled]=\"!reorderable()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n [cdkDragDisabled]=\"!reorderable()\"\r\n >\r\n @if (reorderable()) {\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n <div\r\n class=\"w-44 max-w-[55%] shrink-0\"\r\n role=\"group\"\r\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\r\n >\r\n <mt-color-picker-field\r\n [ngModel]=\"colorFor(item)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"setColor(item, $event)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (reorderable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('resetOrder')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"noLegendEntries\") }}\r\n </p>\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TruncateTooltip, selector: "[mtTruncateTooltip]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32137
32396
|
}
|
|
32138
32397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: LegendOrderField, decorators: [{
|
|
32139
32398
|
type: Component,
|
|
@@ -32146,8 +32405,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
32146
32405
|
ColorPickerField,
|
|
32147
32406
|
Icon,
|
|
32148
32407
|
TruncateTooltip,
|
|
32149
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n >\r\n <span\r\n
|
|
32150
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], colorOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorOverrides", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], colorChange: [{ type: i0.Output, args: ["colorChange"] }] } });
|
|
32408
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\r\n class=\"db-legend-order flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder.styleStudio.messages'\"\r\n>\r\n @if (rows().length) {\r\n <div\r\n cdkDropList\r\n class=\"flex flex-col gap-2\"\r\n [cdkDropListDisabled]=\"!reorderable()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n >\r\n @for (item of rows(); track item.key) {\r\n <div\r\n cdkDrag\r\n class=\"flex items-center gap-3 rounded-lg border border-surface-200 bg-surface-0 px-3 py-2\"\r\n [cdkDragDisabled]=\"!reorderable()\"\r\n >\r\n @if (reorderable()) {\r\n <span\r\n cdkDragHandle\r\n class=\"cursor-grab text-muted-color\"\r\n aria-hidden=\"true\"\r\n >\r\n <mt-icon icon=\"general.dots-grid\" class=\"text-base\" />\r\n </span>\r\n }\r\n <span\r\n class=\"min-w-0 flex-1 truncate text-sm text-color\"\r\n mtTruncateTooltip\r\n >\r\n {{ item.name }}\r\n </span>\r\n <div\r\n class=\"w-44 max-w-[55%] shrink-0\"\r\n role=\"group\"\r\n [attr.aria-label]=\"t('legendColorFor', { name: item.name })\"\r\n >\r\n <mt-color-picker-field\r\n [ngModel]=\"colorFor(item)\"\r\n [ngModelOptions]=\"{ standalone: true }\"\r\n (ngModelChange)=\"setColor(item, $event)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n @if (reorderable()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"t('resetOrder')\"\r\n icon=\"arrow.refresh-ccw-01\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"reset()\"\r\n />\r\n </div>\r\n }\r\n } @else {\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"noLegendEntries\") }}\r\n </p>\r\n }\r\n</div>\r\n" }]
|
|
32409
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], colorOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "colorOverrides", required: false }] }], reorderable: [{ type: i0.Input, args: [{ isSignal: true, alias: "reorderable", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], colorChange: [{ type: i0.Output, args: ["colorChange"] }] } });
|
|
32151
32410
|
|
|
32152
32411
|
const SHADOW_PRESET_PATH$1 = 'clientConfig.configAsType.cardStyleConfig.__shadowPreset';
|
|
32153
32412
|
const SHADOW_SHAPES$1 = {
|
|
@@ -32281,6 +32540,7 @@ class StyleField {
|
|
|
32281
32540
|
'keyValueMap',
|
|
32282
32541
|
'json',
|
|
32283
32542
|
'legendOrder',
|
|
32543
|
+
'entryColors',
|
|
32284
32544
|
].includes(this.field().type), ...(ngDevMode ? [{ debugName: "isComposite" }] : /* istanbul ignore next */ []));
|
|
32285
32545
|
currentValue = computed(() => this.readCurrent(), ...(ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []));
|
|
32286
32546
|
/** Read the field value from `path`, falling back to the first non-empty mirror. */
|
|
@@ -32495,7 +32755,7 @@ class StyleField {
|
|
|
32495
32755
|
this.patch.emit({ path: SHADOW_PRESET_PATH$1, value: key });
|
|
32496
32756
|
}
|
|
32497
32757
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32498
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SliderField, selector: "mt-slider-field", inputs: ["field", "label", "class", "min", "max", "step", "hideNumber", "unit", "readonly", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: IconField, selector: "mt-icon-field", inputs: ["label", "required"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ColorListField, selector: "mt-color-list-field", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ArrayBuilderField, selector: "mt-array-builder-field", inputs: ["value", "itemFields", "itemTitleKey", "addLabel", "maxItems"], outputs: ["valueChange"] }, { kind: "component", type: KeyValueMapField, selector: "mt-key-value-map-field", inputs: ["value", "keys", "valueFields", "asArray"], outputs: ["valueChange"] }, { kind: "component", type: LegendOrderField, selector: "mt-legend-order-field", inputs: ["items", "colorOverrides"], outputs: ["valueChange", "colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32758
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StyleField, isStandalone: true, selector: "mt-style-field", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, persisted: { classPropertyName: "persisted", publicName: "persisted", isSignal: true, isRequired: true, transformFunction: null }, capability: { classPropertyName: "capability", publicName: "capability", isSignal: true, isRequired: false, transformFunction: null }, legendItems: { classPropertyName: "legendItems", publicName: "legendItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { patch: "patch" }, ngImport: i0, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"entryColors\") {\r\n <!-- Colors only: no (valueChange), because there is no order to\r\n persist for this control's charts. -->\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n [reorderable]=\"false\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: NumberField, selector: "mt-number-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "pInputs", "format", "useGrouping", "maxFractionDigits", "min", "max", "required"] }, { kind: "component", type: SliderField, selector: "mt-slider-field", inputs: ["field", "label", "class", "min", "max", "step", "hideNumber", "unit", "readonly", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: MultiSelectField, selector: "mt-multi-select-field", inputs: ["field", "label", "placeholder", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "display", "required", "maxSelectedLabels", "group", "virtualScroll", "virtualScrollItemSize", "optionGroupLabel", "optionGroupChildren", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: IconField, selector: "mt-icon-field", inputs: ["label", "required"] }, { kind: "component", type: SegmentedField, selector: "mt-segmented-field", inputs: ["options", "value", "disabled", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: ColorListField, selector: "mt-color-list-field", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ArrayBuilderField, selector: "mt-array-builder-field", inputs: ["value", "itemFields", "itemTitleKey", "addLabel", "maxItems"], outputs: ["valueChange"] }, { kind: "component", type: KeyValueMapField, selector: "mt-key-value-map-field", inputs: ["value", "keys", "valueFields", "asArray"], outputs: ["valueChange"] }, { kind: "component", type: LegendOrderField, selector: "mt-legend-order-field", inputs: ["items", "colorOverrides", "reorderable"], outputs: ["valueChange", "colorChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
32499
32759
|
}
|
|
32500
32760
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StyleField, decorators: [{
|
|
32501
32761
|
type: Component,
|
|
@@ -32516,7 +32776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
32516
32776
|
ArrayBuilderField,
|
|
32517
32777
|
KeyValueMapField,
|
|
32518
32778
|
LegendOrderField,
|
|
32519
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n" }]
|
|
32779
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let f = field();\r\n@switch (f.type) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"cssDimension\") {\r\n <mt-text-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? '16px'\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multilineText\") {\r\n <mt-textarea-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"number\") {\r\n <mt-number-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [min]=\"numberMin\"\r\n [max]=\"numberMax\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"numberRange\") {\r\n <mt-slider-field\r\n [label]=\"f.label\"\r\n [min]=\"f.min ?? 0\"\r\n [max]=\"f.max ?? 100\"\r\n [step]=\"f.step ?? 1\"\r\n [unit]=\"f.unit ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"boolean\") {\r\n <mt-toggle-field\r\n [label]=\"f.label\"\r\n toggleShape=\"card\"\r\n [descriptionCard]=\"f.description ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"color\") {\r\n <mt-color-picker-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [label]=\"f.label\"\r\n [hint]=\"f.description\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [filter]=\"useFilter\"\r\n [placeholder]=\"f.placeholder ?? ''\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"multiselect\") {\r\n <mt-multi-select-field\r\n [label]=\"f.label\"\r\n [options]=\"options()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n display=\"chip\"\r\n [formControl]=\"control\"\r\n />\r\n }\r\n @case (\"iconPicker\") {\r\n <mt-icon-field [label]=\"f.label\" [formControl]=\"control\" />\r\n }\r\n @default {\r\n <!-- Composite + JSON types render their own label header -->\r\n <div class=\"db-style-field__composite flex flex-col gap-1.5\">\r\n <span class=\"text-sm font-medium text-color\">{{ f.label }}</span>\r\n @if (f.description) {\r\n <span class=\"text-xs text-muted-color\">{{ f.description }}</span>\r\n }\r\n @switch (f.type) {\r\n @case (\"segmented\") {\r\n <mt-segmented-field\r\n [options]=\"options()\"\r\n [value]=\"currentValue()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"palette\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"colorList\") {\r\n <mt-color-list-field\r\n [value]=\"readColors()\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"arrayBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"f.itemFields ?? []\"\r\n [itemTitleKey]=\"f.itemTitleKey\"\r\n [addLabel]=\"addLabel('Add item')\"\r\n [maxItems]=\"f.maxItems\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"conditionBuilder\") {\r\n <mt-array-builder-field\r\n [value]=\"readArray()\"\r\n [itemFields]=\"conditionFields()\"\r\n [addLabel]=\"addLabel('Add rule')\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"keyValueMap\") {\r\n <mt-key-value-map-field\r\n [value]=\"readMapOrArray()\"\r\n [keys]=\"mapKeys()\"\r\n [valueFields]=\"f.valueFields ?? []\"\r\n [asArray]=\"f.asArray ?? false\"\r\n (valueChange)=\"emitValue($event)\"\r\n />\r\n }\r\n @case (\"legendOrder\") {\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n (valueChange)=\"emitValue($event)\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"entryColors\") {\r\n <!-- Colors only: no (valueChange), because there is no order to\r\n persist for this control's charts. -->\r\n <mt-legend-order-field\r\n [items]=\"legendItems()\"\r\n [colorOverrides]=\"readLegendColorOverrides()\"\r\n [reorderable]=\"false\"\r\n (colorChange)=\"onLegendColorChange($event)\"\r\n />\r\n }\r\n @case (\"json\") {\r\n <mt-textarea-field\r\n rows=\"8\"\r\n placeholder=\"{ }\"\r\n [formControl]=\"jsonControl\"\r\n />\r\n @if (jsonError()) {\r\n <span class=\"text-xs text-red-600\">{{ jsonError() }}</span>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n}\r\n" }]
|
|
32520
32780
|
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], persisted: [{ type: i0.Input, args: [{ isSignal: true, alias: "persisted", required: true }] }], capability: [{ type: i0.Input, args: [{ isSignal: true, alias: "capability", required: false }] }], legendItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItems", required: false }] }], patch: [{ type: i0.Output, args: ["patch"] }] } });
|
|
32521
32781
|
|
|
32522
32782
|
/**
|
|
@@ -32600,6 +32860,7 @@ class StyleSettingsRenderer {
|
|
|
32600
32860
|
'multiselect',
|
|
32601
32861
|
'multilineText',
|
|
32602
32862
|
'legendOrder',
|
|
32863
|
+
'entryColors',
|
|
32603
32864
|
].includes(field.type);
|
|
32604
32865
|
}
|
|
32605
32866
|
message(key, fallback) {
|
|
@@ -41699,18 +41960,26 @@ class WidgetPaletteComponent {
|
|
|
41699
41960
|
return t.products.includes(prod);
|
|
41700
41961
|
});
|
|
41701
41962
|
}, ...(ngDevMode ? [{ debugName: "filteredChartTypes" }] : /* istanbul ignore next */ []));
|
|
41702
|
-
/**
|
|
41963
|
+
/**
|
|
41964
|
+
* Widgets shown in the grid.
|
|
41965
|
+
*
|
|
41966
|
+
* A search spans EVERY category; only an empty search falls back to the
|
|
41967
|
+
* active tab. Scoping the search to the active tab meant that a user who
|
|
41968
|
+
* opened the palette — which lands on **Layout**, a tab holding just Header
|
|
41969
|
+
* and Topbar — and typed a widget name into the prominent search box got
|
|
41970
|
+
* "No results" for a widget that exists one tab over (issue #1248: "i cant
|
|
41971
|
+
* find the map chart to use it").
|
|
41972
|
+
*/
|
|
41703
41973
|
widgets = computed(() => {
|
|
41704
|
-
const search = this.searchTerm().toLowerCase();
|
|
41705
|
-
const
|
|
41706
|
-
let filtered = this.filteredChartTypes().filter((t) => t.category === category);
|
|
41707
|
-
// Filter by hideInList
|
|
41708
|
-
filtered = filtered.filter((t) => !t.hideInList);
|
|
41974
|
+
const search = this.searchTerm().trim().toLowerCase();
|
|
41975
|
+
const available = this.filteredChartTypes().filter((t) => !t.hideInList);
|
|
41709
41976
|
if (search) {
|
|
41710
|
-
|
|
41977
|
+
return available.filter((w) => w.name.toLowerCase().includes(search));
|
|
41711
41978
|
}
|
|
41712
|
-
return
|
|
41979
|
+
return available.filter((t) => t.category === this.activeTab());
|
|
41713
41980
|
}, ...(ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []));
|
|
41981
|
+
/** True while a search is narrowing across categories (tabs do not apply). */
|
|
41982
|
+
isSearching = computed(() => this.searchTerm().trim().length > 0, ...(ngDevMode ? [{ debugName: "isSearching" }] : /* istanbul ignore next */ []));
|
|
41714
41983
|
/** Count of widgets per category (for badge display) */
|
|
41715
41984
|
categoryCount = computed(() => {
|
|
41716
41985
|
const types = this.filteredChartTypes().filter((t) => !t.hideInList);
|
|
@@ -41747,11 +42016,11 @@ class WidgetPaletteComponent {
|
|
|
41747
42016
|
this.ref?.close(null);
|
|
41748
42017
|
}
|
|
41749
42018
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WidgetPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41750
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WidgetPaletteComponent, isStandalone: true, selector: "mt-widget-palette", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs -->\r\n <mt-tabs\r\n
|
|
42019
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: WidgetPaletteComponent, isStandalone: true, selector: "mt-widget-palette", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs \u2014 a search spans every category, so the tabs do not\r\n apply while one is active. -->\r\n @if (!isSearching()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
41751
42020
|
}
|
|
41752
42021
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: WidgetPaletteComponent, decorators: [{
|
|
41753
42022
|
type: Component,
|
|
41754
|
-
args: [{ selector: 'mt-widget-palette', standalone: true, imports: [TranslocoDirective, Button, TextField, Tabs, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs -->\r\n <mt-tabs\r\n
|
|
42023
|
+
args: [{ selector: 'mt-widget-palette', standalone: true, imports: [TranslocoDirective, Button, TextField, Tabs, Icon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Content -->\r\n <div class=\"flex flex-col gap-4 p-4\" [class]=\"modal.contentClass\">\r\n <!-- Search -->\r\n <mt-text-field\r\n [placeholder]=\"t('widgetPalette.searchPlaceholder')\"\r\n [icon]=\"'general.search-lg'\"\r\n [(value)]=\"searchTerm\"\r\n />\r\n\r\n <!-- Category Tabs \u2014 a search spans every category, so the tabs do not\r\n apply while one is active. -->\r\n @if (!isSearching()) {\r\n <mt-tabs\r\n [(active)]=\"activeTab\"\r\n [options]=\"tabOptions()\"\r\n size=\"small\"\r\n fluid\r\n />\r\n }\r\n\r\n <!-- Widgets Grid -->\r\n <div class=\"flex-1 overflow-y-auto\">\r\n <div class=\"grid grid-cols-3 gap-3\">\r\n @for (widget of widgets(); track widget.id) {\r\n <div\r\n class=\"flex flex-col items-center justify-center gap-2 p-4 rounded-lg cursor-pointer border border-surface-200 bg-white select-none transition-all hover:border-primary-400 hover:shadow-md hover:bg-primary-50\"\r\n draggable=\"true\"\r\n (dragstart)=\"onDragStart($event, widget)\"\r\n (click)=\"onWidgetClick(widget)\"\r\n [title]=\"widget.name\"\r\n >\r\n <div\r\n class=\"w-10 h-10 flex items-center justify-center text-primary-500\"\r\n >\r\n <mt-icon [icon]=\"widget.icon\" class=\"text-2xl\" />\r\n </div>\r\n <span\r\n class=\"text-xs font-medium text-color text-center leading-tight\"\r\n >{{ widget.name }}</span\r\n >\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (widgets().length === 0) {\r\n <div class=\"p-8 text-center text-muted-color\">\r\n <mt-icon icon=\"general.search-lg\" class=\"text-3xl mb-2\" />\r\n <p>{{ t(\"widgetPalette.noResults\") }}</p>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Hint -->\r\n <div\r\n class=\"text-xs text-muted-color text-center py-2 border-t border-surface-200\"\r\n >\r\n {{ t(\"widgetPalette.dragHint\") }}\r\n </div>\r\n </div>\r\n\r\n <!-- Footer -->\r\n <div [class]=\"modal.footerClass\">\r\n <mt-button [label]=\"t('cancel')\" variant=\"outlined\" (onClick)=\"close()\" />\r\n </div>\r\n</ng-container>\r\n" }]
|
|
41755
42024
|
}], propDecorators: { product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: false }] }] } });
|
|
41756
42025
|
|
|
41757
42026
|
/**
|
|
@@ -41773,6 +42042,7 @@ class DashboardBuilder {
|
|
|
41773
42042
|
transloco = inject(TranslocoService);
|
|
41774
42043
|
modalService = inject(ModalService);
|
|
41775
42044
|
confirmationService = inject(ConfirmationService);
|
|
42045
|
+
route = inject(ActivatedRoute, { optional: true });
|
|
41776
42046
|
// ============================================
|
|
41777
42047
|
// Inputs
|
|
41778
42048
|
// ============================================
|
|
@@ -41921,6 +42191,12 @@ class DashboardBuilder {
|
|
|
41921
42191
|
lastExtraFiltersSignature = null;
|
|
41922
42192
|
lastLoadedPageKey = null;
|
|
41923
42193
|
lastStandaloneDashboardSignature = null;
|
|
42194
|
+
/**
|
|
42195
|
+
* Last geometry published per chart id, keyed by `serviceConfig.dashboardId`.
|
|
42196
|
+
* Gridster mutates the bound chart object in place, so this is the only way
|
|
42197
|
+
* to tell that a drag/resize actually moved something (issue #1192).
|
|
42198
|
+
*/
|
|
42199
|
+
lastItemGeometry = new Map();
|
|
41924
42200
|
// Undo history (issue #1192): deep-cloned whole-document snapshots.
|
|
41925
42201
|
undoStack = [];
|
|
41926
42202
|
HISTORY_LIMIT = 30;
|
|
@@ -41969,6 +42245,14 @@ class DashboardBuilder {
|
|
|
41969
42245
|
// Lifecycle
|
|
41970
42246
|
// ============================================
|
|
41971
42247
|
ngOnInit() {
|
|
42248
|
+
// Publish our route so `ActionService.navigateToPage` can resolve a sibling
|
|
42249
|
+
// dashboard. Only the viewer used to do this, so inside the BUILDER the
|
|
42250
|
+
// service fell back to ActionService's own (ROOT) route and navigation
|
|
42251
|
+
// landed on the app root instead of the target dashboard (issues #1140 /
|
|
42252
|
+
// #1193 — the dialog case, where the item cannot see a routed injector).
|
|
42253
|
+
if (this.route) {
|
|
42254
|
+
this.dashboardService.setActivatedRoute(this.route);
|
|
42255
|
+
}
|
|
41972
42256
|
this.setupEventListeners();
|
|
41973
42257
|
// Warm the modules tree once when the dashboard opens. It is not
|
|
41974
42258
|
// workspace-filtered, so every later "open datasource" hits this cache
|
|
@@ -41976,6 +42260,9 @@ class DashboardBuilder {
|
|
|
41976
42260
|
this.prefetchModulesTree();
|
|
41977
42261
|
}
|
|
41978
42262
|
ngOnDestroy() {
|
|
42263
|
+
if (this.route && this.dashboardService.activatedRoute() === this.route) {
|
|
42264
|
+
this.dashboardService.setActivatedRoute(null);
|
|
42265
|
+
}
|
|
41979
42266
|
this.subscription.unsubscribe();
|
|
41980
42267
|
this.removeEventListeners();
|
|
41981
42268
|
this.stopAutoScroll();
|
|
@@ -42030,6 +42317,7 @@ class DashboardBuilder {
|
|
|
42030
42317
|
};
|
|
42031
42318
|
// A fresh document loaded — start its edit history from scratch.
|
|
42032
42319
|
this.resetHistory();
|
|
42320
|
+
this.resetItemGeometryTracking();
|
|
42033
42321
|
this.pageConfig.set(normalizedReport);
|
|
42034
42322
|
// Handle chartLinks format from new API
|
|
42035
42323
|
if (report.chartLinks && report.chartLinks.length > 0) {
|
|
@@ -42104,12 +42392,23 @@ class DashboardBuilder {
|
|
|
42104
42392
|
// ============================================
|
|
42105
42393
|
// Save
|
|
42106
42394
|
// ============================================
|
|
42395
|
+
/**
|
|
42396
|
+
* Persist the dashboard.
|
|
42397
|
+
*
|
|
42398
|
+
* An EXPLICIT save (the toolbar button — `silent` unset) is the commit point
|
|
42399
|
+
* for the undo history: once it succeeds the accumulated history is dropped
|
|
42400
|
+
* and Undo is disabled until the user edits again. Undo is a pre-save
|
|
42401
|
+
* operation, so it must never be able to reach across a deliberate save
|
|
42402
|
+
* (issue #1192). Internal auto-saves pass `silent: true` and deliberately
|
|
42403
|
+
* keep the history so an add/remove stays revertible.
|
|
42404
|
+
*/
|
|
42107
42405
|
saveDash(options = {}) {
|
|
42108
42406
|
if (this.saving())
|
|
42109
42407
|
return;
|
|
42110
42408
|
if (this.standalone()) {
|
|
42111
42409
|
this.emitDashboardDataChange();
|
|
42112
42410
|
if (!options.silent) {
|
|
42411
|
+
this.commitSavedState();
|
|
42113
42412
|
this.onSave.emit();
|
|
42114
42413
|
}
|
|
42115
42414
|
return;
|
|
@@ -42168,6 +42467,7 @@ class DashboardBuilder {
|
|
|
42168
42467
|
if (linkRequests.length === 0) {
|
|
42169
42468
|
this.saving.set(false);
|
|
42170
42469
|
if (!options.silent) {
|
|
42470
|
+
this.commitSavedState();
|
|
42171
42471
|
this.onSave.emit();
|
|
42172
42472
|
}
|
|
42173
42473
|
return;
|
|
@@ -42214,11 +42514,25 @@ class DashboardBuilder {
|
|
|
42214
42514
|
}));
|
|
42215
42515
|
this.dashboardService.setDialogItems(this.dialogs());
|
|
42216
42516
|
if (!options.silent) {
|
|
42517
|
+
this.commitSavedState();
|
|
42217
42518
|
this.onSave.emit();
|
|
42218
42519
|
}
|
|
42219
42520
|
},
|
|
42220
42521
|
});
|
|
42221
42522
|
}
|
|
42523
|
+
/**
|
|
42524
|
+
* Mark the current document as the saved baseline: drop the undo history so
|
|
42525
|
+
* Undo is disabled until the next edit (issue #1192 — undo is a *pre-save*
|
|
42526
|
+
* operation and must not reach back across a deliberate save).
|
|
42527
|
+
*
|
|
42528
|
+
* Runs after the link-id patch so the new baseline is captured from the
|
|
42529
|
+
* document the backend actually holds.
|
|
42530
|
+
*/
|
|
42531
|
+
commitSavedState() {
|
|
42532
|
+
this.resetHistory();
|
|
42533
|
+
this.committedSnapshot = cloneDeep$1(this.buildDashboardDataSnapshot());
|
|
42534
|
+
this.committedSignature = this.historySignature(this.committedSnapshot);
|
|
42535
|
+
}
|
|
42222
42536
|
/**
|
|
42223
42537
|
* Persist the page-level filters through the dashboard (report) endpoint —
|
|
42224
42538
|
* the canonical carrier of `dashboardConfig.filters`. In API-backed mode
|
|
@@ -42306,33 +42620,43 @@ class DashboardBuilder {
|
|
|
42306
42620
|
onItemResize(item, itemComponent) {
|
|
42307
42621
|
this.onItemChange(item, itemComponent);
|
|
42308
42622
|
}
|
|
42623
|
+
/**
|
|
42624
|
+
* Gridster drag/resize committed (issue #1192).
|
|
42625
|
+
*
|
|
42626
|
+
* The template binds `[item]="chart"`, so Gridster owns and MUTATES the very
|
|
42627
|
+
* object that lives inside the `charts` signal. By the time this callback
|
|
42628
|
+
* runs, `chart.x/y/cols/rows` already hold the new geometry — which is why
|
|
42629
|
+
* the previous "did anything change?" guard compared the chart against
|
|
42630
|
+
* itself, always matched, and returned the array untouched. The signal never
|
|
42631
|
+
* notified, so neither the undo-history effect nor the standalone
|
|
42632
|
+
* `dashboardData` emit ever saw a move or a resize.
|
|
42633
|
+
*
|
|
42634
|
+
* We therefore track the last geometry we published per chart and compare
|
|
42635
|
+
* against THAT. When it differs we publish a new array reference (same item
|
|
42636
|
+
* objects, so Gridster's own `[item]` binding is left alone) purely to wake
|
|
42637
|
+
* the signal's consumers.
|
|
42638
|
+
*/
|
|
42309
42639
|
onItemChange(item, _itemComponent) {
|
|
42310
|
-
|
|
42311
|
-
|
|
42312
|
-
|
|
42313
|
-
|
|
42314
|
-
|
|
42315
|
-
|
|
42316
|
-
|
|
42317
|
-
|
|
42318
|
-
|
|
42319
|
-
|
|
42320
|
-
|
|
42321
|
-
|
|
42322
|
-
|
|
42323
|
-
|
|
42324
|
-
|
|
42325
|
-
|
|
42326
|
-
|
|
42327
|
-
|
|
42328
|
-
|
|
42329
|
-
|
|
42330
|
-
rows: item.rows,
|
|
42331
|
-
};
|
|
42332
|
-
}
|
|
42333
|
-
return chart;
|
|
42334
|
-
});
|
|
42335
|
-
});
|
|
42640
|
+
const dashboardId = item.config?.serviceConfig?.dashboardId;
|
|
42641
|
+
if (!dashboardId)
|
|
42642
|
+
return;
|
|
42643
|
+
const geometry = this.geometrySignature(item);
|
|
42644
|
+
if (this.lastItemGeometry.get(dashboardId) === geometry)
|
|
42645
|
+
return;
|
|
42646
|
+
this.lastItemGeometry.set(dashboardId, geometry);
|
|
42647
|
+
this.charts.update((currentCharts) => [...currentCharts]);
|
|
42648
|
+
}
|
|
42649
|
+
geometrySignature(item) {
|
|
42650
|
+
return `${item.x ?? 0}:${item.y ?? 0}:${item.cols ?? 1}:${item.rows ?? 1}`;
|
|
42651
|
+
}
|
|
42652
|
+
/**
|
|
42653
|
+
* Forget recorded geometries. Required whenever a whole new document replaces
|
|
42654
|
+
* the current one (load / standalone apply / undo restore), otherwise a stale
|
|
42655
|
+
* entry could make a later drag back to those exact coordinates look like a
|
|
42656
|
+
* no-op and get swallowed.
|
|
42657
|
+
*/
|
|
42658
|
+
resetItemGeometryTracking() {
|
|
42659
|
+
this.lastItemGeometry.clear();
|
|
42336
42660
|
}
|
|
42337
42661
|
onContextMenu(event, item) {
|
|
42338
42662
|
event.preventDefault();
|
|
@@ -43953,12 +44277,17 @@ class DashboardBuilder {
|
|
|
43953
44277
|
this.canUndo.set(false);
|
|
43954
44278
|
}
|
|
43955
44279
|
/**
|
|
43956
|
-
* Revert the most recent action
|
|
43957
|
-
*
|
|
43958
|
-
*
|
|
43959
|
-
*
|
|
43960
|
-
*
|
|
43961
|
-
*
|
|
44280
|
+
* Revert the most recent UNSAVED action (issue #1192).
|
|
44281
|
+
*
|
|
44282
|
+
* Undo is a pre-save operation: it restores the previous local state and
|
|
44283
|
+
* never writes to the backend. Pressing Save is the commit point — a
|
|
44284
|
+
* successful explicit save clears the history, after which Undo is disabled
|
|
44285
|
+
* until the user edits again.
|
|
44286
|
+
*
|
|
44287
|
+
* Ghost-link cleanup is the one exception to "never writes": when the revert
|
|
44288
|
+
* drops an item that a background auto-save had already linked, that link is
|
|
44289
|
+
* removed. Leaving it behind would resurrect the item on the next reload,
|
|
44290
|
+
* which is a bug in its own right rather than part of the undone state.
|
|
43962
44291
|
*/
|
|
43963
44292
|
undo() {
|
|
43964
44293
|
if (this.readonly())
|
|
@@ -43968,14 +44297,12 @@ class DashboardBuilder {
|
|
|
43968
44297
|
this.flushPendingHistory();
|
|
43969
44298
|
if (!this.undoStack.length)
|
|
43970
44299
|
return;
|
|
43971
|
-
// What is persisted right now, so we can reconcile the server below.
|
|
43972
44300
|
const beforeItems = [...this.charts(), ...this.dialogs()];
|
|
43973
|
-
const beforeFiltersSig = this.serializeFilters(this.filtersConfig());
|
|
43974
44301
|
const previous = this.undoStack.pop();
|
|
43975
44302
|
this.applyDashboardData(cloneDeep$1(previous));
|
|
43976
44303
|
// Rebaseline to the ACTUAL restored document (applyDashboardData normalizes
|
|
43977
|
-
// filters) so the history-capture effect treats this restore
|
|
43978
|
-
//
|
|
44304
|
+
// filters) so the history-capture effect treats this restore as a no-op
|
|
44305
|
+
// rather than a fresh undoable change.
|
|
43979
44306
|
const restored = this.buildDashboardDataSnapshot();
|
|
43980
44307
|
this.committedSnapshot = cloneDeep$1(restored);
|
|
43981
44308
|
this.committedSignature = this.historySignature(restored);
|
|
@@ -43984,59 +44311,42 @@ class DashboardBuilder {
|
|
|
43984
44311
|
this.undoStack.length = 0;
|
|
43985
44312
|
this.canUndo.set(false);
|
|
43986
44313
|
this.charts().forEach((chart) => this.reRenderItem(chart));
|
|
44314
|
+
// A reverted move/resize changes item geometry, so ask Gridster to lay the
|
|
44315
|
+
// grid out again rather than relying on per-item repositioning alone.
|
|
44316
|
+
this.gridsterContainer()?.updateGrid?.();
|
|
43987
44317
|
const page = this.pageConfig();
|
|
43988
44318
|
if (page)
|
|
43989
44319
|
this.pageChange.emit(page);
|
|
43990
44320
|
this.chartsChange.emit(this.charts());
|
|
43991
|
-
// Standalone mode has no
|
|
43992
|
-
// the reverted document via the emit effect.
|
|
44321
|
+
// Standalone mode has no backend links to clean up.
|
|
43993
44322
|
if (this.standalone())
|
|
43994
44323
|
return;
|
|
43995
|
-
this.
|
|
44324
|
+
this.unlinkItemsRemovedByUndo(beforeItems);
|
|
43996
44325
|
}
|
|
43997
44326
|
/**
|
|
43998
|
-
*
|
|
43999
|
-
*
|
|
44000
|
-
*
|
|
44001
|
-
*
|
|
44327
|
+
* Remove backend links for items the revert dropped.
|
|
44328
|
+
*
|
|
44329
|
+
* `saveDash` only ever upserts, so an already-linked item that is no longer
|
|
44330
|
+
* in the document would otherwise survive as an orphan and reappear on the
|
|
44331
|
+
* next load. This does NOT restore any other saved state — it only prevents
|
|
44332
|
+
* an item the user just undid from coming back.
|
|
44002
44333
|
*/
|
|
44003
|
-
|
|
44334
|
+
unlinkItemsRemovedByUndo(beforeItems) {
|
|
44004
44335
|
const reportId = this.pageId();
|
|
44005
44336
|
if (!reportId)
|
|
44006
44337
|
return;
|
|
44007
|
-
const
|
|
44008
|
-
const currentIds = new Set(currentItems
|
|
44338
|
+
const currentIds = new Set([...this.charts(), ...this.dialogs()]
|
|
44009
44339
|
.map((it) => it.config?.serviceConfig?.dashboardId)
|
|
44010
44340
|
.filter((v) => v != null));
|
|
44011
|
-
|
|
44012
|
-
|
|
44013
|
-
!currentIds.has(it.config?.serviceConfig?.dashboardId))
|
|
44014
|
-
|
|
44341
|
+
beforeItems
|
|
44342
|
+
.filter((it) => it.chartComponentId != null &&
|
|
44343
|
+
!currentIds.has(it.config?.serviceConfig?.dashboardId))
|
|
44344
|
+
.forEach((it) => this.dashboardService
|
|
44015
44345
|
.unlinkChart({
|
|
44016
44346
|
reportId: Number(reportId),
|
|
44017
44347
|
chartComponentId: it.chartComponentId,
|
|
44018
44348
|
}, { silent: true })
|
|
44019
44349
|
.subscribe({ next: () => { }, error: () => { } }));
|
|
44020
|
-
// Re-save charts/dialogs when the item set / layout / config changed.
|
|
44021
|
-
const itemsChanged = removed.length > 0 ||
|
|
44022
|
-
this.serializeItems(currentItems) !== this.serializeItems(beforeItems);
|
|
44023
|
-
if (itemsChanged) {
|
|
44024
|
-
this.saveDash({ silent: true });
|
|
44025
|
-
}
|
|
44026
|
-
// Rewrite page filters only when they changed (updateReport is not silent,
|
|
44027
|
-
// so gating avoids a spurious toast on every unrelated undo).
|
|
44028
|
-
const afterFiltersSig = this.serializeFilters(restored.filters ?? []);
|
|
44029
|
-
if (afterFiltersSig !== beforeFiltersSig) {
|
|
44030
|
-
this.persistPageFilters();
|
|
44031
|
-
}
|
|
44032
|
-
}
|
|
44033
|
-
/** Serialize page filters for change detection (normalized, order-stable). */
|
|
44034
|
-
serializeFilters(filters) {
|
|
44035
|
-
return JSON.stringify(this.normalizeFiltersConfig(filters));
|
|
44036
|
-
}
|
|
44037
|
-
/** Serialize items ignoring link ids so persistence metadata isn't compared. */
|
|
44038
|
-
serializeItems(items) {
|
|
44039
|
-
return JSON.stringify(items.map((it) => this.stripLinkIds(it)));
|
|
44040
44350
|
}
|
|
44041
44351
|
/**
|
|
44042
44352
|
* Content signature of the whole document with link ids stripped, so a save
|
|
@@ -44127,6 +44437,9 @@ class DashboardBuilder {
|
|
|
44127
44437
|
applyDashboardData(data) {
|
|
44128
44438
|
const filters = data.filters ?? data.page?.dashboardConfig?.filters;
|
|
44129
44439
|
this.applyingDashboardData = true;
|
|
44440
|
+
// The whole item set is being replaced (standalone apply or undo restore),
|
|
44441
|
+
// so previously recorded geometries no longer describe these charts.
|
|
44442
|
+
this.resetItemGeometryTracking();
|
|
44130
44443
|
this.pageConfig.set(data.page ?? null);
|
|
44131
44444
|
this.charts.set(data.charts ?? []);
|
|
44132
44445
|
this.dialogs.set(data.dialogs ?? []);
|
|
@@ -44747,6 +45060,12 @@ class DashboardViewer {
|
|
|
44747
45060
|
this.closeFiltersPanel();
|
|
44748
45061
|
this.subscription.unsubscribe();
|
|
44749
45062
|
this.storeService.updateQueryParams({});
|
|
45063
|
+
// The published route is a root-provided singleton. Leaving ours behind
|
|
45064
|
+
// made a later host (e.g. the builder) resolve `navigateToPage` relative to
|
|
45065
|
+
// a dead viewer route. Only retract it if it is still ours.
|
|
45066
|
+
if (this.route && this.dashboardService.activatedRoute() === this.route) {
|
|
45067
|
+
this.dashboardService.setActivatedRoute(null);
|
|
45068
|
+
}
|
|
44750
45069
|
}
|
|
44751
45070
|
setupSubscriptions() {
|
|
44752
45071
|
// Publish our route so ActionService.navigateToPage can resolve sibling
|
|
@@ -45495,7 +45814,7 @@ class DashboardList {
|
|
|
45495
45814
|
this.dashboards.reload();
|
|
45496
45815
|
}
|
|
45497
45816
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
45498
|
-
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"], 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", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { 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 });
|
|
45817
|
+
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"], 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", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "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 });
|
|
45499
45818
|
}
|
|
45500
45819
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DashboardList, decorators: [{
|
|
45501
45820
|
type: Component,
|
|
@@ -48515,4 +48834,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
48515
48834
|
*/
|
|
48516
48835
|
|
|
48517
48836
|
export { RingGaugeChartHandler as $, StatisticCardComponent as A, TopbarCardComponent as B, CardContentComponent as C, DashboardItemStoreService as D, EChartComponent as E, FilterUtilsService as F, ChartDataService as G, HeaderCardComponent as H, BarChartHandler as I, PieChartHandler as J, StackBarChartHandler as K, LastHistoryLevelCardComponent as L, axisFormatters as M, groupDatesByYearAndMonth as N, GaugeChartHandler as O, PropertiesCardComponent as P, TableViewHandler as Q, OverviewCardHandler as R, StaticFiltersComponent as S, TableCardComponent as T, TimelineHandler as U, LineChartHandler as V, SnapshotHandler as W, ComparisonChartHandler as X, SplitterChartHandler as Y, LevelCardHandler as Z, MapChartHandler as _, DashboardItem as a, normalizeAggregateFunction as a$, SPlusChartHandler as a0, PhaseGateStepperHandler as a1, formatCurrency as a2, getCurrencySuffix as a3, formatPercentage as a4, formatNumber as a5, formatDate as a6, createAxisFormatter as a7, createTooltipFormatter as a8, formatAxisLabel as a9, ChartViewer as aA, StyleStudioDrawer as aB, StyleSettingsRenderer as aC, expandResetPatches as aD, StyleField as aE, SegmentedField as aF, ColorListField as aG, ArrayBuilderField as aH, KeyValueMapField as aI, LegendOrderField as aJ, ItemCardMenuComponent as aK, ChartFilterDrawer as aL, ItemContextToolbarComponent as aM, ItemConfigPopoverComponent as aN, GuidedConfigDialogComponent as aO, FilterChipsBarComponent as aP, FilterBuilderComponent as aQ, DatasourcePanelComponent as aR, SchemaControlRendererComponent as aS, FilterByGroupPipe as aT, GetChartActionsPipe as aU, CHART_CAPABILITIES as aV, getCapabilityById as aW, resolveCapability as aX, toBackendChartType as aY, normalizeChartTypeForRequest as aZ, normalizeFilterOperation as a_, formatWordsUnderBar as aa, formatXAxis as ab, handleFiltersForCustom as ac, handleFilterForCard as ad, handleFilterForSnapshot as ae, DashboardList as af, HTTPMethod as ag, DashboardBuilderService as ah, DashboardStoreService as ai, isManagePagesDeleteResult as aj, ManagePages as ak, ManageBreadcrumb as al, ManageFilterOnPage as am, DynamicFiltersConfig as an, ChartSettingsDrawer as ao, DisplaySettings as ap, DefaultControlUi as aq, PieControlUi as ar, BarControlUi as as, StackBarControlUi as at, ManageItem as au, CHART_TYPES as av, ManageItemService as aw, GeneralSettings as ax, DataSourceSettings as ay, ActionsSettings as az, DashboardBuilder as b, normalizeFilters as b0, selectorFromLegacy as b1, moduleIdFromSelector as b2, toBackendSourceLink as b3, toFormSourceLink as b4, normalizeOnLoad as b5, normalizeBeforeSave as b6, normalizeBeforeRequest as b7, CONFIG_DOMAINS as b8, domainsForCapability as b9, deepMerge$1 as bA, formatForEditor as bB, readByPath$1 as bC, setByPath as bD, applyControlPatchToPersisted as bE, applyControlPatchesToPersisted as bF, getControlSchema as bG, listControlSchemaIds as bH, listControlSchemas as bI, getFallbackControlSchema as bJ, flattenSchema as bK, resolveDisplayFields as bL, buildDisplayFieldPredicate as bM, bindingKey as bN, getBinding as bO, listBindings as bP, listBindingsForChart as bQ, readBoundValue as bR, ITEM_GUIDANCE_REGISTRY as bS, describeGuidance as bT, ItemGuidanceService as bU, findDomain as ba, POPOVER_TABS as bb, POPOVER_TAB_SPECS as bc, titleToUi as bd, applyTitleToPersisted as be, datasourceToUi as bf, fieldsToUi as bg, filtersToUi as bh, styleToUi as bi, applyStyleToPersisted as bj, layoutToUi as bk, applyLayoutToPersisted as bl, labelLegendFormatToUi as bm, applyLabelLegendFormatToPersisted as bn, behaviorToUi as bo, applyBehaviorToPersisted as bp, applyFilterChipsToPersisted as bq, persistedToUi as br, buildAssembly as bs, STYLE_PRESETS as bt, presetsForCapability as bu, findPreset as bv, validate as bw, hasBlockingIssues as bx, groupIssuesByDomain as by, parseAdvancedJson as bz, cloneDeep$1 as c, DashboardViewer as d, switchAllKeysSmall$1 as e, dynamicTextReplace as f, getNestedData as g, dynamicReorder as h, generalConfiguration as i, formatValue as j, getLocalizedTitle as k, sortChartData as l, addCommasToNumber as m, sortDataTableView as n, isMobilePlatform$1 as o, getColorFromConditions as p, CardFilterComponent as q, DynamicFiltersComponent as r, switchAllKeysToLower as s, CardInfoComponent as t, ChartCardComponent as u, EntityInfoComponent as v, normalizeDashboardCardEntityValue as w, EntityPreviewCardComponent as x, ListStatisticCardComponent as y, SkeletonCardComponent as z };
|
|
48518
|
-
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-
|
|
48837
|
+
//# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-Dz2al1ZI.mjs.map
|