@masterteam/dashboard-builder 0.0.57 → 0.0.59

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.
@@ -1831,13 +1831,12 @@ const CHART_CAPABILITIES = [
1831
1831
  fields: [
1832
1832
  'valueProperty',
1833
1833
  'aggregateFunction',
1834
- 'groupByProperties',
1835
1834
  'color',
1836
1835
  'formula',
1837
1836
  'filters',
1838
- 'extraProperties',
1839
1837
  ],
1840
- required: ['formula'],
1838
+ required: [],
1839
+ requiredAnyOf: ['valueProperty', 'formula'],
1841
1840
  },
1842
1841
  },
1843
1842
  display: {
@@ -2110,8 +2109,29 @@ const CHART_CAPABILITIES = [
2110
2109
  selection: { visible: true, allowMultiple: true },
2111
2110
  supportsSourceLinks: true,
2112
2111
  supportsCustomApi: true,
2113
- supportsGroupByMultiple: true,
2114
- query: { editor: 'table' },
2112
+ supportsGroupByMultiple: false,
2113
+ query: {
2114
+ editor: 'phaseGateTable',
2115
+ schema: {
2116
+ fields: [
2117
+ 'rowIdentityProperty',
2118
+ 'phaseNameProperty',
2119
+ 'phaseIdProperty',
2120
+ 'phaseOrderProperty',
2121
+ 'phaseStatusProperty',
2122
+ 'phaseProgressProperty',
2123
+ 'phaseIsCurrentProperty',
2124
+ 'phaseIsCompletedProperty',
2125
+ 'phaseAllItemsCompletedProperty',
2126
+ 'baseProperties',
2127
+ ],
2128
+ required: [
2129
+ 'rowIdentityProperty',
2130
+ 'phaseNameProperty',
2131
+ 'phaseStatusProperty',
2132
+ ],
2133
+ },
2134
+ },
2115
2135
  display: {
2116
2136
  fields: [
2117
2137
  ...TITLE_SHARED,
@@ -2759,6 +2779,134 @@ function normalizeChartTypeForRequest(raw) {
2759
2779
  return (toBackendChartType(raw) ?? raw ?? '');
2760
2780
  }
2761
2781
 
2782
+ const PHASE_GATE_TABLE_ROLE_FIELDS = [
2783
+ 'rowIdentityProperty',
2784
+ 'phaseNameProperty',
2785
+ 'phaseIdProperty',
2786
+ 'phaseOrderProperty',
2787
+ 'phaseStatusProperty',
2788
+ 'phaseProgressProperty',
2789
+ 'phaseIsCurrentProperty',
2790
+ 'phaseIsCompletedProperty',
2791
+ 'phaseAllItemsCompletedProperty',
2792
+ ];
2793
+ function isPhaseGateTableQuery(value) {
2794
+ if (!value || typeof value !== 'object')
2795
+ return false;
2796
+ const query = value;
2797
+ return PHASE_GATE_TABLE_ROLE_FIELDS.some((field) => Object.prototype.hasOwnProperty.call(query, field));
2798
+ }
2799
+ /** Stable, case/separator-insensitive identity used only for exact matches. */
2800
+ function normalizePhaseGatePropertyIdentity(value) {
2801
+ return String(value ?? '')
2802
+ .trim()
2803
+ .toLowerCase()
2804
+ .replace(/[\s_-]+/g, '');
2805
+ }
2806
+ function uniquePhaseGatePropertyKeys(value) {
2807
+ if (!Array.isArray(value))
2808
+ return [];
2809
+ const seen = new Set();
2810
+ const result = [];
2811
+ value.forEach((item) => {
2812
+ if (typeof item !== 'string')
2813
+ return;
2814
+ const key = item.trim();
2815
+ const identity = normalizePhaseGatePropertyIdentity(key);
2816
+ if (!identity || seen.has(identity))
2817
+ return;
2818
+ seen.add(identity);
2819
+ result.push(key);
2820
+ });
2821
+ return result;
2822
+ }
2823
+ /**
2824
+ * Create the complete property projection expected by the chart service.
2825
+ * Visible columns stay first and role fields are appended exactly once.
2826
+ */
2827
+ function buildPhaseGateTableProjection(query) {
2828
+ const roleProperties = PHASE_GATE_TABLE_ROLE_FIELDS.map((field) => typeof query[field] === 'string' ? query[field] : '');
2829
+ const baseProperties = Array.isArray(query['baseProperties'])
2830
+ ? query['baseProperties']
2831
+ : query['properties'];
2832
+ return uniquePhaseGatePropertyKeys([
2833
+ ...uniquePhaseGatePropertyKeys(baseProperties),
2834
+ ...roleProperties,
2835
+ ]);
2836
+ }
2837
+ /**
2838
+ * Rebuild a PhaseGate table query without dropping unknown forward-compatible
2839
+ * fields. Legacy generic table configs can be hydrated deliberately by passing
2840
+ * `migrateLegacy: true`; their lookup property becomes the explicit status
2841
+ * role and their selected properties seed the visible business columns.
2842
+ */
2843
+ function normalizePhaseGateTableQuery(value, options = {}) {
2844
+ if (!value || typeof value !== 'object') {
2845
+ return value;
2846
+ }
2847
+ const source = value;
2848
+ if (!options.migrateLegacy && !isPhaseGateTableQuery(source)) {
2849
+ return value;
2850
+ }
2851
+ const legacyProjection = Array.isArray(source['properties'])
2852
+ ? uniquePhaseGatePropertyKeys(source['properties'])
2853
+ : uniquePhaseGatePropertyKeys(source['selectedProperties']);
2854
+ const roleValues = {
2855
+ rowIdentityProperty: readPropertyKey(source['rowIdentityProperty']),
2856
+ phaseNameProperty: readPropertyKey(source['phaseNameProperty']),
2857
+ phaseIdProperty: readPropertyKey(source['phaseIdProperty']),
2858
+ phaseOrderProperty: readPropertyKey(source['phaseOrderProperty']),
2859
+ phaseStatusProperty: readPropertyKey(source['phaseStatusProperty']) ||
2860
+ (options.migrateLegacy ? readPropertyKey(source['lookupProperty']) : ''),
2861
+ phaseProgressProperty: readPropertyKey(source['phaseProgressProperty']),
2862
+ phaseIsCurrentProperty: readPropertyKey(source['phaseIsCurrentProperty']),
2863
+ phaseIsCompletedProperty: readPropertyKey(source['phaseIsCompletedProperty']),
2864
+ phaseAllItemsCompletedProperty: readPropertyKey(source['phaseAllItemsCompletedProperty']),
2865
+ };
2866
+ const roleIdentities = new Set(Object.values(roleValues)
2867
+ .map(normalizePhaseGatePropertyIdentity)
2868
+ .filter(Boolean));
2869
+ const baseProperties = uniquePhaseGatePropertyKeys(Array.isArray(source['baseProperties'])
2870
+ ? source['baseProperties']
2871
+ : legacyProjection).filter((property) => !roleIdentities.has(normalizePhaseGatePropertyIdentity(property)));
2872
+ const next = {
2873
+ ...source,
2874
+ ...roleValues,
2875
+ baseProperties,
2876
+ };
2877
+ const projection = buildPhaseGateTableProjection(next);
2878
+ next['properties'] = projection;
2879
+ next['selectedProperties'] = projection;
2880
+ return next;
2881
+ }
2882
+ /**
2883
+ * Resolve a configured catalog key against a response row. The response can
2884
+ * expose that identity as its object key or inside the property wrapper.
2885
+ * Matching is exact after case/separator normalization; response order is
2886
+ * irrelevant.
2887
+ */
2888
+ function resolvePhaseGateResponseKey(row, configuredKey) {
2889
+ const target = normalizePhaseGatePropertyIdentity(configuredKey);
2890
+ if (!target || !row)
2891
+ return null;
2892
+ for (const key of Object.keys(row)) {
2893
+ const property = row[key];
2894
+ const identities = [
2895
+ key,
2896
+ property?.key,
2897
+ property?.normalizedKey,
2898
+ property?.label,
2899
+ property?.name,
2900
+ ].map(normalizePhaseGatePropertyIdentity);
2901
+ if (identities.includes(target))
2902
+ return key;
2903
+ }
2904
+ return null;
2905
+ }
2906
+ function readPropertyKey(value) {
2907
+ return typeof value === 'string' ? value.trim() : '';
2908
+ }
2909
+
2762
2910
  /**
2763
2911
  * Chart Config Normalizer.
2764
2912
  *
@@ -2832,6 +2980,19 @@ function normalizeTimelineTimeFrame(value) {
2832
2980
  }
2833
2981
  return value === 'daily' || value === 'weekly' ? 'monthly' : null;
2834
2982
  }
2983
+ /** Remove fields that belonged to the old generic table editor. */
2984
+ function toCanonicalPhaseGateTableQuery(query, options = {}) {
2985
+ const next = normalizePhaseGateTableQuery(query, options);
2986
+ [
2987
+ 'lookupProperty',
2988
+ 'PivotProperties',
2989
+ 'pivotProperties',
2990
+ 'AggregationProperties',
2991
+ 'aggregationProperties',
2992
+ 'groupByMultiple',
2993
+ ].forEach((field) => delete next[field]);
2994
+ return next;
2995
+ }
2835
2996
  /** Normalize an array of filters in place (returns a new array). */
2836
2997
  function normalizeFilters(filters) {
2837
2998
  if (!filters)
@@ -3104,6 +3265,17 @@ function normalizeOnLoad(config) {
3104
3265
  clientConfig['requestType'] = cap.requestType;
3105
3266
  }
3106
3267
  }
3268
+ // PhaseGate Table used the generic table query before the dedicated editor
3269
+ // existed. Hydrate that saved shape once the manifest identifies the chart,
3270
+ // then keep the complete backend projection deterministic on every load.
3271
+ const isPhaseGateTable = cap?.componentName === 'phaseGateTable' ||
3272
+ clientConfig['componentName'] === 'phaseGateTable' ||
3273
+ serviceConfig['componentName'] === 'phaseGateTable';
3274
+ if (serviceConfig['query'] &&
3275
+ (isPhaseGateTable || isPhaseGateTableQuery(serviceConfig['query']))) {
3276
+ serviceConfig['query'] = toCanonicalPhaseGateTableQuery(serviceConfig['query'], { migrateLegacy: isPhaseGateTable });
3277
+ delete serviceConfig['groupByMultiple'];
3278
+ }
3107
3279
  return {
3108
3280
  ...config,
3109
3281
  serviceConfig,
@@ -3165,6 +3337,10 @@ function normalizeBeforeSave(config) {
3165
3337
  }
3166
3338
  if (serviceConfig['query']) {
3167
3339
  serviceConfig['query'] = normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(serviceConfig['query']));
3340
+ if (isPhaseGateTableQuery(serviceConfig['query'])) {
3341
+ serviceConfig['query'] = toCanonicalPhaseGateTableQuery(serviceConfig['query']);
3342
+ delete serviceConfig['groupByMultiple'];
3343
+ }
3168
3344
  }
3169
3345
  // Normalize source links to BE shape.
3170
3346
  if (Array.isArray(serviceConfig['sourceLinks'])) {
@@ -3197,6 +3373,13 @@ function normalizeBeforeRequest(serviceConfig) {
3197
3373
  }
3198
3374
  if (next['query']) {
3199
3375
  next['query'] = normalizeTimelineMultiLevelQuery(normalizeAggregateFunctionsDeep(next['query']));
3376
+ const isPhaseGateTable = next['componentName'] === 'phaseGateTable';
3377
+ if (isPhaseGateTable || isPhaseGateTableQuery(next['query'])) {
3378
+ next['query'] = toCanonicalPhaseGateTableQuery(next['query'], {
3379
+ migrateLegacy: isPhaseGateTable,
3380
+ });
3381
+ delete next['groupByMultiple'];
3382
+ }
3200
3383
  }
3201
3384
  if (Array.isArray(next['selection'])) {
3202
3385
  next['selection'] = next['selection'].map((sel) => {
@@ -9799,34 +9982,95 @@ function describeGuidance(state) {
9799
9982
  return ITEM_GUIDANCE_REGISTRY[state];
9800
9983
  }
9801
9984
 
9802
- function readQuery(persisted) {
9803
- return (persisted.serviceConfig?.query ?? {});
9804
- }
9805
- function isFieldPresent(value) {
9806
- if (Array.isArray(value))
9807
- return value.length > 0;
9808
- if (value === undefined || value === null)
9985
+ /** Treat zero/false as values while rejecting blank strings and empty arrays. */
9986
+ function isQueryRequirementValuePresent(value) {
9987
+ if (value === null || value === undefined)
9809
9988
  return false;
9810
9989
  if (typeof value === 'string')
9811
9990
  return value.trim().length > 0;
9991
+ if (Array.isArray(value)) {
9992
+ return value.some((item) => isQueryRequirementValuePresent(item));
9993
+ }
9812
9994
  return true;
9813
9995
  }
9996
+ /**
9997
+ * Resolve a field from the root query or any BarV2-style series entry.
9998
+ * A field is present when at least one of those locations has a real value.
9999
+ */
10000
+ function hasQueryRequirementValue(query, field) {
10001
+ if (!query || typeof query !== 'object')
10002
+ return false;
10003
+ const queryRecord = query;
10004
+ if (isQueryRequirementValuePresent(queryRecord[field]))
10005
+ return true;
10006
+ const series = queryRecord['series'];
10007
+ if (!Array.isArray(series))
10008
+ return false;
10009
+ return series.some((entry) => !!entry &&
10010
+ typeof entry === 'object' &&
10011
+ isQueryRequirementValuePresent(entry[field]));
10012
+ }
10013
+ /**
10014
+ * Evaluate registry query requirements consistently across every UI/runtime
10015
+ * surface. `required` is an AND group; `requiredAnyOf` is one OR group.
10016
+ */
10017
+ function evaluateQueryRequirements(query, schema) {
10018
+ const required = uniqueRequirementFields(schema?.required);
10019
+ const requiredAnyOf = uniqueRequirementFields(schema?.requiredAnyOf);
10020
+ const missingRequired = required.filter((field) => !hasQueryRequirementValue(query, field));
10021
+ const hasRequiredAlternative = requiredAnyOf.length === 0 ||
10022
+ requiredAnyOf.some((field) => hasQueryRequirementValue(query, field));
10023
+ const missingRequiredAnyOf = hasRequiredAlternative ? [] : requiredAnyOf;
10024
+ return {
10025
+ satisfied: missingRequired.length === 0 && missingRequiredAnyOf.length === 0,
10026
+ missingRequired,
10027
+ missingRequiredAnyOf,
10028
+ };
10029
+ }
10030
+ function uniqueRequirementFields(fields) {
10031
+ if (!Array.isArray(fields))
10032
+ return [];
10033
+ const seen = new Set();
10034
+ const result = [];
10035
+ fields.forEach((field) => {
10036
+ if (typeof field !== 'string')
10037
+ return;
10038
+ const trimmed = field.trim();
10039
+ if (!trimmed || seen.has(trimmed))
10040
+ return;
10041
+ seen.add(trimmed);
10042
+ result.push(trimmed);
10043
+ });
10044
+ return result;
10045
+ }
10046
+
10047
+ function readQuery(persisted) {
10048
+ return (persisted.serviceConfig?.query ?? {});
10049
+ }
9814
10050
  function validateRequiredQueryFields(persisted, cap, out) {
9815
- const required = cap?.query?.schema?.required;
9816
- if (!Array.isArray(required) || required.length === 0)
10051
+ const schema = cap?.query?.schema;
10052
+ if (!schema)
9817
10053
  return;
9818
10054
  const query = readQuery(persisted);
9819
- for (const field of required) {
9820
- const present = isFieldPresent(query[field]);
9821
- if (!present) {
9822
- out.push({
9823
- domain: 'fields',
9824
- severity: 'error',
9825
- code: `missing-field:${field}`,
9826
- message: `Field "${field}" is required for this chart.`,
9827
- path: `serviceConfig.query.${field}`,
9828
- });
9829
- }
10055
+ const result = evaluateQueryRequirements(query, schema);
10056
+ for (const field of result.missingRequired) {
10057
+ out.push({
10058
+ domain: 'fields',
10059
+ severity: 'error',
10060
+ code: `missing-field:${field}`,
10061
+ message: `Field "${field}" is required for this chart.`,
10062
+ path: `serviceConfig.query.${field}`,
10063
+ });
10064
+ }
10065
+ if (result.missingRequiredAnyOf.length) {
10066
+ const alternatives = result.missingRequiredAnyOf.join(', ');
10067
+ out.push({
10068
+ domain: 'fields',
10069
+ severity: 'error',
10070
+ code: `missing-any-field:${result.missingRequiredAnyOf.join('|')}`,
10071
+ message: `At least one of "${alternatives}" is required for this chart.`,
10072
+ path: 'serviceConfig.query',
10073
+ });
9830
10074
  }
9831
10075
  }
9832
10076
  function validateDatasource(persisted, cap, out) {
@@ -10061,32 +10305,39 @@ function datasourceToUi(persisted) {
10061
10305
  * Fields domain
10062
10306
  * ========================================================================== */
10063
10307
  function fieldsFromQuery(query) {
10064
- const value = toStringSafe(query?.valueProperty);
10065
- const category = toStringSafe(query?.categoryProperty);
10066
- const formula = typeof query?.formula === 'string' ? query.formula : undefined;
10067
- const groupByRaw = query?.groupByProperties;
10068
- const groupBy = Array.isArray(groupByRaw)
10069
- ? groupByRaw.map((k) => ({
10070
- role: 'groupBy',
10071
- propertyKey: toStringSafe(k),
10072
- }))
10073
- : groupByRaw
10074
- ? [{ role: 'groupBy', propertyKey: toStringSafe(groupByRaw) }]
10075
- : [];
10076
- const propsRaw = query?.selectedProperties ?? query?.properties;
10077
- const properties = Array.isArray(propsRaw)
10078
- ? propsRaw.map((k) => ({
10079
- role: 'property',
10080
- propertyKey: toStringSafe(k),
10081
- }))
10082
- : [];
10083
- const extrasRaw = query?.extraProperties;
10084
- const extras = Array.isArray(extrasRaw)
10085
- ? extrasRaw.map((k) => ({
10086
- role: 'extra',
10087
- propertyKey: toStringSafe(k),
10088
- }))
10308
+ const root = query && typeof query === 'object' ? query : {};
10309
+ const series = Array.isArray(root.series)
10310
+ ? root.series.filter((entry) => !!entry && typeof entry === 'object')
10089
10311
  : [];
10312
+ const sources = [root, ...series];
10313
+ const firstString = (field) => {
10314
+ for (const source of sources) {
10315
+ const candidate = toStringSafe(source[field]);
10316
+ if (candidate.trim())
10317
+ return candidate;
10318
+ }
10319
+ return '';
10320
+ };
10321
+ const assignments = (role, read) => {
10322
+ const keys = new Set();
10323
+ for (const source of sources) {
10324
+ const raw = read(source);
10325
+ const values = Array.isArray(raw) ? raw : raw == null ? [] : [raw];
10326
+ for (const entry of values) {
10327
+ const propertyKey = toStringSafe(entry).trim();
10328
+ if (propertyKey)
10329
+ keys.add(propertyKey);
10330
+ }
10331
+ }
10332
+ return [...keys].map((propertyKey) => ({ role, propertyKey }));
10333
+ };
10334
+ const value = firstString('valueProperty');
10335
+ const category = firstString('categoryProperty');
10336
+ const formulaValue = firstString('formula');
10337
+ const formula = formulaValue || undefined;
10338
+ const groupBy = assignments('groupBy', (source) => source['groupByProperties']);
10339
+ const properties = assignments('property', (source) => source['selectedProperties'] ?? source['properties']);
10340
+ const extras = assignments('extra', (source) => source['extraProperties']);
10090
10341
  return {
10091
10342
  value: value ? { role: 'value', propertyKey: value } : undefined,
10092
10343
  groupBy,
@@ -10944,7 +11195,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
10944
11195
  * Number, currency, and date formatting utilities.
10945
11196
  */
10946
11197
  /**
10947
- * Format large numbers with suffixes (K, M, B, T)
11198
+ * Format currency with the host pattern, falling back to legacy K/M/B/T
11199
+ * compaction when no canonical system pattern is available.
10948
11200
  */
10949
11201
  function formatCurrency(value, config, langCode = 'en') {
10950
11202
  if (value === null || value === undefined) {
@@ -10964,8 +11216,10 @@ function formatCurrency(value, config, langCode = 'en') {
10964
11216
  };
10965
11217
  const isNegative = numValue < 0;
10966
11218
  const absValue = Math.abs(numValue);
11219
+ // System Settings is the global display contract. Per-chart decimals only
11220
+ // apply to the legacy compact formatter when no host pattern is available.
10967
11221
  let newValue = hostCurrency.source === 'systemSettings'
10968
- ? formatBySystemCurrencyPattern(absValue, hostCurrency.format, config?.decimals)
11222
+ ? formatBySystemCurrencyPattern(absValue, hostCurrency.format)
10969
11223
  : '';
10970
11224
  let suffix = '';
10971
11225
  if (!newValue && absValue >= 1_000_000_000_000) {
@@ -11013,8 +11267,9 @@ function formatCurrency(value, config, langCode = 'en') {
11013
11267
  */
11014
11268
  function getCurrencySuffix(langCode = 'en') {
11015
11269
  const currency = getHostCurrencySettings();
11016
- const resolvedUnit = langCode === 'ar' ? currency.unit.ar : currency.unit.en;
11017
- if (langCode === 'ar') {
11270
+ const useArabicUnit = langCode.trim().toLowerCase().startsWith('ar');
11271
+ const resolvedUnit = useArabicUnit ? currency.unit.ar : currency.unit.en;
11272
+ if (useArabicUnit) {
11018
11273
  return ' ' + (resolvedUnit || DEFAULT_CURRENCY.unit.ar);
11019
11274
  }
11020
11275
  return ' ' + (resolvedUnit || DEFAULT_CURRENCY.unit.en);
@@ -11094,14 +11349,14 @@ function normalizeCurrencyValue(value, source) {
11094
11349
  source,
11095
11350
  };
11096
11351
  }
11097
- function formatBySystemCurrencyPattern(value, format, explicitDecimals) {
11352
+ function formatBySystemCurrencyPattern(value, format) {
11098
11353
  const pattern = extractCurrencyPattern(format);
11099
11354
  if (!pattern) {
11100
11355
  return '';
11101
11356
  }
11102
11357
  const compactThousands = /,\s*K/i.test(pattern);
11103
11358
  const normalizedValue = compactThousands ? value / 1000 : value;
11104
- const decimals = explicitDecimals ?? resolveCurrencyPatternFractionDigits(pattern);
11359
+ const decimals = resolveCurrencyPatternFractionDigits(pattern);
11105
11360
  const useGrouping = pattern.includes('#,') || /^N\d+$/i.test(pattern);
11106
11361
  const formatted = new Intl.NumberFormat('en-US', {
11107
11362
  useGrouping,
@@ -21087,7 +21342,7 @@ class ActionService {
21087
21342
  dialogConfig?.clientConfig?.title?.['ar'] ||
21088
21343
  '';
21089
21344
  // Dynamically import DashboardDialogComponent to avoid circular dependency
21090
- import('./masterteam-dashboard-builder-dashboard-dialog.component-BcAFvvKM.mjs').then(({ DashboardDialogComponent }) => {
21345
+ import('./masterteam-dashboard-builder-dashboard-dialog.component-d6YRBVur.mjs').then(({ DashboardDialogComponent }) => {
21091
21346
  // Open dialog using ModalService
21092
21347
  this.modalService.openModal(DashboardDialogComponent, 'dialog', {
21093
21348
  header: title,
@@ -25746,10 +26001,6 @@ function fieldIdentity(prop, fallbackKey) {
25746
26001
  .filter(Boolean)
25747
26002
  .join('|');
25748
26003
  }
25749
- function matchesAnyIdentity(prop, fallbackKey, candidates) {
25750
- const identity = fieldIdentity(prop, fallbackKey);
25751
- return candidates.some((candidate) => identity.includes(normalizeIdentity(candidate)));
25752
- }
25753
26004
  function isIdentityField(prop, fallbackKey) {
25754
26005
  const identities = [
25755
26006
  normalizeIdentity(fallbackKey),
@@ -26275,23 +26526,25 @@ class TableCardComponent {
26275
26526
  this.labels.set([]);
26276
26527
  return;
26277
26528
  }
26529
+ const query = (config?.serviceConfig?.query ??
26530
+ {});
26531
+ const isCanonicalQuery = this.isCanonicalPhaseGateQuery(query);
26278
26532
  const sampleItem = this.findLargestRow(values);
26279
26533
  const fieldKeys = Object.keys(sampleItem);
26280
- const phaseFields = this.resolvePhaseGateFields(values);
26281
- const phaseFieldSet = new Set(Object.values(phaseFields)
26282
- .filter((value) => !!value)
26283
- .map((key) => key.toLowerCase()));
26284
- const configuredBaseKeys = this.resolveConfiguredTableKeys(sampleItem, config);
26534
+ const phaseFields = this.resolvePhaseGateFields(values, query, isCanonicalQuery);
26535
+ const configuredBaseKeys = this.resolveConfiguredTableKeys(values, query, isCanonicalQuery);
26285
26536
  const baseKeys = (configuredBaseKeys ?? fieldKeys).filter((key) => {
26286
- const prop = sampleItem[key];
26287
- if (phaseFieldSet.has(key.toLowerCase()))
26537
+ const prop = this.findFirstFieldValue(values, key);
26538
+ if (this.isConfiguredPhaseMetadataField(prop, key, phaseFields)) {
26288
26539
  return false;
26289
- if (this.isPhaseGateMetaField(prop, key))
26540
+ }
26541
+ if (!isCanonicalQuery && this.isLegacyPhaseGateMetaField(prop, key)) {
26290
26542
  return false;
26543
+ }
26291
26544
  return true;
26292
26545
  });
26293
26546
  const baseColumns = baseKeys.map((key, index) => {
26294
- const prop = sampleItem[key];
26547
+ const prop = this.findFirstFieldValue(values, key);
26295
26548
  const overrideLabel = overrideLabels?.[key.toLowerCase()]?.[languageCode];
26296
26549
  return {
26297
26550
  key: !isIdentityField(prop, key) && prop?.normalizedKey
@@ -26308,24 +26561,25 @@ class TableCardComponent {
26308
26561
  };
26309
26562
  });
26310
26563
  const phaseOrder = new Map();
26311
- values.forEach((item, index) => {
26564
+ values.forEach((item, encounterOrder) => {
26312
26565
  const row = getObjectKeysInLowerCase(item);
26313
- const phaseValue = phaseFields.phaseName
26314
- ? row[phaseFields.phaseName.toLowerCase()]
26315
- : null;
26316
- const phaseIdValue = phaseFields.phaseId
26317
- ? row[phaseFields.phaseId.toLowerCase()]
26318
- : null;
26566
+ const phaseValue = this.getPhaseGateFieldValue(row, phaseFields.phaseName);
26567
+ const phaseIdValue = this.getPhaseGateFieldValue(row, phaseFields.phaseId);
26319
26568
  const phaseLabel = displayEntityValue(phaseValue) ||
26320
26569
  displayEntityValue(phaseIdValue) ||
26321
- `Phase ${index + 1}`;
26322
- const phaseKey = this.toPhaseColumnKey(phaseLabel, phaseIdValue, index);
26570
+ 'Phase';
26571
+ const phaseIdentity = phaseFields.phaseId ? phaseIdValue : phaseValue;
26572
+ const phaseKey = this.toPhaseColumnKey(phaseIdentity, phaseLabel);
26323
26573
  if (!phaseOrder.has(phaseKey)) {
26324
- phaseOrder.set(phaseKey, { label: phaseLabel, order: index });
26574
+ phaseOrder.set(phaseKey, {
26575
+ label: phaseLabel,
26576
+ orderValue: this.getPhaseGateFieldValue(row, phaseFields.phaseOrder),
26577
+ encounterOrder,
26578
+ });
26325
26579
  }
26326
26580
  });
26327
26581
  const phaseColumns = Array.from(phaseOrder.entries())
26328
- .sort((a, b) => a[1].order - b[1].order)
26582
+ .sort((a, b) => this.comparePhaseGateOrder(a, b, phaseFields.phaseOrder !== null))
26329
26583
  .map(([key, value]) => ({
26330
26584
  key,
26331
26585
  label: value.label,
@@ -26334,33 +26588,41 @@ class TableCardComponent {
26334
26588
  }));
26335
26589
  const rowMap = new Map();
26336
26590
  const statusLabels = new Map();
26337
- values.forEach((item, rowIndex) => {
26591
+ values.forEach((item) => {
26338
26592
  const row = getObjectKeysInLowerCase(item);
26339
- const groupKey = this.getPhaseGateGroupKey(row, baseColumns, rowIndex);
26593
+ const groupKey = isCanonicalQuery
26594
+ ? this.getCanonicalPhaseGateGroupKey(row, phaseFields.rowIdentity)
26595
+ : this.getLegacyPhaseGateGroupKey(row, baseColumns);
26340
26596
  let rowData = rowMap.get(groupKey);
26341
26597
  if (!rowData) {
26342
26598
  rowData = { _index: rowMap.size, _original: item };
26343
26599
  baseColumns.forEach((col) => {
26344
- if (col.keyPure && row[col.keyPure]) {
26600
+ if (col.keyPure &&
26601
+ Object.prototype.hasOwnProperty.call(row, col.keyPure)) {
26345
26602
  rowData[col.key] = row[col.keyPure];
26346
26603
  }
26347
26604
  });
26348
- const idKey = Object.keys(row).find((key) => isIdentityField(row[key], key));
26349
- if (idKey) {
26350
- rowData['Id'] = row[idKey];
26605
+ if (isCanonicalQuery) {
26606
+ const identityValue = this.getPhaseGateFieldValue(row, phaseFields.rowIdentity);
26607
+ if (identityValue !== null && identityValue !== undefined) {
26608
+ rowData['Id'] = identityValue;
26609
+ }
26610
+ }
26611
+ else {
26612
+ const idKey = Object.keys(row).find((key) => isIdentityField(row[key], key));
26613
+ if (idKey) {
26614
+ rowData['Id'] = row[idKey];
26615
+ }
26351
26616
  }
26352
26617
  rowMap.set(groupKey, rowData);
26353
26618
  }
26354
- const phaseValue = phaseFields.phaseName
26355
- ? row[phaseFields.phaseName.toLowerCase()]
26356
- : null;
26357
- const phaseIdValue = phaseFields.phaseId
26358
- ? row[phaseFields.phaseId.toLowerCase()]
26359
- : null;
26619
+ const phaseValue = this.getPhaseGateFieldValue(row, phaseFields.phaseName);
26620
+ const phaseIdValue = this.getPhaseGateFieldValue(row, phaseFields.phaseId);
26360
26621
  const phaseLabel = displayEntityValue(phaseValue) ||
26361
26622
  displayEntityValue(phaseIdValue) ||
26362
- `Phase ${rowIndex + 1}`;
26363
- const phaseColumnKey = this.toPhaseColumnKey(phaseLabel, phaseIdValue, rowIndex);
26623
+ 'Phase';
26624
+ const phaseIdentity = phaseFields.phaseId ? phaseIdValue : phaseValue;
26625
+ const phaseColumnKey = this.toPhaseColumnKey(phaseIdentity, phaseLabel);
26364
26626
  const cell = this.buildPhaseGateCell(row, phaseFields, item, phaseLabel);
26365
26627
  if (cell.statusLabel) {
26366
26628
  statusLabels.set(cell.statusLabel.toLowerCase(), {
@@ -26385,29 +26647,32 @@ class TableCardComponent {
26385
26647
  }
26386
26648
  return Array.isArray(data?.values) ? data.values : [];
26387
26649
  }
26388
- resolveConfiguredTableKeys(sampleItem, config) {
26389
- const query = config?.serviceConfig?.query ?? {};
26390
- const hasConfiguredList = Object.prototype.hasOwnProperty.call(query, 'selectedProperties') ||
26391
- Object.prototype.hasOwnProperty.call(query, 'properties');
26392
- const configured = [
26393
- ...this.toStringArray(query['selectedProperties']),
26394
- ...this.toStringArray(query['properties']),
26395
- ];
26650
+ resolveConfiguredTableKeys(values, query, isCanonicalQuery) {
26651
+ const hasConfiguredList = isCanonicalQuery
26652
+ ? Object.prototype.hasOwnProperty.call(query, 'baseProperties')
26653
+ : Object.prototype.hasOwnProperty.call(query, 'selectedProperties') ||
26654
+ Object.prototype.hasOwnProperty.call(query, 'properties');
26655
+ const configured = isCanonicalQuery
26656
+ ? this.toStringArray(query['baseProperties'])
26657
+ : [
26658
+ ...this.toStringArray(query['properties']),
26659
+ ...this.toStringArray(query['selectedProperties']),
26660
+ ];
26396
26661
  if (!configured.length)
26397
26662
  return hasConfiguredList ? [] : null;
26398
- const keyByIdentity = new Map();
26399
- Object.keys(sampleItem || {}).forEach((key) => {
26400
- const prop = sampleItem[key];
26401
- [key, prop?.key, prop?.normalizedKey, prop?.label, prop?.name].forEach((identity) => {
26402
- const normalized = normalizeIdentity(identity);
26403
- if (normalized && !keyByIdentity.has(normalized)) {
26404
- keyByIdentity.set(normalized, key);
26405
- }
26406
- });
26663
+ const seen = new Set();
26664
+ const resolved = [];
26665
+ configured.forEach((configuredKey) => {
26666
+ const responseKey = this.resolvePhaseGateFieldKey(values, configuredKey);
26667
+ if (!responseKey)
26668
+ return;
26669
+ const normalized = normalizePhaseGatePropertyIdentity(responseKey);
26670
+ if (seen.has(normalized))
26671
+ return;
26672
+ seen.add(normalized);
26673
+ resolved.push(responseKey.toLowerCase());
26407
26674
  });
26408
- return Array.from(new Set(configured
26409
- .map((key) => keyByIdentity.get(normalizeIdentity(key)))
26410
- .filter((key) => !!key)));
26675
+ return resolved;
26411
26676
  }
26412
26677
  toStringArray(value) {
26413
26678
  if (!Array.isArray(value))
@@ -26424,120 +26689,267 @@ class TableCardComponent {
26424
26689
  });
26425
26690
  return sample;
26426
26691
  }
26427
- resolvePhaseGateFields(values) {
26692
+ isCanonicalPhaseGateQuery(query) {
26693
+ return [
26694
+ query.rowIdentityProperty,
26695
+ query.phaseNameProperty,
26696
+ query.phaseStatusProperty,
26697
+ ].every((value) => typeof value === 'string' && value.trim().length > 0);
26698
+ }
26699
+ resolvePhaseGateFields(values, query, isCanonicalQuery) {
26700
+ const configuredFields = {
26701
+ rowIdentity: this.readPhaseGateProperty(query.rowIdentityProperty),
26702
+ phaseName: this.readPhaseGateProperty(query.phaseNameProperty),
26703
+ phaseId: this.readPhaseGateProperty(query.phaseIdProperty),
26704
+ phaseOrder: this.readPhaseGateProperty(query.phaseOrderProperty),
26705
+ isCurrent: this.readPhaseGateProperty(query.phaseIsCurrentProperty),
26706
+ isCompleted: this.readPhaseGateProperty(query.phaseIsCompletedProperty),
26707
+ allItemsCompleted: this.readPhaseGateProperty(query.phaseAllItemsCompletedProperty),
26708
+ status: this.readPhaseGateProperty(query.phaseStatusProperty),
26709
+ percentage: this.readPhaseGateProperty(query.phaseProgressProperty),
26710
+ };
26711
+ if (isCanonicalQuery)
26712
+ return configuredFields;
26713
+ // A partially migrated dashboard remains on the legacy path, but any
26714
+ // explicit semantic role still wins and is resolved exactly.
26715
+ const lookupProperty = this.readPhaseGateProperty(query['lookupProperty']);
26428
26716
  const fields = {
26429
- phaseName: null,
26430
- phaseId: null,
26431
- isCurrent: null,
26432
- isCompleted: null,
26433
- allItemsCompleted: null,
26434
- status: null,
26435
- percentage: null,
26717
+ ...configuredFields,
26718
+ status: configuredFields.status || lookupProperty,
26436
26719
  };
26437
- const candidateKeys = Array.from(new Set(values.flatMap((item) => Object.keys(getObjectKeysInLowerCase(item)))));
26438
- for (const key of candidateKeys) {
26439
- const prop = this.findFirstFieldValue(values, key);
26440
- const viewType = normalizeIdentity(prop?.viewType);
26441
- if (!fields.phaseName &&
26442
- matchesAnyIdentity(prop, key, ['phase_name', 'phasegate_name'])) {
26443
- fields.phaseName = key;
26444
- continue;
26445
- }
26446
- if (!fields.phaseId &&
26447
- matchesAnyIdentity(prop, key, ['phase_schemagateid', 'phasegateid'])) {
26448
- fields.phaseId = key;
26449
- continue;
26450
- }
26451
- if (!fields.isCurrent &&
26452
- matchesAnyIdentity(prop, key, ['phase_iscurrent', 'iscurrentphase'])) {
26453
- fields.isCurrent = key;
26454
- continue;
26455
- }
26456
- if (!fields.isCompleted &&
26457
- matchesAnyIdentity(prop, key, ['phase_iscompleted', 'iscompletedphase'])) {
26458
- fields.isCompleted = key;
26459
- continue;
26460
- }
26461
- if (!fields.allItemsCompleted &&
26462
- matchesAnyIdentity(prop, key, [
26463
- 'phase_all_items_completed',
26464
- 'allitemscompleted',
26465
- ])) {
26466
- fields.allItemsCompleted = key;
26467
- continue;
26468
- }
26469
- if (!fields.status &&
26470
- (viewType === 'status' ||
26471
- viewType === 'requeststatus' ||
26472
- matchesAnyIdentity(prop, key, ['status']))) {
26473
- fields.status = key;
26474
- continue;
26475
- }
26476
- if (!fields.percentage &&
26477
- (viewType === 'percentage' ||
26478
- viewType === 'slider' ||
26479
- matchesAnyIdentity(prop, key, ['percentage', 'progress']))) {
26480
- fields.percentage = key;
26481
- }
26482
- }
26720
+ fields.phaseName ??= this.resolveLegacyPhaseGateAlias(values, [
26721
+ 'phase_name',
26722
+ 'phasegate_name',
26723
+ ]);
26724
+ fields.phaseId ??= this.resolveLegacyPhaseGateAlias(values, [
26725
+ 'phase_schemagateid',
26726
+ 'phasegate_id',
26727
+ 'phasegateid',
26728
+ ]);
26729
+ fields.phaseOrder ??= this.resolveLegacyPhaseGateAlias(values, [
26730
+ 'phase_order',
26731
+ 'phasegate_order',
26732
+ 'phase_sequence',
26733
+ ]);
26734
+ fields.isCurrent ??= this.resolveLegacyPhaseGateAlias(values, [
26735
+ 'phase_iscurrent',
26736
+ 'phasegate_iscurrent',
26737
+ 'iscurrentphase',
26738
+ ]);
26739
+ fields.isCompleted ??= this.resolveLegacyPhaseGateAlias(values, [
26740
+ 'phase_iscompleted',
26741
+ 'phasegate_iscompleted',
26742
+ 'iscompletedphase',
26743
+ ]);
26744
+ fields.allItemsCompleted ??= this.resolveLegacyPhaseGateAlias(values, [
26745
+ 'phase_all_items_completed',
26746
+ 'phasegate_all_items_completed',
26747
+ 'allitemscompleted',
26748
+ ]);
26749
+ fields.status ??= this.resolveLegacyPhaseGateAlias(values, [
26750
+ 'phase_status',
26751
+ 'phasegate_status',
26752
+ 'phase_request_status',
26753
+ 'phasegate_request_status',
26754
+ ]);
26755
+ fields.percentage ??= this.resolveLegacyPhaseGateAlias(values, [
26756
+ 'phase_percentage',
26757
+ 'phasegate_percentage',
26758
+ 'phase_progress',
26759
+ 'phasegate_progress',
26760
+ ]);
26761
+ fields.status ??= this.resolveLegacyFieldByViewType(values, [
26762
+ 'status',
26763
+ 'requeststatus',
26764
+ ]);
26765
+ fields.percentage ??= this.resolveLegacyFieldByViewType(values, [
26766
+ 'percentage',
26767
+ 'slider',
26768
+ ]);
26483
26769
  return fields;
26484
26770
  }
26485
26771
  findFirstFieldValue(values, key) {
26486
26772
  const normalizedKey = key.toLowerCase();
26487
26773
  for (const item of values) {
26488
26774
  const row = getObjectKeysInLowerCase(item);
26489
- if (row[normalizedKey])
26775
+ if (Object.prototype.hasOwnProperty.call(row, normalizedKey)) {
26490
26776
  return row[normalizedKey];
26777
+ }
26778
+ }
26779
+ return null;
26780
+ }
26781
+ readPhaseGateProperty(value) {
26782
+ return typeof value === 'string' && value.trim() ? value.trim() : null;
26783
+ }
26784
+ resolvePhaseGateFieldKey(values, configuredKey) {
26785
+ if (!configuredKey)
26786
+ return null;
26787
+ for (const item of values) {
26788
+ const row = getObjectKeysInLowerCase(item);
26789
+ const key = resolvePhaseGateResponseKey(row, configuredKey);
26790
+ if (key)
26791
+ return key;
26491
26792
  }
26492
26793
  return null;
26493
26794
  }
26494
- isPhaseGateMetaField(prop, key) {
26495
- const viewType = normalizeIdentity(prop?.viewType);
26496
- return (matchesAnyIdentity(prop, key, [
26795
+ resolveLegacyPhaseGateAlias(values, aliases) {
26796
+ for (const alias of aliases) {
26797
+ const key = this.resolvePhaseGateFieldKey(values, alias);
26798
+ if (key)
26799
+ return key;
26800
+ }
26801
+ return null;
26802
+ }
26803
+ resolveLegacyFieldByViewType(values, viewTypes) {
26804
+ const allowedTypes = new Set(viewTypes.map(normalizeIdentity));
26805
+ const candidateKeys = Array.from(new Set(values.flatMap((item) => Object.keys(getObjectKeysInLowerCase(item))))).sort((left, right) => {
26806
+ const leftProp = this.findFirstFieldValue(values, left);
26807
+ const rightProp = this.findFirstFieldValue(values, right);
26808
+ const leftIdentity = fieldIdentity(leftProp, left);
26809
+ const rightIdentity = fieldIdentity(rightProp, right);
26810
+ const leftPhaseRank = leftIdentity.includes('phasegate')
26811
+ ? 0
26812
+ : leftIdentity.includes('phase')
26813
+ ? 1
26814
+ : 2;
26815
+ const rightPhaseRank = rightIdentity.includes('phasegate')
26816
+ ? 0
26817
+ : rightIdentity.includes('phase')
26818
+ ? 1
26819
+ : 2;
26820
+ if (leftPhaseRank !== rightPhaseRank) {
26821
+ return leftPhaseRank - rightPhaseRank;
26822
+ }
26823
+ return leftIdentity.localeCompare(rightIdentity, undefined, {
26824
+ numeric: true,
26825
+ sensitivity: 'base',
26826
+ });
26827
+ });
26828
+ return (candidateKeys.find((key) => {
26829
+ const prop = this.findFirstFieldValue(values, key);
26830
+ return allowedTypes.has(normalizeIdentity(prop?.viewType));
26831
+ }) ?? null);
26832
+ }
26833
+ getPhaseGateFieldValue(row, property) {
26834
+ if (!property)
26835
+ return null;
26836
+ const responseKey = resolvePhaseGateResponseKey(row, property);
26837
+ return responseKey ? row[responseKey] : null;
26838
+ }
26839
+ isConfiguredPhaseMetadataField(prop, key, fields) {
26840
+ const phaseMetadataRoles = [
26841
+ fields.phaseName,
26842
+ fields.phaseId,
26843
+ fields.phaseOrder,
26844
+ fields.status,
26845
+ fields.percentage,
26846
+ fields.isCurrent,
26847
+ fields.isCompleted,
26848
+ fields.allItemsCompleted,
26849
+ ];
26850
+ const row = { [key]: prop };
26851
+ return phaseMetadataRoles.some((role) => !!role && resolvePhaseGateResponseKey(row, role) === key);
26852
+ }
26853
+ isLegacyPhaseGateMetaField(prop, key) {
26854
+ const aliases = [
26497
26855
  'phase_name',
26856
+ 'phasegate_name',
26498
26857
  'phase_schemagateid',
26858
+ 'phasegate_id',
26859
+ 'phase_order',
26860
+ 'phasegate_order',
26499
26861
  'phase_iscurrent',
26862
+ 'phasegate_iscurrent',
26500
26863
  'phase_iscompleted',
26864
+ 'phasegate_iscompleted',
26501
26865
  'phase_all_items_completed',
26502
- ]) ||
26503
- viewType === 'status' ||
26504
- viewType === 'requeststatus' ||
26505
- viewType === 'percentage' ||
26506
- viewType === 'slider');
26507
- }
26508
- toPhaseColumnKey(label, idValue, fallbackIndex) {
26509
- const id = unwrapEntityValue(idValue);
26510
- const source = id || label || fallbackIndex;
26511
- return `_phase_${normalizeIdentity(source) || fallbackIndex}`;
26512
- }
26513
- getPhaseGateGroupKey(row, baseColumns, rowIndex) {
26866
+ 'phasegate_all_items_completed',
26867
+ 'phase_status',
26868
+ 'phasegate_status',
26869
+ 'phase_request_status',
26870
+ 'phasegate_request_status',
26871
+ 'phase_percentage',
26872
+ 'phasegate_percentage',
26873
+ 'phase_progress',
26874
+ 'phasegate_progress',
26875
+ ];
26876
+ const row = { [key]: prop };
26877
+ return aliases.some((alias) => resolvePhaseGateResponseKey(row, alias) === key);
26878
+ }
26879
+ toPhaseColumnKey(identityValue, fallbackLabel) {
26880
+ const primitiveIdentity = unwrapEntityValue(identityValue);
26881
+ const identity = normalizePhaseGatePropertyIdentity(primitiveIdentity || fallbackLabel || 'unknown');
26882
+ return `_phase_${identity || 'unknown'}`;
26883
+ }
26884
+ comparePhaseGateOrder(left, right, hasConfiguredOrder) {
26885
+ if (!hasConfiguredOrder) {
26886
+ return left[1].encounterOrder - right[1].encounterOrder;
26887
+ }
26888
+ const leftOrder = displayEntityValue(left[1].orderValue);
26889
+ const rightOrder = displayEntityValue(right[1].orderValue);
26890
+ if (leftOrder && rightOrder) {
26891
+ const leftNumber = Number(leftOrder);
26892
+ const rightNumber = Number(rightOrder);
26893
+ if (Number.isFinite(leftNumber) && Number.isFinite(rightNumber)) {
26894
+ const numericComparison = leftNumber - rightNumber;
26895
+ if (numericComparison !== 0)
26896
+ return numericComparison;
26897
+ }
26898
+ else {
26899
+ const textComparison = leftOrder.localeCompare(rightOrder, undefined, {
26900
+ numeric: true,
26901
+ sensitivity: 'base',
26902
+ });
26903
+ if (textComparison !== 0)
26904
+ return textComparison;
26905
+ }
26906
+ }
26907
+ else if (leftOrder || rightOrder) {
26908
+ return leftOrder ? -1 : 1;
26909
+ }
26910
+ const labelComparison = left[1].label.localeCompare(right[1].label, undefined, { numeric: true, sensitivity: 'base' });
26911
+ return labelComparison || left[0].localeCompare(right[0]);
26912
+ }
26913
+ getCanonicalPhaseGateGroupKey(row, rowIdentityProperty) {
26914
+ const identityValue = this.getPhaseGateFieldValue(row, rowIdentityProperty);
26915
+ return `id:${this.toStablePhaseGateValue(identityValue)}`;
26916
+ }
26917
+ getLegacyPhaseGateGroupKey(row, baseColumns) {
26514
26918
  const identityColumn = baseColumns.find((col) => col.keyPure && isIdentityField(row[col.keyPure], col.keyPure));
26515
26919
  if (identityColumn?.keyPure) {
26516
- return `id:${String(unwrapEntityValue(row[identityColumn.keyPure]))}`;
26920
+ return `id:${this.toStablePhaseGateValue(row[identityColumn.keyPure])}`;
26517
26921
  }
26518
26922
  const parts = baseColumns
26519
26923
  .filter((col) => col.keyPure)
26520
- .map((col) => displayEntityValue(row[col.keyPure]));
26521
- return parts.some(Boolean) ? parts.join('|') : `row:${rowIndex}`;
26924
+ .map((col) => this.toStablePhaseGateValue(row[col.keyPure]));
26925
+ return parts.some(Boolean)
26926
+ ? `values:${JSON.stringify(parts)}`
26927
+ : 'values:unidentified';
26928
+ }
26929
+ toStablePhaseGateValue(value) {
26930
+ const primitive = unwrapEntityValue(value);
26931
+ if (primitive === null || primitive === undefined)
26932
+ return '';
26933
+ if (typeof primitive !== 'object')
26934
+ return String(primitive);
26935
+ return displayEntityValue(primitive);
26522
26936
  }
26523
26937
  buildPhaseGateCell(row, fields, original, phaseName) {
26524
- const statusValue = fields.status ? row[fields.status.toLowerCase()] : null;
26525
- const percentageValue = fields.percentage
26526
- ? row[fields.percentage.toLowerCase()]
26527
- : null;
26938
+ const statusValue = this.getPhaseGateFieldValue(row, fields.status);
26939
+ const percentageValue = this.getPhaseGateFieldValue(row, fields.percentage);
26528
26940
  return {
26529
26941
  phaseName,
26530
26942
  statusLabel: displayEntityValue(statusValue),
26531
26943
  statusColor: getEntityColor(statusValue),
26532
26944
  percentage: toNumberValue(percentageValue),
26533
26945
  isCurrent: fields.isCurrent
26534
- ? toBooleanValue(row[fields.isCurrent.toLowerCase()])
26946
+ ? toBooleanValue(this.getPhaseGateFieldValue(row, fields.isCurrent))
26535
26947
  : false,
26536
26948
  isCompleted: fields.isCompleted
26537
- ? toBooleanValue(row[fields.isCompleted.toLowerCase()])
26949
+ ? toBooleanValue(this.getPhaseGateFieldValue(row, fields.isCompleted))
26538
26950
  : false,
26539
26951
  allItemsCompleted: fields.allItemsCompleted
26540
- ? toBooleanValue(row[fields.allItemsCompleted.toLowerCase()])
26952
+ ? toBooleanValue(this.getPhaseGateFieldValue(row, fields.allItemsCompleted))
26541
26953
  : false,
26542
26954
  raw: original,
26543
26955
  };
@@ -28977,16 +29389,10 @@ class DashboardItem {
28977
29389
  if (hasCustomApi)
28978
29390
  return false;
28979
29391
  const query = config.serviceConfig?.query;
28980
- const firstSeries = Array.isArray(query?.['series'])
28981
- ? query?.['series']?.[0]
28982
- : null;
28983
- const hasFormula = !this.isMissingQueryValue(firstSeries?.['formula'] ?? query?.['formula']);
28984
29392
  const configAsType = config.clientConfig?.configAsType;
28985
29393
  const hasRingGaugeConfig = !!configAsType?.['ringGaugeConfig'];
28986
- const isRingGaugeFormula = config.clientConfig?.functionName === 'handleRingGaugeChartWithFormula' ||
28987
- String(this.chartTypeId() ?? '') === 'ring-gauge-chart-with-formula';
28988
29394
  const isLegacyRingGaugeFormula = config.serviceConfig?.chartType === 'BarV2Chart' && hasRingGaugeConfig;
28989
- if ((isRingGaugeFormula && hasFormula) || isLegacyRingGaugeFormula) {
29395
+ if (isLegacyRingGaugeFormula) {
28990
29396
  return false;
28991
29397
  }
28992
29398
  const cap = resolveCapability({
@@ -28995,23 +29401,19 @@ class DashboardItem {
28995
29401
  componentName,
28996
29402
  functionName: config.clientConfig?.functionName ?? null,
28997
29403
  });
28998
- const requiredFields = cap?.query.schema?.required ?? [];
28999
- const hasRequiredQueryFields = requiredFields.length > 0 &&
29000
- requiredFields.every((field) => {
29001
- const value = firstSeries?.[field] ?? query?.[field];
29002
- return !this.isMissingQueryValue(value);
29003
- });
29404
+ const requirementSchema = cap?.query.schema;
29405
+ const requirementEvaluation = evaluateQueryRequirements(query, requirementSchema);
29406
+ const hasDeclaredQueryRequirements = !!(requirementSchema?.required?.length ||
29407
+ requirementSchema?.requiredAnyOf?.length);
29408
+ const hasRequiredQueryFields = hasDeclaredQueryRequirements && requirementEvaluation.satisfied;
29004
29409
  if (cap?.selection.visible !== false &&
29005
29410
  !hasSelection &&
29006
29411
  !hasRequiredQueryFields) {
29007
29412
  return true;
29008
29413
  }
29009
- if (!requiredFields.length)
29414
+ if (!hasDeclaredQueryRequirements)
29010
29415
  return false;
29011
- return requiredFields.some((field) => {
29012
- const value = firstSeries?.[field] ?? query?.[field];
29013
- return this.isMissingQueryValue(value);
29014
- });
29416
+ return !requirementEvaluation.satisfied;
29015
29417
  }, ...(ngDevMode ? [{ debugName: "missingRequiredConfiguration" }] : /* istanbul ignore next */ []));
29016
29418
  needsConfiguration = computed(() => {
29017
29419
  if (!this.builderMode())
@@ -29110,12 +29512,6 @@ class DashboardItem {
29110
29512
  initialized = false;
29111
29513
  /** Track current dashboardId to detect changes */
29112
29514
  currentDashboardId = null;
29113
- isMissingQueryValue(value) {
29114
- return (value === null ||
29115
- value === undefined ||
29116
- value === '' ||
29117
- (Array.isArray(value) && value.length === 0));
29118
- }
29119
29515
  // ============================================
29120
29516
  // Lifecycle
29121
29517
  // ============================================
@@ -29495,20 +29891,12 @@ class ChartViewer {
29495
29891
  if (cap?.selection.visible !== false && !hasSelection) {
29496
29892
  return false;
29497
29893
  }
29498
- const requiredFields = cap?.query.schema?.required ?? [];
29499
- if (!requiredFields.length)
29894
+ const schema = cap?.query.schema;
29895
+ const hasDeclaredRequirements = !!(schema?.required?.length || schema?.requiredAnyOf?.length);
29896
+ if (!hasDeclaredRequirements)
29500
29897
  return true;
29501
- const query = config.serviceConfig?.query;
29502
- const firstSeries = Array.isArray(query?.['series'])
29503
- ? query?.['series']?.[0]
29504
- : null;
29505
- return requiredFields.every((field) => {
29506
- const value = firstSeries?.[field] ?? query?.[field];
29507
- return !(value === null ||
29508
- value === undefined ||
29509
- value === '' ||
29510
- (Array.isArray(value) && value.length === 0));
29511
- });
29898
+ return evaluateQueryRequirements(config.serviceConfig?.query, schema)
29899
+ .satisfied;
29512
29900
  }, ...(ngDevMode ? [{ debugName: "canPreview" }] : /* istanbul ignore next */ []));
29513
29901
  /**
29514
29902
  * Refresh the preview with a local overlay. The rendered chart stays mounted
@@ -32370,6 +32758,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32370
32758
  ], template: "<div\r\n class=\"mt-string-array-input flex flex-col gap-2\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n>\r\n @if (label()) {\r\n <label class=\"text-sm font-medium text-surface-700\">{{ label() }}</label>\r\n }\r\n\r\n <!-- Add picker: selecting an option appends it and resets the field. -->\r\n <mt-select-field\r\n [field]=\"false\"\r\n [options]=\"availableOptions()\"\r\n [group]=\"group()\"\r\n [optionLabel]=\"resolvedOptionLabelKey\"\r\n [optionValue]=\"optionValue()\"\r\n [optionGroupLabel]=\"optionGroupLabel()\"\r\n [optionGroupChildren]=\"optionGroupChildren()\"\r\n [filter]=\"filter()\"\r\n [placeholder]=\"placeholder() || t('addProperty')\"\r\n [readonly]=\"disabled()\"\r\n [ngModel]=\"addSelectValue()\"\r\n (ngModelChange)=\"onAdd($event)\"\r\n />\r\n\r\n <!-- Selected values: inline chips, drag to reorder, \u00D7 to remove. -->\r\n @if (values().length) {\r\n <div\r\n cdkDropList\r\n cdkDropListOrientation=\"mixed\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"grid grid-cols-4 gap-2\"\r\n >\r\n @for (key of values(); track key + $index; let i = $index) {\r\n <div\r\n cdkDrag\r\n [cdkDragDisabled]=\"disabled()\"\r\n class=\"mt-sai-chip group flex w-full items-center gap-1.5 rounded-md border border-surface-200 bg-surface-50 py-1 pl-2 pr-1 text-sm\"\r\n [class.cursor-grab]=\"!disabled()\"\r\n [pTooltip]=\"t('dragToReorder')\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"shrink-0 text-sm text-muted-color\"\r\n />\r\n\r\n <span\r\n class=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-surface-200 px-1 text-[10px] font-semibold text-muted-color\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n\r\n <span\r\n class=\"min-w-0 flex-1 truncate\"\r\n mtTruncateTooltip\r\n tooltipPosition=\"top\"\r\n >{{ getLabel(key) }}</span\r\n >\r\n\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-color transition-colors hover:bg-red-100 hover:text-red-600\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"t('remove')\"\r\n (click)=\"remove(i)\"\r\n >\r\n <mt-icon icon=\"general.x-close\" class=\"text-xs\" />\r\n </button>\r\n\r\n <!-- Lifted chip shown while dragging (matches the real chip). -->\r\n <div\r\n *cdkDragPreview\r\n class=\"inline-flex items-center gap-1.5 rounded-full border border-surface-300 bg-surface-0 py-1 pl-2 pr-3 text-sm font-medium text-color\"\r\n >\r\n <mt-icon\r\n icon=\"general.dots-grid\"\r\n class=\"text-sm text-muted-color\"\r\n />\r\n {{ getLabel(key) }}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if (emptyHint()) {\r\n <p class=\"text-xs text-muted-color\">{{ emptyHint() }}</p>\r\n }\r\n</div>\r\n", styles: [".mt-string-array-input .cdk-drag-animating,.cdk-drop-list-dragging .mt-sai-chip{transition:none}.mt-string-array-input .cdk-drag-placeholder{border-style:dashed;border-color:var(--p-primary-400, #818cf8);background:var(--p-primary-50, #eef2ff)}.mt-string-array-input .cdk-drag-placeholder>*{visibility:hidden}.mt-string-array-input .cdk-drag-preview{box-shadow:0 10px 20px -8px #00000040,0 4px 8px -4px #00000026}\n"] }]
32371
32759
  }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionGroupLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupLabel", required: false }] }], optionGroupChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionGroupChildren", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], emptyHint: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyHint", required: false }] }] } });
32372
32760
 
32761
+ /** Localized action key for the per-series advanced-settings disclosure. */
32762
+ function getAdvancedSettingsActionKey(expanded) {
32763
+ return expanded ? 'hideAdvancedSettings' : 'showAdvancedSettings';
32764
+ }
32765
+ /** Build a stable, HTML-safe base id shared by the trigger and its region. */
32766
+ function buildAdvancedSettingsId(chartType, seriesKey, seriesIndex) {
32767
+ const chart = toHtmlIdSegment(chartType) || 'chart';
32768
+ const series = toHtmlIdSegment(seriesKey) || String(seriesIndex);
32769
+ return `mt-general-query-${chart}-${series}-advanced`;
32770
+ }
32771
+ function toHtmlIdSegment(value) {
32772
+ return String(value ?? '')
32773
+ .trim()
32774
+ .replace(/[^a-zA-Z0-9_-]+/g, '-');
32775
+ }
32776
+
32777
+ /**
32778
+ * Adapt the shared query requirement evaluator to one GeneralQuery series.
32779
+ * Keeping this pure makes the editor's AND/OR requirement contract easy to
32780
+ * verify without constructing the Angular form component.
32781
+ */
32782
+ function validateGeneralQuerySeriesRequirements(series, schema) {
32783
+ const evaluation = evaluateQueryRequirements({ series: [series] }, schema);
32784
+ return evaluation.satisfied ? null : { queryRequirements: evaluation };
32785
+ }
32786
+
32373
32787
  /**
32374
32788
  * General Query Component
32375
32789
  *
@@ -32624,8 +33038,14 @@ class GeneralQuery {
32624
33038
  formula: [s.formula || '', formulaValidators],
32625
33039
  showAdvancedSettings: [s.showAdvancedSettings ?? false],
32626
33040
  barType: [s.barType || 'bar'],
33041
+ }, {
33042
+ validators: [(control) => this.validateSeriesRequirements(control)],
32627
33043
  });
32628
33044
  }
33045
+ validateSeriesRequirements(control) {
33046
+ const value = control instanceof FormGroup ? control.getRawValue() : control.value;
33047
+ return validateGeneralQuerySeriesRequirements(value, this.querySchema());
33048
+ }
32629
33049
  createFilterFormGroup(filter) {
32630
33050
  const f = filter || {};
32631
33051
  return this.fb.group({
@@ -32646,6 +33066,18 @@ class GeneralQuery {
32646
33066
  const current = series.get('showAdvancedSettings')?.value;
32647
33067
  series.patchValue({ showAdvancedSettings: !current });
32648
33068
  }
33069
+ /** Stable disclosure trigger id for a series' Formula Builder. */
33070
+ advancedSettingsToggleId(seriesIndex) {
33071
+ return `${this.advancedSettingsId(seriesIndex)}-toggle`;
33072
+ }
33073
+ /** Stable region id referenced by the disclosure trigger. */
33074
+ advancedSettingsPanelId(seriesIndex) {
33075
+ return `${this.advancedSettingsId(seriesIndex)}-panel`;
33076
+ }
33077
+ /** Translation key for the disclosure's current action. */
33078
+ advancedSettingsActionKey(expanded) {
33079
+ return getAdvancedSettingsActionKey(expanded);
33080
+ }
32649
33081
  // ==================== Filter Actions ====================
32650
33082
  addFilter(seriesIndex) {
32651
33083
  const series = this.seriesArray.at(seriesIndex);
@@ -32747,6 +33179,9 @@ class GeneralQuery {
32747
33179
  normalizeAggregateFunction(value) {
32748
33180
  return value === 'DisticntCount' ? 'DistinctCount' : value || '';
32749
33181
  }
33182
+ advancedSettingsId(seriesIndex) {
33183
+ return buildAdvancedSettingsId(this.chartType(), this.seriesArray.at(seriesIndex)?.get('key')?.value, seriesIndex);
33184
+ }
32750
33185
  generateRandomKey() {
32751
33186
  return Math.random().toString(36).substring(2, 12);
32752
33187
  }
@@ -32765,7 +33200,7 @@ class GeneralQuery {
32765
33200
  useExisting: forwardRef(() => GeneralQuery),
32766
33201
  multi: true,
32767
33202
  },
32768
- ], ngImport: i0, template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n icon=\"general.settings-02\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n (onClick)=\"toggleAdvanced(i)\"\r\n [pTooltip]=\"t('advancedSettings')\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
33203
+ ], ngImport: i0, template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (shouldShowField(\"formula\")) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\r\n [id]=\"advancedSettingsToggleId(i)\"\r\n [attr.aria-expanded]=\"\r\n series.value.showAdvancedSettings ? 'true' : 'false'\r\n \"\r\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggleAdvanced(i)\"\r\n >\r\n <mt-icon\r\n icon=\"general.settings-02\"\r\n class=\"text-base\"\r\n aria-hidden=\"true\"\r\n />\r\n <span>\r\n {{\r\n t(\r\n advancedSettingsActionKey(\r\n series.value.showAdvancedSettings\r\n )\r\n )\r\n }}\r\n </span>\r\n </button>\r\n }\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n [id]=\"advancedSettingsPanelId(i)\"\r\n role=\"region\"\r\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: ColorPickerField, selector: "mt-color-picker-field", inputs: ["label", "appendTo", "placeholder", "class", "variant", "readonly", "pInputs", "required"], outputs: ["onChange"] }, { kind: "component", type: FormulaBuilder, selector: "mt-formula-builder", inputs: ["propertiesByPath", "levelSchemaId", "moduleId", "contextKey", "contextEntityTypeKey", "templateId", "placeholder", "hideToolbar", "hideStatusBar", "toolbarTabs", "codeOnly", "builderOnly", "valueMode", "isProcessBuilder"], outputs: ["validationChange", "tokensChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }, { kind: "directive", type: Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
32769
33204
  }
32770
33205
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: GeneralQuery, decorators: [{
32771
33206
  type: Component,
@@ -32780,6 +33215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32780
33215
  ToggleField,
32781
33216
  ColorPickerField,
32782
33217
  FormulaBuilder,
33218
+ Icon,
32783
33219
  StringArrayInput,
32784
33220
  Tooltip,
32785
33221
  ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
@@ -32793,7 +33229,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
32793
33229
  useExisting: forwardRef(() => GeneralQuery),
32794
33230
  multi: true,
32795
33231
  },
32796
- ], template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n <mt-button\r\n icon=\"general.settings-02\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n (onClick)=\"toggleAdvanced(i)\"\r\n [pTooltip]=\"t('advancedSettings')\"\r\n />\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
33232
+ ], template: "<div\r\n class=\"flex flex-col gap-4\"\r\n *transloco=\"let t; prefix: 'dashboardBuilder'\"\r\n [formGroup]=\"queryForm\"\r\n>\r\n <!-- Category Property (shown for certain chart types) -->\r\n @if (shouldShowField(\"categoryProperty\")) {\r\n <div class=\"mb-2\">\r\n <mt-select-field\r\n [label]=\"t('categoryProperty')\"\r\n formControlName=\"categoryProperty\"\r\n [options]=\"useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectCategoryProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Add Series Button -->\r\n @if (chartType() !== \"overview\" || seriesArray.length === 0) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Series List -->\r\n <div formArrayName=\"series\" class=\"flex flex-col gap-4\">\r\n @for (\r\n series of seriesArray.controls;\r\n track trackByIndex(i);\r\n let i = $index\r\n ) {\r\n <div\r\n class=\"p-4 rounded-lg border transition-all\"\r\n [class.border-red-500]=\"series.invalid\"\r\n [class.border-surface-200]=\"!series.invalid\"\r\n [formGroupName]=\"i\"\r\n >\r\n <!-- Series Header -->\r\n <div class=\"flex items-center justify-between mb-4\">\r\n <div class=\"flex items-center gap-2\">\r\n <span\r\n class=\"inline-flex items-center justify-center w-6 h-6 rounded-full bg-primary-100 text-primary-600 text-sm font-semibold\"\r\n >\r\n {{ i + 1 }}\r\n </span>\r\n <span class=\"text-sm font-medium text-muted-color\">{{\r\n t(\"series\")\r\n }}</span>\r\n </div>\r\n <div class=\"flex items-center gap-2\">\r\n @if (shouldShowField(\"formula\")) {\r\n <button\r\n type=\"button\"\r\n class=\"inline-flex min-h-8 items-center justify-center gap-1.5 rounded-md border border-surface-300 bg-surface-0 px-3 py-1.5 text-sm font-medium text-color transition-colors hover:border-primary-400 hover:bg-primary-50 hover:text-primary-700 disabled:cursor-not-allowed disabled:opacity-50\"\r\n [id]=\"advancedSettingsToggleId(i)\"\r\n [attr.aria-expanded]=\"\r\n series.value.showAdvancedSettings ? 'true' : 'false'\r\n \"\r\n [attr.aria-controls]=\"advancedSettingsPanelId(i)\"\r\n [disabled]=\"disabled\"\r\n (click)=\"toggleAdvanced(i)\"\r\n >\r\n <mt-icon\r\n icon=\"general.settings-02\"\r\n class=\"text-base\"\r\n aria-hidden=\"true\"\r\n />\r\n <span>\r\n {{\r\n t(\r\n advancedSettingsActionKey(\r\n series.value.showAdvancedSettings\r\n )\r\n )\r\n }}\r\n </span>\r\n </button>\r\n }\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"deleteSeries(i)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\r\n <!-- Auto Stack Toggle -->\r\n @if (shouldShowField(\"autoStack\")) {\r\n <div class=\"md:col-span-2 lg:col-span-3\">\r\n <mt-toggle-field\r\n [label]=\"t('autoStack')\"\r\n formControlName=\"autoStack\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Value Property -->\r\n @if (shouldShowField(\"valueProperty\") || series.value.autoStack) {\r\n <mt-select-field\r\n [label]=\"t('valueProperty')\"\r\n formControlName=\"valueProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectValueProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Aggregate Function -->\r\n @if (shouldShowField(\"aggregateFunction\")) {\r\n <mt-select-field\r\n [label]=\"t('aggregateFunction')\"\r\n formControlName=\"aggregateFunction\"\r\n [options]=\"aggregateFunctions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n }\r\n\r\n <!-- Color Picker -->\r\n @if (shouldShowField(\"color\")) {\r\n <mt-color-picker-field\r\n [label]=\"t('seriesColor')\"\r\n formControlName=\"color\"\r\n />\r\n }\r\n\r\n <!-- Bar Type (for stacked bar charts) -->\r\n @if (shouldShowField(\"barType\")) {\r\n <mt-select-field\r\n [label]=\"t('barType')\"\r\n formControlName=\"barType\"\r\n [options]=\"barTypes\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n />\r\n }\r\n\r\n <!-- Auto Stack By Property -->\r\n @if (\r\n shouldShowField(\"autoStackByProperty\") && series.value.autoStack\r\n ) {\r\n <mt-select-field\r\n [label]=\"t('autoStackByProperty')\"\r\n formControlName=\"autoStackByProperty\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n }\r\n\r\n <!-- Group By Properties -->\r\n @if (shouldShowField(\"groupByProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('groupByProperties')\"\r\n formControlName=\"groupByProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Stack Properties (for stacked charts) -->\r\n @if (shouldShowField(\"stackProperties\") && !series.value.autoStack) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('stackProperties')\"\r\n formControlName=\"stackProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Extra Properties -->\r\n @if (shouldShowField(\"extraProperties\")) {\r\n <div class=\"col-span-full\">\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n formControlName=\"extraProperties\"\r\n [options]=\"\r\n useGroupedSelect() ? propertiesGrouped() : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n [placeholder]=\"t('selectProperties')\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Advanced Settings (Formula) -->\r\n @if (series.value.showAdvancedSettings && shouldShowField(\"formula\")) {\r\n <div\r\n [id]=\"advancedSettingsPanelId(i)\"\r\n role=\"region\"\r\n [attr.aria-labelledby]=\"advancedSettingsToggleId(i)\"\r\n class=\"mt-4 p-3 bg-surface-50 rounded-lg border border-surface-200\"\r\n >\r\n <div class=\"text-sm font-medium mb-2\">\r\n {{ t(\"advancedSettings\") }}\r\n </div>\r\n <label class=\"mb-2 block text-sm font-medium\">\r\n {{ t(\"formula\") }}\r\n </label>\r\n <mt-formula-builder\r\n formControlName=\"formula\"\r\n valueMode=\"expression\"\r\n [builderOnly]=\"true\"\r\n [propertiesByPath]=\"formulaPropertiesByPath()\"\r\n [placeholder]=\"t('enterFormula')\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- Filters Section -->\r\n @if (shouldShowField(\"filters\")) {\r\n <div class=\"mt-4 border border-surface-200 rounded-lg p-4\">\r\n <div class=\"flex items-center justify-between mb-3\">\r\n <span class=\"text-sm font-medium\">{{ t(\"seriesFilters\") }}</span>\r\n <mt-button\r\n icon=\"general.plus\"\r\n severity=\"secondary\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addFilter(i)\"\r\n [pTooltip]=\"t('addFilter')\"\r\n />\r\n </div>\r\n\r\n <div class=\"flex flex-col gap-3\" formArrayName=\"filters\">\r\n @for (\r\n filter of getFilters(series).controls;\r\n track trackByIndex(j);\r\n let j = $index\r\n ) {\r\n <div\r\n class=\"grid grid-cols-12 gap-2 p-3 bg-surface-50 rounded-lg border border-surface-100\"\r\n [formGroupName]=\"j\"\r\n >\r\n <!-- Property Key -->\r\n <div class=\"col-span-4\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('property') : ''\"\r\n formControlName=\"propertyKey\"\r\n [options]=\"\r\n useGroupedSelect()\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"useGroupedSelect()\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [placeholder]=\"t('selectProperty')\"\r\n [filter]=\"true\"\r\n />\r\n </div>\r\n\r\n <!-- Operator -->\r\n <div class=\"col-span-2\">\r\n <mt-select-field\r\n [label]=\"j === 0 ? t('operator') : ''\"\r\n formControlName=\"operator\"\r\n [options]=\"operators\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n />\r\n </div>\r\n\r\n <!-- Value -->\r\n <div class=\"col-span-4\">\r\n <mt-text-field\r\n [label]=\"j === 0 ? t('value') : ''\"\r\n formControlName=\"value\"\r\n [placeholder]=\"t('enterValue')\"\r\n />\r\n </div>\r\n\r\n <!-- Remove Filter -->\r\n <div class=\"col-span-2 flex items-end justify-end pb-1\">\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n [rounded]=\"true\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"removeFilter(i, j)\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (getFilters(series).length === 0) {\r\n <div class=\"text-center py-3 text-muted-color text-sm\">\r\n {{ t(\"noFiltersConfigured\") }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (seriesArray.length === 0) {\r\n <div\r\n class=\"text-center py-8 text-muted-color border border-dashed border-surface-300 rounded-lg\"\r\n >\r\n <i class=\"mti mti-chart-bar text-3xl mb-2 block\"></i>\r\n <p class=\"mb-2\">{{ t(\"noSeriesConfigured\") }}</p>\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"t('addSeries')\"\r\n severity=\"secondary\"\r\n size=\"small\"\r\n [disabled]=\"disabled\"\r\n (onClick)=\"addSeries()\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
32797
33233
  }], ctorParameters: () => [], propDecorators: { chartType: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartType", required: false }] }], querySchema: [{ type: i0.Input, args: [{ isSignal: true, alias: "querySchema", required: false }] }], propertiesFlat: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesFlat", required: false }] }], propertiesGrouped: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertiesGrouped", required: false }] }] } });
32798
33234
 
32799
33235
  /**
@@ -34458,6 +34894,45 @@ class DataSourceSettings {
34458
34894
  this.query.set(query);
34459
34895
  this.serviceConfigChange.emit({ query: query });
34460
34896
  }
34897
+ /**
34898
+ * Update one semantic PhaseGate table role by property key.
34899
+ *
34900
+ * The backend projection is rebuilt on every edit so it always contains the
34901
+ * visible columns and every runtime role, independent of picker order.
34902
+ */
34903
+ onPhaseGateTableRoleChange(field, value) {
34904
+ this.commitPhaseGateTableQuery({ [field]: value ?? '' });
34905
+ }
34906
+ /** Update the ordered business columns rendered before the phase columns. */
34907
+ onPhaseGateTableBasePropertiesChange(values) {
34908
+ this.commitPhaseGateTableQuery({ baseProperties: values ?? [] });
34909
+ }
34910
+ /**
34911
+ * Persist the dedicated PhaseGate query and remove fields left by the old
34912
+ * generic table editor. `baseProperties` is the ordered visible-column list;
34913
+ * both backend projection aliases are rebuilt by the shared normalizer.
34914
+ */
34915
+ commitPhaseGateTableQuery(patch) {
34916
+ const migrated = normalizePhaseGateTableQuery((this.query() ?? {}), { migrateLegacy: true });
34917
+ const nextSource = { ...migrated, ...patch };
34918
+ // These belong to the former generic Table query UI and must not continue
34919
+ // influencing either the backend request or runtime interpretation.
34920
+ delete nextSource['lookupProperty'];
34921
+ delete nextSource['PivotProperties'];
34922
+ delete nextSource['pivotProperties'];
34923
+ delete nextSource['AggregationProperties'];
34924
+ delete nextSource['aggregationProperties'];
34925
+ delete nextSource['groupByMultiple'];
34926
+ const next = normalizePhaseGateTableQuery(nextSource, {
34927
+ migrateLegacy: true,
34928
+ });
34929
+ this.query.set(next);
34930
+ this.groupByMultiple.set([]);
34931
+ this.serviceConfigChange.emit({
34932
+ query: next,
34933
+ groupByMultiple: undefined,
34934
+ });
34935
+ }
34461
34936
  /**
34462
34937
  * Handle timeline query change
34463
34938
  */
@@ -34656,6 +35131,8 @@ class DataSourceSettings {
34656
35131
  const q = this.query();
34657
35132
  return typeof q?.['levelId'] === 'string' ? q['levelId'] : '';
34658
35133
  }, ...(ngDevMode ? [{ debugName: "phaseGateLevelId" }] : /* istanbul ignore next */ []));
35134
+ /** Dedicated PhaseGate table query hydrated from legacy table configs. */
35135
+ phaseGateTableQuery = computed(() => normalizePhaseGateTableQuery((this.query() ?? {}), { migrateLegacy: true }), ...(ngDevMode ? [{ debugName: "phaseGateTableQuery" }] : /* istanbul ignore next */ []));
34659
35136
  /**
34660
35137
  * Reads the current timeline-multi-level query for the template.
34661
35138
  */
@@ -34863,7 +35340,7 @@ class DataSourceSettings {
34863
35340
  };
34864
35341
  }
34865
35342
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DataSourceSettings, deps: [], target: i0.ɵɵFactoryTarget.Component });
34866
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DataSourceSettings, isStandalone: true, selector: "mt-data-source-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartType: { classPropertyName: "chartType", publicName: "chartType", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { serviceConfigChange: "serviceConfigChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }, { kind: "component", type: SourceLinkConfiguration, selector: "mt-source-link-configuration", inputs: ["selectionModules"] }, { kind: "component", type: CustomApiConfiguration, selector: "mt-custom-api-configuration" }, { kind: "component", type: GeneralQuery, selector: "mt-general-query", inputs: ["chartType", "querySchema", "propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TableQuery, selector: "mt-table-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TimelineQuery, selector: "mt-timeline-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: PropertiesQuery, selector: "mt-properties-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SnapshotQuery, selector: "mt-snapshot-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: MapQuery, selector: "mt-map-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SplitterQuery, selector: "mt-splitter-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: InformativeContextSelection, selector: "mt-informative-context-selection", inputs: ["informativeContext", "currentSelection", "preferredTargetSelector", "applyToken"], outputs: ["templateApply"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
35343
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: DataSourceSettings, isStandalone: true, selector: "mt-data-source-settings", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, chartType: { classPropertyName: "chartType", publicName: "chartType", isSignal: true, isRequired: false, transformFunction: null }, informativeContext: { classPropertyName: "informativeContext", publicName: "informativeContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { serviceConfigChange: "serviceConfigChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGateTable\") {\r\n @let phaseGateQuery = phaseGateTableQuery();\r\n @let groupedPhaseGateProperties = propertiesGrouped().length > 1;\r\n\r\n <div class=\"flex flex-col gap-5\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"phaseGateTableQueryDescription\") }}\r\n </p>\r\n\r\n <div class=\"grid grid-cols-1 gap-4 lg:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('phaseGateRowIdentityProperty')\"\r\n [hint]=\"t('phaseGateRowIdentityPropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.rowIdentityProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('rowIdentityProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateNameProperty')\"\r\n [hint]=\"t('phaseGateNamePropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseNameProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseNameProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateStatusProperty')\"\r\n [hint]=\"t('phaseGateStatusPropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseStatusProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseStatusProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateIdProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIdProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseIdProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateOrderProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseOrderProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseOrderProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateProgressProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseProgressProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseProgressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateCurrentProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIsCurrentProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseIsCurrentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateCompletedProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIsCompletedProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseIsCompletedProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateAllItemsCompletedProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseAllItemsCompletedProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseAllItemsCompletedProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('phaseGateVisibleProperties')\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n [placeholder]=\"t('phaseGateVisiblePropertiesPlaceholder')\"\r\n [ngModel]=\"phaseGateQuery.baseProperties\"\r\n (ngModelChange)=\"onPhaseGateTableBasePropertiesChange($event)\"\r\n />\r\n\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateProjectionHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: SelectionConfiguration, selector: "mt-selection-configuration", inputs: ["structureLocked", "workspaceId", "chartWorkspace", "modulesProperties", "propertiesFlat"], outputs: ["moduleChange"] }, { kind: "component", type: SourceLinkConfiguration, selector: "mt-source-link-configuration", inputs: ["selectionModules"] }, { kind: "component", type: CustomApiConfiguration, selector: "mt-custom-api-configuration" }, { kind: "component", type: GeneralQuery, selector: "mt-general-query", inputs: ["chartType", "querySchema", "propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TableQuery, selector: "mt-table-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: TimelineQuery, selector: "mt-timeline-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: PropertiesQuery, selector: "mt-properties-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SnapshotQuery, selector: "mt-snapshot-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: MapQuery, selector: "mt-map-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: SplitterQuery, selector: "mt-splitter-query", inputs: ["propertiesFlat", "propertiesGrouped"] }, { kind: "component", type: InformativeContextSelection, selector: "mt-informative-context-selection", inputs: ["informativeContext", "currentSelection", "preferredTargetSelector", "applyToken"], outputs: ["templateApply"] }, { kind: "component", type: StringArrayInput, selector: "mt-string-array-input", inputs: ["label", "placeholder", "options", "group", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "filter", "emptyHint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
34867
35344
  }
34868
35345
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: DataSourceSettings, decorators: [{
34869
35346
  type: Component,
@@ -34891,7 +35368,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
34891
35368
  SplitterQuery,
34892
35369
  InformativeContextSelection,
34893
35370
  StringArrayInput,
34894
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n" }]
35371
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"flex flex-col gap-5\" *transloco=\"let t; prefix: 'dashboardBuilder'\">\r\n <!-- Data source mode: Selection cycle OR Custom API (separated area on top) -->\r\n @if (supportsCustomApi()) {\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'selection'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'selection'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'selection'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'selection'\"\r\n (click)=\"onModeChange('selection')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'selection'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'selection'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.selection\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.selectionHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n class=\"flex items-start gap-2 rounded-lg border p-3 text-left transition-colors\"\r\n [class.border-primary-500]=\"dataSourceMode() === 'customApi'\"\r\n [class.bg-primary-50]=\"dataSourceMode() === 'customApi'\"\r\n [class.border-surface-200]=\"dataSourceMode() !== 'customApi'\"\r\n [class.hover:bg-surface-50]=\"dataSourceMode() !== 'customApi'\"\r\n (click)=\"onModeChange('customApi')\"\r\n >\r\n <mt-icon\r\n icon=\"dev.code-02\"\r\n class=\"mt-0.5 text-lg\"\r\n [class.text-primary-600]=\"dataSourceMode() === 'customApi'\"\r\n [class.text-muted-color]=\"dataSourceMode() !== 'customApi'\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"dataSourceModes.customApi\") }}\r\n </span>\r\n <span class=\"text-xs text-muted-color\">\r\n {{ t(\"dataSourceModes.customApiHint\") }}\r\n </span>\r\n </span>\r\n </button>\r\n </div>\r\n }\r\n\r\n <!-- ===================== CUSTOM API MODE ===================== -->\r\n @if (supportsCustomApi() && dataSourceMode() === \"customApi\") {\r\n <mt-custom-api-configuration\r\n [ngModel]=\"customApi()\"\r\n (ngModelChange)=\"onCustomApiChange($event)\"\r\n />\r\n } @else {\r\n <!-- ===================== SELECTION CYCLE ===================== -->\r\n\r\n <!-- Workspace gate: pick ONE workspace before the tabs/config appear.\r\n The picker shows whenever no workspace is chosen yet \u2014 for a brand-new\r\n chart it also blocks the tabs (needsWorkspacePick), but an existing\r\n chart that never had a workspace still gets the picker so it can be\r\n assigned (and saved into serviceConfig.workspaceId for navigate-to). -->\r\n @if (showWorkspaceGate()) {\r\n @if (!chartWorkspace()) {\r\n <div\r\n class=\"flex flex-col items-center gap-3 rounded-lg border border-dashed border-surface-300 bg-surface-50 p-6 text-center\"\r\n >\r\n <mt-icon icon=\"dev.database-01\" class=\"text-3xl text-primary-500\" />\r\n <div class=\"flex flex-col gap-1\">\r\n <h3 class=\"text-sm font-semibold text-surface-700\">\r\n {{ t(\"workspaceGateTitle\") }}\r\n </h3>\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"workspaceGateHint\") }}\r\n </p>\r\n </div>\r\n <div class=\"w-full max-w-sm\">\r\n <mt-select-field\r\n [options]=\"workspaceOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [placeholder]=\"t('selectWorkspace')\"\r\n [filter]=\"true\"\r\n [ngModel]=\"chartWorkspace()\"\r\n (ngModelChange)=\"onWorkspacePick($event)\"\r\n />\r\n </div>\r\n </div>\r\n } @else if (workspaceAutoDetected()) {\r\n <!-- Old data: workspace inferred from the chart's existing config.\r\n Surface it with a Save-to-keep / Clear notice instead of a silent\r\n chip, so the user knows it must be saved (or can pick another). -->\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-start gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"general.alert-circle\"\r\n class=\"mt-0.5 text-base text-amber-600\"\r\n />\r\n <span class=\"flex flex-col\">\r\n <span class=\"font-medium text-surface-700\">\r\n {{ t(\"workspace\") }}: {{ chartWorkspaceLabel() }}\r\n </span>\r\n <span class=\"text-xs text-amber-700\">{{\r\n t(\"workspaceAutoHint\")\r\n }}</span>\r\n </span>\r\n </span>\r\n <mt-button\r\n [label]=\"t('clear')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"clearAutoDetectedWorkspace()\"\r\n />\r\n </div>\r\n } @else {\r\n <div\r\n class=\"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-200 bg-surface-50 px-3 py-2\"\r\n >\r\n <span class=\"flex items-center gap-2 text-sm\">\r\n <mt-icon\r\n icon=\"dev.database-01\"\r\n class=\"text-base text-primary-500\"\r\n />\r\n <span class=\"text-muted-color\">{{ t(\"workspace\") }}:</span>\r\n <span class=\"font-medium text-surface-700\">{{\r\n chartWorkspaceLabel()\r\n }}</span>\r\n </span>\r\n @if (!confirmingWorkspaceChange()) {\r\n <mt-button\r\n [label]=\"t('change')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"requestChangeWorkspace()\"\r\n />\r\n } @else {\r\n <span class=\"flex flex-wrap items-center gap-2\">\r\n <span class=\"text-xs text-amber-600\">{{\r\n t(\"changeWorkspaceConfirm\")\r\n }}</span>\r\n <mt-button\r\n [label]=\"t('cancel')\"\r\n severity=\"secondary\"\r\n variant=\"outlined\"\r\n size=\"small\"\r\n (onClick)=\"cancelChangeWorkspace()\"\r\n />\r\n <mt-button\r\n [label]=\"t('changeAndClear')\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n (onClick)=\"confirmChangeWorkspace()\"\r\n />\r\n </span>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n <!-- Sub-navigation: Selection \u00B7 Source Links (when >1 selection) \u00B7 Query -->\r\n @if (sectionOptions().length > 1 && !needsWorkspacePick()) {\r\n <mt-tabs\r\n [options]=\"sectionOptions()\"\r\n optionLabel=\"label\"\r\n optionValue=\"id\"\r\n [active]=\"visibleSection()\"\r\n (onChange)=\"onSectionChange($event)\"\r\n />\r\n }\r\n\r\n <!-- ===================== SELECTION ===================== -->\r\n @if (!hideSelectionConfig() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'selection'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n @if (showInformativeSelectionMode()) {\r\n <div class=\"flex items-center justify-end\">\r\n <mt-toggle-field\r\n [label]=\"t('advancedSelection')\"\r\n [ngModel]=\"selectionMode() === 'advanced'\"\r\n (ngModelChange)=\"onAdvancedSelectionToggle($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (\r\n !showInformativeSelectionMode() || selectionMode() === \"advanced\"\r\n ) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n (moduleChange)=\"onModuleChange($event)\"\r\n />\r\n } @else {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-informative-context-selection\r\n class=\"block\"\r\n [informativeContext]=\"informativeContext()\"\r\n [currentSelection]=\"selections()\"\r\n [preferredTargetSelector]=\"contextTargetSelector()\"\r\n [applyToken]=\"contextTargetApplyToken()\"\r\n (templateApply)=\"onContextTemplateApply($event)\"\r\n />\r\n\r\n @if (selections().length) {\r\n <mt-selection-configuration\r\n [workspaceId]=\"selectedWorkspaceId()\"\r\n [chartWorkspace]=\"chartWorkspace()\"\r\n [modulesProperties]=\"modulesProperties()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [structureLocked]=\"true\"\r\n [ngModel]=\"selections()\"\r\n (ngModelChange)=\"onSelectionsChange($event)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- ===================== SOURCE LINKS (only with >1 selection) ===================== -->\r\n @if (showSourceLinks() && !needsWorkspacePick()) {\r\n <div\r\n [hidden]=\"visibleSection() !== 'sourceLinks'\"\r\n class=\"flex flex-col gap-5\"\r\n >\r\n <mt-source-link-configuration\r\n [selectionModules]=\"selectionModules()\"\r\n [ngModel]=\"sourceLinks()\"\r\n (ngModelChange)=\"onSourceLinksChange($event)\"\r\n />\r\n </div>\r\n }\r\n\r\n <!-- ===================== QUERY ===================== -->\r\n @if (queryComponentType() !== \"none\" && !needsWorkspacePick()) {\r\n <div [hidden]=\"visibleSection() !== 'query'\" class=\"flex flex-col gap-5\">\r\n @if (loadingProperties()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"120px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"grid grid-cols-2 gap-4\">\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"80px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"90px\" height=\"16px\" />\r\n <p-skeleton width=\"100%\" height=\"40px\" borderRadius=\"8px\" />\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Group By Multiple (table views) -->\r\n @if (showGroupByMultiple()) {\r\n <mt-string-array-input\r\n [label]=\"t('groupByMultiple')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectGroupByProperties')\"\r\n [ngModel]=\"groupByMultiple()\"\r\n (ngModelChange)=\"onGroupByMultipleChange($event)\"\r\n />\r\n }\r\n\r\n <!-- Query Configuration based on chart type -->\r\n @switch (queryComponentType()) {\r\n @case (\"general\") {\r\n <mt-general-query\r\n [chartType]=\"getChartTypeId()\"\r\n [querySchema]=\"querySchema()\"\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryChange($event)\"\r\n />\r\n\r\n <mt-toggle-field\r\n [label]=\"t('isNormalized')\"\r\n [ngModel]=\"isNormalized()\"\r\n (ngModelChange)=\"onIsNormalizedChange($event)\"\r\n />\r\n }\r\n @case (\"table\") {\r\n <mt-table-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTableQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGateTable\") {\r\n @let phaseGateQuery = phaseGateTableQuery();\r\n @let groupedPhaseGateProperties = propertiesGrouped().length > 1;\r\n\r\n <div class=\"flex flex-col gap-5\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"phaseGateTableQueryDescription\") }}\r\n </p>\r\n\r\n <div class=\"grid grid-cols-1 gap-4 lg:grid-cols-2\">\r\n <mt-select-field\r\n [label]=\"t('phaseGateRowIdentityProperty')\"\r\n [hint]=\"t('phaseGateRowIdentityPropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.rowIdentityProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('rowIdentityProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateNameProperty')\"\r\n [hint]=\"t('phaseGateNamePropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseNameProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseNameProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateStatusProperty')\"\r\n [hint]=\"t('phaseGateStatusPropertyHint')\"\r\n [required]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseStatusProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseStatusProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateIdProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIdProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseIdProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateOrderProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseOrderProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange('phaseOrderProperty', $event)\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateProgressProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseProgressProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseProgressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateCurrentProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIsCurrentProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseIsCurrentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateCompletedProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseIsCompletedProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseIsCompletedProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n\r\n <mt-select-field\r\n [label]=\"t('phaseGateAllItemsCompletedProperty')\"\r\n [showClear]=\"true\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [filter]=\"true\"\r\n [placeholder]=\"t('phaseGateSelectProperty')\"\r\n [ngModel]=\"phaseGateQuery.phaseAllItemsCompletedProperty\"\r\n (ngModelChange)=\"\r\n onPhaseGateTableRoleChange(\r\n 'phaseAllItemsCompletedProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('phaseGateVisibleProperties')\"\r\n [options]=\"\r\n groupedPhaseGateProperties\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"groupedPhaseGateProperties\"\r\n [placeholder]=\"t('phaseGateVisiblePropertiesPlaceholder')\"\r\n [ngModel]=\"phaseGateQuery.baseProperties\"\r\n (ngModelChange)=\"onPhaseGateTableBasePropertiesChange($event)\"\r\n />\r\n\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateProjectionHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"timeline\") {\r\n <mt-timeline-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onTimelineQueryChange($event)\"\r\n />\r\n }\r\n @case (\"timelineMultiLevel\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <div class=\"flex items-center justify-between\">\r\n <p class=\"text-sm text-muted-color\">\r\n {{ t(\"timelineMultiLevelDescription\") }}\r\n </p>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"secondary\"\r\n icon=\"general.plus\"\r\n [label]=\"t('addLevel')\"\r\n (onClick)=\"addTimelineLevel()\"\r\n />\r\n </div>\r\n\r\n <mt-select-field\r\n [label]=\"t('timeFrame')\"\r\n [options]=\"timeFrameOptions\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n [ngModel]=\"timelineTimeFrame()\"\r\n (ngModelChange)=\"onTimelineTimeFrameChange($event)\"\r\n />\r\n\r\n @for (level of timelineLevels(); track $index) {\r\n <div\r\n class=\"border border-surface-300 rounded-md p-4 flex flex-col gap-3\"\r\n >\r\n <div class=\"flex items-center justify-between\">\r\n <span class=\"font-medium\">\r\n {{ t(\"level\") }} {{ level.levelNumber || $index + 1 }}\r\n </span>\r\n <mt-button\r\n size=\"small\"\r\n severity=\"danger\"\r\n [text]=\"true\"\r\n icon=\"general.trash-02\"\r\n (onClick)=\"removeTimelineLevel($index)\"\r\n />\r\n </div>\r\n\r\n <div class=\"grid grid-cols-2 gap-3\">\r\n <mt-select-field\r\n [label]=\"t('pivotProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.pivotProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'pivotProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('lookupProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.lookupProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'lookupProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('idProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.idProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField($index, 'idProperty', $event)\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('startTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.startPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'startPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('endTimeProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.endPoint_timeProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'endPoint_timeProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n <mt-select-field\r\n [label]=\"t('progressProperty')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n optionGroupLabel=\"label\"\r\n optionGroupChildren=\"items\"\r\n [ngModel]=\"level.progressProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'progressProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n @if (shouldShowTimelineParentProperty($index)) {\r\n <mt-select-field\r\n [label]=\"t('parentProperty')\"\r\n [options]=\"timelineParentPropertyOptions($index)\"\r\n optionLabel=\"name\"\r\n optionValue=\"key\"\r\n [ngModel]=\"level.parentProperty\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'parentProperty',\r\n $event\r\n )\r\n \"\r\n />\r\n }\r\n </div>\r\n\r\n <mt-string-array-input\r\n [label]=\"t('extraProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('selectProperties')\"\r\n [ngModel]=\"level.extraProperties || level.extras || []\"\r\n (ngModelChange)=\"\r\n updateTimelineLevelField(\r\n $index,\r\n 'extraProperties',\r\n $event\r\n )\r\n \"\r\n />\r\n </div>\r\n }\r\n\r\n @if (timelineLevels().length === 0) {\r\n <div class=\"text-center py-4 text-muted-color text-sm\">\r\n {{ t(\"noTimelineLevelsHint\") }}\r\n </div>\r\n }\r\n </div>\r\n }\r\n @case (\"map\") {\r\n <mt-map-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onMapQueryChange($event)\"\r\n />\r\n }\r\n @case (\"splitter\") {\r\n <mt-splitter-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSplitterQueryChange($event)\"\r\n />\r\n }\r\n @case (\"properties\") {\r\n <mt-properties-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onPropertiesQueryChange($event)\"\r\n />\r\n }\r\n @case (\"snapshot\") {\r\n <mt-snapshot-query\r\n [propertiesFlat]=\"propertiesFlat()\"\r\n [propertiesGrouped]=\"propertiesGrouped()\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onSnapshotQueryChange($event)\"\r\n />\r\n }\r\n @case (\"phaseGate\") {\r\n <div class=\"flex flex-col gap-2\">\r\n <mt-text-field\r\n [label]=\"t('levelId')\"\r\n [ngModel]=\"phaseGateLevelId()\"\r\n (ngModelChange)=\"onPhaseGateLevelIdChange($event)\"\r\n />\r\n <p class=\"text-xs text-muted-color\">\r\n {{ t(\"phaseGateLevelIdHint\") }}\r\n </p>\r\n </div>\r\n }\r\n @case (\"repeater\") {\r\n <div class=\"flex flex-col gap-5\">\r\n <mt-select-field\r\n [label]=\"t('repeaterDashboard')\"\r\n [options]=\"availableDashboards()\"\r\n optionLabel=\"name\"\r\n optionValue=\"id\"\r\n [ngModel]=\"repeaterDashboardId()\"\r\n (ngModelChange)=\"onRepeaterDashboardChange($event)\"\r\n />\r\n\r\n <mt-string-array-input\r\n [label]=\"t('repeaterSelectedProperties')\"\r\n [options]=\"\r\n propertiesGrouped().length > 1\r\n ? propertiesGrouped()\r\n : propertiesFlat()\r\n \"\r\n [group]=\"propertiesGrouped().length > 1\"\r\n [placeholder]=\"t('repeaterSelectedPropertiesPlaceholder')\"\r\n [ngModel]=\"repeaterSelectedProperties()\"\r\n (ngModelChange)=\"onRepeaterSelectedPropertiesChange($event)\"\r\n />\r\n </div>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n }\r\n</div>\r\n" }]
34895
35372
  }], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], chartType: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartType", required: false }] }], informativeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "informativeContext", required: false }] }], serviceConfigChange: [{ type: i0.Output, args: ["serviceConfigChange"] }] } });
34896
35373
 
34897
35374
  /**
@@ -34954,7 +35431,25 @@ class ManageItem {
34954
35431
  // Basic validation: must have chart type and title
34955
35432
  const hasChartType = !!cfg.serviceConfig?.chartType;
34956
35433
  const hasTitle = !!(cfg.clientConfig?.title?.en || cfg.clientConfig?.title?.ar);
34957
- return hasChartType && hasTitle;
35434
+ if (!hasChartType || !hasTitle)
35435
+ return false;
35436
+ // PhaseGate Table cannot safely infer these roles from response order.
35437
+ // Keep Save disabled until the dedicated editor has the minimum semantic
35438
+ // keys that its runtime contract requires.
35439
+ const capability = resolveCapability({
35440
+ chartTypeId: this.chartTypeId(),
35441
+ serviceType: cfg.serviceConfig?.chartType ?? null,
35442
+ componentName: cfg.clientConfig?.componentName ?? null,
35443
+ functionName: cfg.clientConfig?.functionName ?? null,
35444
+ });
35445
+ if (capability?.query.editor !== 'phaseGateTable')
35446
+ return true;
35447
+ const query = cfg.serviceConfig?.query;
35448
+ return [
35449
+ query?.['rowIdentityProperty'],
35450
+ query?.['phaseNameProperty'],
35451
+ query?.['phaseStatusProperty'],
35452
+ ].every((value) => typeof value === 'string' && value.trim().length > 0);
34958
35453
  }, ...(ngDevMode ? [{ debugName: "isValid" }] : /* istanbul ignore next */ []));
34959
35454
  ngOnInit() {
34960
35455
  // Check for dialog config data (when opened via DynamicDialog)
@@ -37428,17 +37923,20 @@ class DatasourcePanelComponent {
37428
37923
  const i = this.item();
37429
37924
  return i?.config ?? null;
37430
37925
  }, ...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
37431
- chartTypeConfig = computed(() => {
37926
+ capability = computed(() => {
37432
37927
  const i = this.item();
37433
37928
  if (!i?.config)
37434
37929
  return null;
37435
37930
  const cfg = i.config;
37436
- const cap = resolveCapability({
37931
+ return resolveCapability({
37437
37932
  chartTypeId: i.chartTypeId ?? null,
37438
37933
  serviceType: cfg.serviceConfig?.chartType ?? null,
37439
37934
  componentName: cfg.clientConfig?.componentName ?? null,
37440
37935
  functionName: cfg.clientConfig?.functionName ?? null,
37441
37936
  });
37937
+ }, ...(ngDevMode ? [{ debugName: "capability" }] : /* istanbul ignore next */ []));
37938
+ chartTypeConfig = computed(() => {
37939
+ const cap = this.capability();
37442
37940
  if (!cap)
37443
37941
  return null;
37444
37942
  return CHART_TYPES.find((ct) => ct.id === cap.id) ?? null;
@@ -37446,7 +37944,7 @@ class DatasourcePanelComponent {
37446
37944
  summary = computed(() => {
37447
37945
  const i = this.item();
37448
37946
  const cfg = i?.config;
37449
- const cap = this.chartTypeConfig();
37947
+ const cap = this.capability();
37450
37948
  if (!cfg) {
37451
37949
  return {
37452
37950
  chartType: '',
@@ -37473,18 +37971,14 @@ class DatasourcePanelComponent {
37473
37971
  if (sourceStatus !== 'ok') {
37474
37972
  missing.push(this.t('panel.pickDataSource'));
37475
37973
  }
37476
- const requiredFields = cap?.id
37477
- ? extractRequiredFields(cap)
37478
- : [];
37479
37974
  const queryRecord = cfg.serviceConfig?.query ?? {};
37480
- const missingRequired = requiredFields.filter((rf) => {
37481
- const v = queryRecord?.[rf];
37482
- if (Array.isArray(v))
37483
- return v.length === 0;
37484
- if (typeof v === 'string')
37485
- return v.trim().length === 0;
37486
- return v === undefined || v === null;
37487
- });
37975
+ const requirementResult = evaluateQueryRequirements(queryRecord, cap?.query.schema);
37976
+ const missingRequired = [
37977
+ ...requirementResult.missingRequired,
37978
+ ...(requirementResult.missingRequiredAnyOf.length
37979
+ ? [requirementResult.missingRequiredAnyOf.join(' / ')]
37980
+ : []),
37981
+ ];
37488
37982
  let fieldsStatus = 'ok';
37489
37983
  let fieldsLabel = this.t('panel.fieldsReady');
37490
37984
  let fieldsIcon = 'general.check-circle';
@@ -37669,10 +38163,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
37669
38163
  </ng-container>
37670
38164
  `, styles: [".db-datasource-panel{display:flex;flex-direction:column;gap:.75rem}.db-datasource-panel__status{display:flex;flex-wrap:wrap;gap:.5rem}.db-datasource-panel__chip{display:inline-flex;align-items:center;gap:.4rem;padding:.35rem .6rem;font-size:.75rem;background:var(--p-surface-50, #f9fafb);border:1px solid var(--p-surface-200, #e5e7eb);border-radius:999px;color:var(--p-text-color, #1f2937)}.db-datasource-panel__chip[data-status=ok]{background:var(--p-green-50, #f0fdf4);border-color:var(--p-green-200, #bbf7d0);color:var(--p-green-700, #15803d)}.db-datasource-panel__chip[data-status=missing]{background:var(--p-amber-50, #fffbeb);border-color:var(--p-amber-200, #fde68a);color:var(--p-amber-700, #b45309)}.db-datasource-panel__hints{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.25rem}.db-datasource-panel__hint{display:flex;align-items:center;gap:.4rem;padding:.4rem .6rem;background:var(--p-amber-50, #fffbeb);border:1px solid var(--p-amber-200, #fde68a);border-radius:.375rem;color:var(--p-amber-700, #b45309);font-size:.75rem}.db-datasource-panel__inner{background:var(--p-surface-0, #fff);border:1px solid var(--p-surface-200, #e5e7eb);border-radius:.5rem;padding:.75rem;max-height:50vh;overflow-y:auto}.db-datasource-panel__footer{display:flex;justify-content:flex-end}\n"] }]
37671
38165
  }], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], serviceConfigChange: [{ type: i0.Output, args: ["serviceConfigChange"] }], openAdvanced: [{ type: i0.Output, args: ["openAdvanced"] }] } });
37672
- function extractRequiredFields(cap) {
37673
- const required = cap?.query?.schema?.required;
37674
- return Array.isArray(required) ? required.map(String) : [];
37675
- }
37676
38166
 
37677
38167
  /**
37678
38168
  * Pass 4 - Schema Control Renderer
@@ -46563,4 +47053,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
46563
47053
  */
46564
47054
 
46565
47055
  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, normalizeFilters 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, formatWordsUnderBar as a9, StyleStudioDrawer as aA, StyleSettingsRenderer as aB, expandResetPatches as aC, StyleField as aD, SegmentedField as aE, ColorListField as aF, ArrayBuilderField as aG, KeyValueMapField as aH, LegendOrderField as aI, ItemCardMenuComponent as aJ, ChartFilterDrawer as aK, ItemContextToolbarComponent as aL, ItemConfigPopoverComponent as aM, GuidedConfigDialogComponent as aN, FilterChipsBarComponent as aO, FilterBuilderComponent as aP, DatasourcePanelComponent as aQ, SchemaControlRendererComponent as aR, FilterByGroupPipe as aS, GetChartActionsPipe as aT, CHART_CAPABILITIES as aU, getCapabilityById as aV, resolveCapability as aW, toBackendChartType as aX, normalizeChartTypeForRequest as aY, normalizeFilterOperation as aZ, normalizeAggregateFunction as a_, formatXAxis as aa, handleFiltersForCustom as ab, handleFilterForCard as ac, handleFilterForSnapshot as ad, DashboardList as ae, HTTPMethod as af, DashboardBuilderService as ag, DashboardStoreService as ah, isManagePagesDeleteResult as ai, ManagePages as aj, ManageBreadcrumb as ak, ManageFilterOnPage as al, DynamicFiltersConfig as am, ChartSettingsDrawer as an, DisplaySettings as ao, DefaultControlUi as ap, PieControlUi as aq, BarControlUi as ar, StackBarControlUi as as, ManageItem as at, CHART_TYPES as au, ManageItemService as av, GeneralSettings as aw, DataSourceSettings as ax, ActionsSettings as ay, ChartViewer as az, DashboardBuilder as b, selectorFromLegacy as b0, moduleIdFromSelector as b1, toBackendSourceLink as b2, toFormSourceLink as b3, normalizeOnLoad as b4, normalizeBeforeSave as b5, normalizeBeforeRequest as b6, CONFIG_DOMAINS as b7, domainsForCapability as b8, findDomain as b9, formatForEditor as bA, readByPath$1 as bB, setByPath as bC, applyControlPatchToPersisted as bD, applyControlPatchesToPersisted as bE, getControlSchema as bF, listControlSchemaIds as bG, listControlSchemas as bH, getFallbackControlSchema as bI, flattenSchema as bJ, resolveDisplayFields as bK, buildDisplayFieldPredicate as bL, bindingKey as bM, getBinding as bN, listBindings as bO, listBindingsForChart as bP, readBoundValue as bQ, ITEM_GUIDANCE_REGISTRY as bR, describeGuidance as bS, ItemGuidanceService as bT, POPOVER_TABS as ba, POPOVER_TAB_SPECS as bb, titleToUi as bc, applyTitleToPersisted as bd, datasourceToUi as be, fieldsToUi as bf, filtersToUi as bg, styleToUi as bh, applyStyleToPersisted as bi, layoutToUi as bj, applyLayoutToPersisted as bk, labelLegendFormatToUi as bl, applyLabelLegendFormatToPersisted as bm, behaviorToUi as bn, applyBehaviorToPersisted as bo, applyFilterChipsToPersisted as bp, persistedToUi as bq, buildAssembly as br, STYLE_PRESETS as bs, presetsForCapability as bt, findPreset as bu, validate as bv, hasBlockingIssues as bw, groupIssuesByDomain as bx, parseAdvancedJson as by, deepMerge$1 as bz, cloneDeep$1 as c, DashboardViewer as d, switchAllKeysSmall$1 as e, dynamicTextReplace as f, getNestedData as g, dynamicReorder as h, generalConfiguration as i, formatValue as j, getLocalizedTitle as k, sortChartData as l, addCommasToNumber as m, sortDataTableView as n, isMobilePlatform$1 as o, getColorFromConditions as p, CardFilterComponent as q, DynamicFiltersComponent as r, switchAllKeysToLower as s, CardInfoComponent as t, ChartCardComponent as u, EntityInfoComponent as v, normalizeDashboardCardEntityValue as w, EntityPreviewCardComponent as x, ListStatisticCardComponent as y, SkeletonCardComponent as z };
46566
- //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-DbySCZwd.mjs.map
47056
+ //# sourceMappingURL=masterteam-dashboard-builder-masterteam-dashboard-builder-DwxEWo4J.mjs.map