@praxisui/charts 10.0.0-rc.70 → 10.0.0-rc.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/ai/component-registry.json +2 -2
- package/fesm2022/praxisui-charts.mjs +1546 -884
- package/package.json +3 -3
- package/types/praxisui-charts.d.ts +35 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Optional, inject, Inject, InjectionToken, input, booleanAttribute, output, viewChild, ElementRef, NgZone, signal, DestroyRef, linkedSignal, computed, afterNextRender, effect, untracked, forwardRef, ChangeDetectionStrategy, Component, Injector, ENVIRONMENT_INITIALIZER, LOCALE_ID, ViewChild, Input, EventEmitter, Output } from '@angular/core';
|
|
3
3
|
import * as i1 from '@praxisui/core';
|
|
4
|
-
import { isPraxisSuppressionStatusSuppressed, readAnalyticsSuppressionMetadata, validateResourceQuickViewBinding, normalizeResourceQuickViewBinding, PraxisStatsExecutionService, attachAnalyticsEpistemicMetadata, attachAnalyticsSuppressionMetadata, extractAnalyticsEpistemicMetadata, extractAnalyticsSuppressionMetadata, readAnalyticsEpistemicMetadata, normalizePraxisResourcePath, extractPraxisApiPathPrefix, buildApiUrl, extractExplicitPraxisIntelligenceErrorCode, resolvePraxisIntelligenceErrorCodeFromPayload, API_URL, PraxisI18nService, ComponentMetadataRegistry, SETTINGS_PANEL_BRIDGE, PRAXIS_BULK_PROPOSAL_BRIDGE, ResourceQuickViewService, normalizePraxisDataQueryContext, resolvePraxisFilterCriteria, normalizePraxisEpistemicMeta, deriveFailClosedEpistemicMetaFromError, BUILTIN_PAGE_THEME_PRESETS, PraxisEpistemicBadgeComponent, PraxisIconButtonComponent, PraxisQuickViewTriggerDirective, PRAXIS_WIDGET_SHELL_ACTION_CONTRIBUTOR, PRAXIS_QUERY_FILTER_EXPRESSION_SCHEMA_VERSION, AnalyticsStatsRequestBuilderService, AnalyticsPresentationResolver,
|
|
4
|
+
import { isPraxisSuppressionStatusSuppressed, readAnalyticsSuppressionMetadata, validateResourceQuickViewBinding, normalizeResourceQuickViewBinding, PraxisStatsExecutionService, attachAnalyticsEpistemicMetadata, attachAnalyticsSuppressionMetadata, extractAnalyticsEpistemicMetadata, extractAnalyticsSuppressionMetadata, readAnalyticsEpistemicMetadata, normalizePraxisResourcePath, extractPraxisApiPathPrefix, buildApiUrl, extractExplicitPraxisIntelligenceErrorCode, resolvePraxisIntelligenceErrorCodeFromPayload, API_URL, PraxisI18nService, EnterpriseRuntimeContextService, ComponentMetadataRegistry, SETTINGS_PANEL_BRIDGE, PRAXIS_BULK_PROPOSAL_BRIDGE, ResourceQuickViewService, isEnterpriseRuntimeSnapshotReady, normalizePraxisDataQueryContext, resolvePraxisFilterCriteria, normalizePraxisEpistemicMeta, deriveFailClosedEpistemicMetaFromError, BUILTIN_PAGE_THEME_PRESETS, PraxisEpistemicBadgeComponent, PraxisIconButtonComponent, PraxisQuickViewTriggerDirective, PRAXIS_WIDGET_SHELL_ACTION_CONTRIBUTOR, PRAXIS_QUERY_FILTER_EXPRESSION_SCHEMA_VERSION, AnalyticsStatsRequestBuilderService, AnalyticsPresentationResolver, AnalyticsSchemaContractService, resolvePraxisSchemasFilteredUrl, PraxisIconDirective, WidgetShellComponent, PraxisCacheInvalidatorService, evaluatePraxisKpiDerivation, resolvePraxisMicroVizMessage, ResourceDiscoveryService, humanizeCatalogFieldName, SchemaNormalizerService, ASYNC_CONFIG_STORAGE, ComponentKeyService, buildHeaders, providePraxisI18n, PraxisJsonLogicService, GlobalActionService, createDefaultTableConfig, resolvePraxisMicroVisualizationTone, resolvePraxisMicroWaterfallSteps, LoggerService, PRAXIS_MICRO_CHART_ENGINE_DISABLED, PRAXIS_MICRO_CHART_ENGINE, PRAXIS_TABLE_DETAIL_INLINE_RENDERERS, DynamicWidgetPageComponent, SETTINGS_PANEL_DATA, inferDomainSemanticTone, inferDomainSemanticHexColor, cloneInputsPreservingLiveReferences, IconPickerService } from '@praxisui/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
-
import { throwError, map, of, isObservable, from,
|
|
6
|
+
import { throwError, map, of, isObservable, from, catchError as catchError$1, firstValueFrom, Subject, switchMap, EMPTY, defer, defaultIfEmpty, skip, timeout, take, Subscription, BehaviorSubject } from 'rxjs';
|
|
7
7
|
import * as i1$2 from '@angular/material/tooltip';
|
|
8
8
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
9
9
|
import * as i1$1 from '@angular/common/http';
|
|
@@ -9139,6 +9139,1070 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
9139
9139
|
const PRAXIS_CHART_ENGINE = new InjectionToken('PRAXIS_CHART_ENGINE');
|
|
9140
9140
|
const PRAXIS_CHART_ENGINE_FACTORY = new InjectionToken('PRAXIS_CHART_ENGINE_FACTORY');
|
|
9141
9141
|
|
|
9142
|
+
const YEAR_MONTH_RE = /^(\d{4})[-/](\d{1,2})$/;
|
|
9143
|
+
const COMPACT_YEAR_MONTH_RE = /^(\d{4})(\d{2})$/;
|
|
9144
|
+
const MONTH_YEAR_RE = /^(\d{1,2})[-/](\d{4})$/;
|
|
9145
|
+
const ISO_DATE_PREFIX_RE = /^(\d{4})-(\d{2})-(\d{2})(?:[T\s].*)?$/;
|
|
9146
|
+
const BR_DATE_RE = /^(\d{2})\/(\d{2})\/(\d{4})$/;
|
|
9147
|
+
const MONTHLY_KEY_PREFIX_OR_EXACT_RE = /^(?:competencia|competenceMonth|referenceMonth|payrollMonth|billingMonth|periodMonth|yearMonth|monthRef|mesReferencia)(?:$|_|In$|Ids$|[A-Z])/i;
|
|
9148
|
+
const MONTHLY_SNAKE_KEY_RE = /^(?:competencia|competence_month|reference_month|payroll_month|billing_month|period_month|year_month|month_ref|mes_referencia)(?:$|_in$|_ids$)/i;
|
|
9149
|
+
function isValidYearMonth(year, month) {
|
|
9150
|
+
return Number.isInteger(year) && year >= 1 && year <= 9999 && Number.isInteger(month) && month >= 1 && month <= 12;
|
|
9151
|
+
}
|
|
9152
|
+
function isValidCalendarDate(year, month, day) {
|
|
9153
|
+
if (!isValidYearMonth(year, month) || !Number.isInteger(day) || day < 1 || day > 31) {
|
|
9154
|
+
return false;
|
|
9155
|
+
}
|
|
9156
|
+
const probe = new Date(Date.UTC(year, month - 1, day));
|
|
9157
|
+
return (probe.getUTCFullYear() === year &&
|
|
9158
|
+
probe.getUTCMonth() === month - 1 &&
|
|
9159
|
+
probe.getUTCDate() === day);
|
|
9160
|
+
}
|
|
9161
|
+
/**
|
|
9162
|
+
* Parses a date or month token into `{ year, month }` strictly rejecting months outside `01..12`.
|
|
9163
|
+
*/
|
|
9164
|
+
function parseYearMonthParts(value) {
|
|
9165
|
+
if (value instanceof Date) {
|
|
9166
|
+
return Number.isNaN(value.getTime())
|
|
9167
|
+
? null
|
|
9168
|
+
: { year: value.getUTCFullYear(), month: value.getUTCMonth() + 1 };
|
|
9169
|
+
}
|
|
9170
|
+
if (typeof value === 'number') {
|
|
9171
|
+
if (!Number.isFinite(value)) {
|
|
9172
|
+
return null;
|
|
9173
|
+
}
|
|
9174
|
+
if (Number.isInteger(value) && value >= 190001 && value <= 999912) {
|
|
9175
|
+
const year = Math.floor(value / 100);
|
|
9176
|
+
const month = value % 100;
|
|
9177
|
+
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
9178
|
+
}
|
|
9179
|
+
if (!Number.isInteger(value) || Math.abs(value) < 1e10) {
|
|
9180
|
+
return null;
|
|
9181
|
+
}
|
|
9182
|
+
const date = new Date(value);
|
|
9183
|
+
return Number.isNaN(date.getTime())
|
|
9184
|
+
? null
|
|
9185
|
+
: { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1 };
|
|
9186
|
+
}
|
|
9187
|
+
if (typeof value !== 'string') {
|
|
9188
|
+
return null;
|
|
9189
|
+
}
|
|
9190
|
+
const raw = value.trim();
|
|
9191
|
+
if (!raw) {
|
|
9192
|
+
return null;
|
|
9193
|
+
}
|
|
9194
|
+
const ymMatch = YEAR_MONTH_RE.exec(raw);
|
|
9195
|
+
if (ymMatch) {
|
|
9196
|
+
const year = Number(ymMatch[1]);
|
|
9197
|
+
const month = Number(ymMatch[2]);
|
|
9198
|
+
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
9199
|
+
}
|
|
9200
|
+
const compactMatch = COMPACT_YEAR_MONTH_RE.exec(raw);
|
|
9201
|
+
if (compactMatch) {
|
|
9202
|
+
const year = Number(compactMatch[1]);
|
|
9203
|
+
const month = Number(compactMatch[2]);
|
|
9204
|
+
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
9205
|
+
}
|
|
9206
|
+
const myMatch = MONTH_YEAR_RE.exec(raw);
|
|
9207
|
+
if (myMatch) {
|
|
9208
|
+
const month = Number(myMatch[1]);
|
|
9209
|
+
const year = Number(myMatch[2]);
|
|
9210
|
+
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
9211
|
+
}
|
|
9212
|
+
const isoMatch = ISO_DATE_PREFIX_RE.exec(raw);
|
|
9213
|
+
if (isoMatch) {
|
|
9214
|
+
const year = Number(isoMatch[1]);
|
|
9215
|
+
const month = Number(isoMatch[2]);
|
|
9216
|
+
const day = Number(isoMatch[3]);
|
|
9217
|
+
if (!isValidCalendarDate(year, month, day)) {
|
|
9218
|
+
return null;
|
|
9219
|
+
}
|
|
9220
|
+
return { year, month };
|
|
9221
|
+
}
|
|
9222
|
+
const brMatch = BR_DATE_RE.exec(raw);
|
|
9223
|
+
if (brMatch) {
|
|
9224
|
+
const day = Number(brMatch[1]);
|
|
9225
|
+
const month = Number(brMatch[2]);
|
|
9226
|
+
const year = Number(brMatch[3]);
|
|
9227
|
+
if (!isValidCalendarDate(year, month, day)) {
|
|
9228
|
+
return null;
|
|
9229
|
+
}
|
|
9230
|
+
return { year, month };
|
|
9231
|
+
}
|
|
9232
|
+
return null;
|
|
9233
|
+
}
|
|
9234
|
+
/**
|
|
9235
|
+
* Formats valid year/month inputs as `'YYYY-MM'`. Returns `null` for invalid tokens or months outside `01..12`.
|
|
9236
|
+
*/
|
|
9237
|
+
function normalizeYearMonthToken(value) {
|
|
9238
|
+
const parts = parseYearMonthParts(value);
|
|
9239
|
+
if (!parts) {
|
|
9240
|
+
return null;
|
|
9241
|
+
}
|
|
9242
|
+
return `${String(parts.year).padStart(4, '0')}-${String(parts.month).padStart(2, '0')}`;
|
|
9243
|
+
}
|
|
9244
|
+
/**
|
|
9245
|
+
* Normalizes a scalar or collection of month/competence values into deduplicated `['YYYY-MM']` strings,
|
|
9246
|
+
* strictly dropping any tokens outside `01..12`.
|
|
9247
|
+
*/
|
|
9248
|
+
function normalizeMonthlyFilterValues(value) {
|
|
9249
|
+
const rawItems = Array.isArray(value) ? value : [value];
|
|
9250
|
+
const result = [];
|
|
9251
|
+
const seen = new Set();
|
|
9252
|
+
for (const item of rawItems) {
|
|
9253
|
+
const token = normalizeYearMonthToken(item);
|
|
9254
|
+
if (!token || seen.has(token)) {
|
|
9255
|
+
continue;
|
|
9256
|
+
}
|
|
9257
|
+
seen.add(token);
|
|
9258
|
+
result.push(token);
|
|
9259
|
+
}
|
|
9260
|
+
return result;
|
|
9261
|
+
}
|
|
9262
|
+
function formatIsoMonthStart(parts) {
|
|
9263
|
+
return `${String(parts.year).padStart(4, '0')}-${String(parts.month).padStart(2, '0')}-01`;
|
|
9264
|
+
}
|
|
9265
|
+
function formatIsoMonthEnd(parts) {
|
|
9266
|
+
const lastDay = new Date(Date.UTC(parts.year, parts.month, 0)).getUTCDate();
|
|
9267
|
+
return `${String(parts.year).padStart(4, '0')}-${String(parts.month).padStart(2, '0')}-${String(lastDay).padStart(2, '0')}`;
|
|
9268
|
+
}
|
|
9269
|
+
/**
|
|
9270
|
+
* Expands a valid month token or `[from, to]` monthly bounds into canonical ISO calendar boundaries
|
|
9271
|
+
* (`[YYYY-MM-01, YYYY-MM-lastDay]`), rejecting months outside `01..12`.
|
|
9272
|
+
*/
|
|
9273
|
+
function expandMonthlyRangeToIsoDates(value) {
|
|
9274
|
+
if (Array.isArray(value)) {
|
|
9275
|
+
if (value.length !== 2) {
|
|
9276
|
+
return null;
|
|
9277
|
+
}
|
|
9278
|
+
const [rawLow, rawHigh] = value;
|
|
9279
|
+
const hasLow = rawLow !== undefined && rawLow !== null && rawLow !== '';
|
|
9280
|
+
const hasHigh = rawHigh !== undefined && rawHigh !== null && rawHigh !== '';
|
|
9281
|
+
if (!hasLow && !hasHigh) {
|
|
9282
|
+
return null;
|
|
9283
|
+
}
|
|
9284
|
+
const lowParts = hasLow ? parseYearMonthParts(rawLow) : null;
|
|
9285
|
+
const highParts = hasHigh ? parseYearMonthParts(rawHigh) : null;
|
|
9286
|
+
if ((hasLow && !lowParts) || (hasHigh && !highParts)) {
|
|
9287
|
+
return null;
|
|
9288
|
+
}
|
|
9289
|
+
return [
|
|
9290
|
+
lowParts ? formatIsoMonthStart(lowParts) : null,
|
|
9291
|
+
highParts ? formatIsoMonthEnd(highParts) : null,
|
|
9292
|
+
];
|
|
9293
|
+
}
|
|
9294
|
+
if (value && typeof value === 'object' && !(value instanceof Date)) {
|
|
9295
|
+
const record = value;
|
|
9296
|
+
const rawLow = record['from'] ?? record['gte'] ?? record['start'];
|
|
9297
|
+
const rawHigh = record['to'] ?? record['lte'] ?? record['lt'] ?? record['end'];
|
|
9298
|
+
return expandMonthlyRangeToIsoDates([rawLow ?? null, rawHigh ?? null]);
|
|
9299
|
+
}
|
|
9300
|
+
const singleParts = parseYearMonthParts(value);
|
|
9301
|
+
if (!singleParts) {
|
|
9302
|
+
return null;
|
|
9303
|
+
}
|
|
9304
|
+
return [formatIsoMonthStart(singleParts), formatIsoMonthEnd(singleParts)];
|
|
9305
|
+
}
|
|
9306
|
+
/**
|
|
9307
|
+
* Detects neutral monthly reference filter keys (`competencia*`, `yearMonth*`, `referenceMonth*`, etc.).
|
|
9308
|
+
*/
|
|
9309
|
+
function isMonthlyFilterKey(key) {
|
|
9310
|
+
const trimmed = key.trim();
|
|
9311
|
+
if (!trimmed) {
|
|
9312
|
+
return false;
|
|
9313
|
+
}
|
|
9314
|
+
return MONTHLY_KEY_PREFIX_OR_EXACT_RE.test(trimmed) || MONTHLY_SNAKE_KEY_RE.test(trimmed);
|
|
9315
|
+
}
|
|
9316
|
+
|
|
9317
|
+
const RANGE_SUFFIX_RE = /(?:Range|Between|Entre|Period|Dates?)$/i;
|
|
9318
|
+
const DATE_RANGE_KEY_RE = /(?:Dates?|DateRange|DateBetween|DateEntre|DatePeriod|DataRange|DataBetween|DataEntre|DataPeriod)$/i;
|
|
9319
|
+
const MONTH_ONLY_STRING_RE = /^(?:\d{4}[-/]\d{1,2}|\d{1,2}[-/]\d{4}|\d{6})$/;
|
|
9320
|
+
const SCALAR_COMPOUND_IN_KEYS = new Set([
|
|
9321
|
+
'checkin',
|
|
9322
|
+
'signin',
|
|
9323
|
+
'login',
|
|
9324
|
+
'linkedin',
|
|
9325
|
+
'tradein',
|
|
9326
|
+
'walkin',
|
|
9327
|
+
'builtin',
|
|
9328
|
+
'dropin',
|
|
9329
|
+
'clockin',
|
|
9330
|
+
'optin',
|
|
9331
|
+
'punchin',
|
|
9332
|
+
'clock_in',
|
|
9333
|
+
'check_in',
|
|
9334
|
+
'sign_in',
|
|
9335
|
+
'log_in',
|
|
9336
|
+
'walk_in',
|
|
9337
|
+
'built_in',
|
|
9338
|
+
'drop_in',
|
|
9339
|
+
'trade_in',
|
|
9340
|
+
'linked_in',
|
|
9341
|
+
'opt_in',
|
|
9342
|
+
'punch_in',
|
|
9343
|
+
]);
|
|
9344
|
+
const PREFIXED_SCALAR_CAMEL_IN_RE = /(?:Check|Sign|Log|Clock|Walk|Drop|Trade|Built|Linked|Opt|Punch)In$/;
|
|
9345
|
+
const PREFIXED_SCALAR_SNAKE_IN_RE = /(?:^|_)(?:check|sign|log|clock|walk|drop|trade|built|linked|opt|punch)_in$/i;
|
|
9346
|
+
function isRecord(value) {
|
|
9347
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
9348
|
+
}
|
|
9349
|
+
function coerceMonthlyRangeBounds(key, rawLow, rawHigh) {
|
|
9350
|
+
const hasLow = rawLow !== undefined && rawLow !== null && rawLow !== '';
|
|
9351
|
+
const hasHigh = rawHigh !== undefined && rawHigh !== null && rawHigh !== '';
|
|
9352
|
+
if (DATE_RANGE_KEY_RE.test(key)) {
|
|
9353
|
+
const lowExpanded = hasLow ? expandMonthlyRangeToIsoDates([rawLow, null])?.[0] ?? null : null;
|
|
9354
|
+
const highExpanded = hasHigh ? expandMonthlyRangeToIsoDates([null, rawHigh])?.[1] ?? null : null;
|
|
9355
|
+
return [lowExpanded, highExpanded];
|
|
9356
|
+
}
|
|
9357
|
+
return [
|
|
9358
|
+
hasLow ? (normalizeYearMonthToken(rawLow) ?? null) : null,
|
|
9359
|
+
hasHigh ? (normalizeYearMonthToken(rawHigh) ?? null) : null,
|
|
9360
|
+
];
|
|
9361
|
+
}
|
|
9362
|
+
function isEmptyBound(value) {
|
|
9363
|
+
return value === undefined || value === null || value === '';
|
|
9364
|
+
}
|
|
9365
|
+
function isMonthOnlyToken(value) {
|
|
9366
|
+
return ((typeof value === 'string' && MONTH_ONLY_STRING_RE.test(value.trim())) ||
|
|
9367
|
+
(typeof value === 'number' && Number.isInteger(value) && value >= 190001 && value <= 999912));
|
|
9368
|
+
}
|
|
9369
|
+
function isMonthlyDateRangeTuple(key, values) {
|
|
9370
|
+
if (!DATE_RANGE_KEY_RE.test(key) || values.length !== 2) {
|
|
9371
|
+
return false;
|
|
9372
|
+
}
|
|
9373
|
+
const [low, high] = values;
|
|
9374
|
+
const hasMonthToken = isMonthOnlyToken(low) || isMonthOnlyToken(high);
|
|
9375
|
+
return (hasMonthToken &&
|
|
9376
|
+
(isEmptyBound(low) || isMonthOnlyToken(low)) &&
|
|
9377
|
+
(isEmptyBound(high) || isMonthOnlyToken(high)));
|
|
9378
|
+
}
|
|
9379
|
+
/**
|
|
9380
|
+
* Coerces a single cross-filter entry to canonical Praxis FilterDTO wire format:
|
|
9381
|
+
* - Keys targeting `IN` sets (suffix `In`, `Ids`, or collection-bound `IN` fields) -> flat deduplicated array.
|
|
9382
|
+
* - Range objects (`{ from, to }`, `{ start, end }`, `{ gte, lt }`, `{ gte, lte }`) -> `[from, to]` tuple when bounded.
|
|
9383
|
+
* - Primitive scalars remain scalar values.
|
|
9384
|
+
*/
|
|
9385
|
+
function coerceCrossFilterValue(key, rawValue) {
|
|
9386
|
+
if (rawValue === undefined || rawValue === null) {
|
|
9387
|
+
return rawValue;
|
|
9388
|
+
}
|
|
9389
|
+
const trimmedKey = key.trim();
|
|
9390
|
+
const isMonthKey = isMonthlyFilterKey(trimmedKey);
|
|
9391
|
+
const isKnownScalarInCompound = SCALAR_COMPOUND_IN_KEYS.has(trimmedKey.toLowerCase()) ||
|
|
9392
|
+
PREFIXED_SCALAR_CAMEL_IN_RE.test(trimmedKey) ||
|
|
9393
|
+
PREFIXED_SCALAR_SNAKE_IN_RE.test(trimmedKey);
|
|
9394
|
+
const isBooleanInFlag = !Array.isArray(rawValue) &&
|
|
9395
|
+
typeof rawValue === 'boolean' &&
|
|
9396
|
+
/(?:In|_in)$/i.test(trimmedKey);
|
|
9397
|
+
const expectsArray = !isKnownScalarInCompound &&
|
|
9398
|
+
!isBooleanInFlag &&
|
|
9399
|
+
(/(?:In|Ids)$/.test(trimmedKey) ||
|
|
9400
|
+
trimmedKey.toLowerCase().endsWith('_in'));
|
|
9401
|
+
if (isRecord(rawValue)) {
|
|
9402
|
+
const low = rawValue['from'] ?? rawValue['gte'] ?? rawValue['start'];
|
|
9403
|
+
const high = rawValue['to'] ?? rawValue['lte'] ?? rawValue['lt'] ?? rawValue['end'];
|
|
9404
|
+
const hasLow = low !== undefined && low !== null;
|
|
9405
|
+
const hasHigh = high !== undefined && high !== null;
|
|
9406
|
+
if (hasLow || hasHigh) {
|
|
9407
|
+
if (isMonthKey) {
|
|
9408
|
+
return coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
9409
|
+
}
|
|
9410
|
+
if (DATE_RANGE_KEY_RE.test(trimmedKey) && (!hasLow || isMonthOnlyToken(low)) && (!hasHigh || isMonthOnlyToken(high))) {
|
|
9411
|
+
return coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
9412
|
+
}
|
|
9413
|
+
return [hasLow ? low : null, hasHigh ? high : null];
|
|
9414
|
+
}
|
|
9415
|
+
if (isMonthKey && Array.isArray(rawValue['values'])) {
|
|
9416
|
+
return normalizeMonthlyFilterValues(rawValue['values']);
|
|
9417
|
+
}
|
|
9418
|
+
if (Array.isArray(rawValue['values'])) {
|
|
9419
|
+
return [...rawValue['values']];
|
|
9420
|
+
}
|
|
9421
|
+
}
|
|
9422
|
+
if (isMonthKey) {
|
|
9423
|
+
if (Array.isArray(rawValue) && rawValue.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
9424
|
+
return coerceMonthlyRangeBounds(trimmedKey, rawValue[0], rawValue[1]);
|
|
9425
|
+
}
|
|
9426
|
+
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
9427
|
+
return expandMonthlyRangeToIsoDates(rawValue) ?? [];
|
|
9428
|
+
}
|
|
9429
|
+
return normalizeMonthlyFilterValues(rawValue);
|
|
9430
|
+
}
|
|
9431
|
+
if (expectsArray) {
|
|
9432
|
+
const items = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
9433
|
+
const deduped = [];
|
|
9434
|
+
const seen = new Set();
|
|
9435
|
+
for (const item of items) {
|
|
9436
|
+
if (item === undefined || item === null || item === '')
|
|
9437
|
+
continue;
|
|
9438
|
+
const sig = `${typeof item}:${String(item)}`;
|
|
9439
|
+
if (!seen.has(sig)) {
|
|
9440
|
+
seen.add(sig);
|
|
9441
|
+
deduped.push(item);
|
|
9442
|
+
}
|
|
9443
|
+
}
|
|
9444
|
+
return deduped;
|
|
9445
|
+
}
|
|
9446
|
+
if (Array.isArray(rawValue) && rawValue.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
9447
|
+
if (isMonthlyDateRangeTuple(trimmedKey, rawValue)) {
|
|
9448
|
+
return coerceMonthlyRangeBounds(trimmedKey, rawValue[0], rawValue[1]);
|
|
9449
|
+
}
|
|
9450
|
+
return [rawValue[0], rawValue[1]];
|
|
9451
|
+
}
|
|
9452
|
+
return rawValue;
|
|
9453
|
+
}
|
|
9454
|
+
/**
|
|
9455
|
+
* Coerces all keys in a cross-filter map into FilterDTO-compatible payloads (`*In` arrays, `BETWEEN` tuples, scalars).
|
|
9456
|
+
*/
|
|
9457
|
+
function coerceCrossFilterPayload(rawFilters, projection) {
|
|
9458
|
+
if (!isRecord(rawFilters)) {
|
|
9459
|
+
return {};
|
|
9460
|
+
}
|
|
9461
|
+
const dimensionRoleMap = new Map();
|
|
9462
|
+
const registerDimension = (dim) => {
|
|
9463
|
+
if (!dim)
|
|
9464
|
+
return;
|
|
9465
|
+
const role = dim.role ?? 'category';
|
|
9466
|
+
const field = dim.field?.trim();
|
|
9467
|
+
if (field) {
|
|
9468
|
+
dimensionRoleMap.set(field, role);
|
|
9469
|
+
}
|
|
9470
|
+
const keyFilterField = dim.keyFilterField?.trim();
|
|
9471
|
+
if (keyFilterField) {
|
|
9472
|
+
dimensionRoleMap.set(keyFilterField, role);
|
|
9473
|
+
}
|
|
9474
|
+
};
|
|
9475
|
+
registerDimension(projection?.bindings?.primaryDimension);
|
|
9476
|
+
registerDimension(projection?.bindings?.secondaryDimension);
|
|
9477
|
+
if (Array.isArray(projection?.bindings?.dimensions)) {
|
|
9478
|
+
for (const dim of projection.bindings.dimensions) {
|
|
9479
|
+
registerDimension(dim);
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
const secondaryDims = projection?.bindings?.secondaryDimensions;
|
|
9483
|
+
if (Array.isArray(secondaryDims)) {
|
|
9484
|
+
for (const dim of secondaryDims) {
|
|
9485
|
+
registerDimension(dim);
|
|
9486
|
+
}
|
|
9487
|
+
}
|
|
9488
|
+
const next = {};
|
|
9489
|
+
for (const [key, value] of Object.entries(rawFilters)) {
|
|
9490
|
+
if (value === undefined)
|
|
9491
|
+
continue;
|
|
9492
|
+
const trimmedKey = key.trim();
|
|
9493
|
+
const role = dimensionRoleMap.get(key);
|
|
9494
|
+
const isMonthRole = role === 'month' || role === 'year-month' || role === 'competence';
|
|
9495
|
+
if (isMonthRole) {
|
|
9496
|
+
if (isRecord(value)) {
|
|
9497
|
+
const low = value['from'] ?? value['gte'] ?? value['start'];
|
|
9498
|
+
const high = value['to'] ?? value['lte'] ?? value['lt'] ?? value['end'];
|
|
9499
|
+
const hasLow = low !== undefined && low !== null;
|
|
9500
|
+
const hasHigh = high !== undefined && high !== null;
|
|
9501
|
+
next[key] = hasLow || hasHigh
|
|
9502
|
+
? coerceMonthlyRangeBounds(trimmedKey, low, high)
|
|
9503
|
+
: Array.isArray(value['values'])
|
|
9504
|
+
? normalizeMonthlyFilterValues(value['values'])
|
|
9505
|
+
: coerceCrossFilterValue(key, value);
|
|
9506
|
+
continue;
|
|
9507
|
+
}
|
|
9508
|
+
if (Array.isArray(value) && value.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
9509
|
+
next[key] = coerceMonthlyRangeBounds(trimmedKey, value[0], value[1]);
|
|
9510
|
+
continue;
|
|
9511
|
+
}
|
|
9512
|
+
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
9513
|
+
next[key] = expandMonthlyRangeToIsoDates(value) ?? [];
|
|
9514
|
+
continue;
|
|
9515
|
+
}
|
|
9516
|
+
next[key] = normalizeMonthlyFilterValues(value);
|
|
9517
|
+
continue;
|
|
9518
|
+
}
|
|
9519
|
+
if ((role === 'range' || role === 'bucket') && isRecord(value)) {
|
|
9520
|
+
const low = value['from'] ?? value['gte'] ?? value['start'];
|
|
9521
|
+
const high = value['to'] ?? value['lte'] ?? value['lt'] ?? value['end'];
|
|
9522
|
+
const hasLow = low !== undefined && low !== null;
|
|
9523
|
+
const hasHigh = high !== undefined && high !== null;
|
|
9524
|
+
if (hasLow || hasHigh) {
|
|
9525
|
+
if (isMonthlyFilterKey(trimmedKey)) {
|
|
9526
|
+
next[key] = coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
9527
|
+
continue;
|
|
9528
|
+
}
|
|
9529
|
+
if (DATE_RANGE_KEY_RE.test(trimmedKey) && (!hasLow || isMonthOnlyToken(low)) && (!hasHigh || isMonthOnlyToken(high))) {
|
|
9530
|
+
next[key] = coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
9531
|
+
continue;
|
|
9532
|
+
}
|
|
9533
|
+
next[key] = [hasLow ? low : null, hasHigh ? high : null];
|
|
9534
|
+
continue;
|
|
9535
|
+
}
|
|
9536
|
+
next[key] = coerceCrossFilterValue(key, value);
|
|
9537
|
+
continue;
|
|
9538
|
+
}
|
|
9539
|
+
if ((role === 'range' || role === 'bucket') && !isRecord(value)) {
|
|
9540
|
+
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
9541
|
+
if (Array.isArray(value) && isMonthlyDateRangeTuple(trimmedKey, value)) {
|
|
9542
|
+
next[key] = coerceMonthlyRangeBounds(trimmedKey, value[0], value[1]);
|
|
9543
|
+
continue;
|
|
9544
|
+
}
|
|
9545
|
+
if (isMonthOnlyToken(value)) {
|
|
9546
|
+
next[key] = expandMonthlyRangeToIsoDates(value) ?? [];
|
|
9547
|
+
continue;
|
|
9548
|
+
}
|
|
9549
|
+
}
|
|
9550
|
+
next[key] = coerceCrossFilterValue(key, value);
|
|
9551
|
+
continue;
|
|
9552
|
+
}
|
|
9553
|
+
next[key] = coerceCrossFilterValue(key, value);
|
|
9554
|
+
}
|
|
9555
|
+
return next;
|
|
9556
|
+
}
|
|
9557
|
+
function mergeCrossFiltersIntoQueryContext(baseQueryContext, crossFilters, lockedKeys = []) {
|
|
9558
|
+
const lockedSet = new Set(lockedKeys);
|
|
9559
|
+
const baseFilters = isRecord(baseQueryContext?.filters)
|
|
9560
|
+
? { ...baseQueryContext.filters }
|
|
9561
|
+
: {};
|
|
9562
|
+
const mergedFilters = { ...baseFilters };
|
|
9563
|
+
for (const [key, value] of Object.entries(crossFilters)) {
|
|
9564
|
+
if (lockedSet.has(key))
|
|
9565
|
+
continue;
|
|
9566
|
+
if (value === undefined || value === null || (Array.isArray(value) && value.length === 0)) {
|
|
9567
|
+
delete mergedFilters[key];
|
|
9568
|
+
}
|
|
9569
|
+
else {
|
|
9570
|
+
mergedFilters[key] = value;
|
|
9571
|
+
}
|
|
9572
|
+
}
|
|
9573
|
+
return {
|
|
9574
|
+
...(baseQueryContext ?? {}),
|
|
9575
|
+
filters: mergedFilters,
|
|
9576
|
+
};
|
|
9577
|
+
}
|
|
9578
|
+
|
|
9579
|
+
const NON_DIMENSION_TIMESERIES_MSG = undefined;
|
|
9580
|
+
function isEmptyFilterValue(value) {
|
|
9581
|
+
if (value === undefined || value === null || value === '') {
|
|
9582
|
+
return true;
|
|
9583
|
+
}
|
|
9584
|
+
if (Array.isArray(value)) {
|
|
9585
|
+
return value.length === 0;
|
|
9586
|
+
}
|
|
9587
|
+
return false;
|
|
9588
|
+
}
|
|
9589
|
+
function cloneFilterValue(value) {
|
|
9590
|
+
if (Array.isArray(value)) {
|
|
9591
|
+
return [...value];
|
|
9592
|
+
}
|
|
9593
|
+
if (value && typeof value === 'object') {
|
|
9594
|
+
return { ...value };
|
|
9595
|
+
}
|
|
9596
|
+
return value;
|
|
9597
|
+
}
|
|
9598
|
+
function copyNonEmptyFilters(source) {
|
|
9599
|
+
if (!source || typeof source !== 'object' || Array.isArray(source)) {
|
|
9600
|
+
return {};
|
|
9601
|
+
}
|
|
9602
|
+
const result = {};
|
|
9603
|
+
for (const [key, value] of Object.entries(source)) {
|
|
9604
|
+
const trimmedKey = key.trim();
|
|
9605
|
+
if (!trimmedKey || isEmptyFilterValue(value)) {
|
|
9606
|
+
continue;
|
|
9607
|
+
}
|
|
9608
|
+
result[trimmedKey] = cloneFilterValue(value);
|
|
9609
|
+
}
|
|
9610
|
+
return result;
|
|
9611
|
+
}
|
|
9612
|
+
function normalizeResourceKey(resourcePath) {
|
|
9613
|
+
return normalizePraxisResourcePath(resourcePath, {
|
|
9614
|
+
style: 'relative',
|
|
9615
|
+
stripApiPrefix: true,
|
|
9616
|
+
}).toLowerCase();
|
|
9617
|
+
}
|
|
9618
|
+
function toScalarOrArrayTokens(value) {
|
|
9619
|
+
if (value === undefined || value === null || value === '') {
|
|
9620
|
+
return [];
|
|
9621
|
+
}
|
|
9622
|
+
const list = Array.isArray(value) ? value : [value];
|
|
9623
|
+
return list
|
|
9624
|
+
.filter((entry) => entry !== undefined && entry !== null && entry !== '')
|
|
9625
|
+
.map((entry) => `${typeof entry}:${String(entry)}`)
|
|
9626
|
+
.sort();
|
|
9627
|
+
}
|
|
9628
|
+
/**
|
|
9629
|
+
* Resolves the categorical/grouping dimension field used for anti-feedback-loop detection.
|
|
9630
|
+
* Timeseries date fields intentionally return `undefined` unless explicitly configured in `excludeFields`.
|
|
9631
|
+
*/
|
|
9632
|
+
function resolveKpiDimensionField(spec, resolvedProjection) {
|
|
9633
|
+
if (spec.source.kind === 'stats-query') {
|
|
9634
|
+
if (spec.source.operation === 'group-by' || spec.source.operation === 'comparison') {
|
|
9635
|
+
return spec.source.request.field?.trim() || NON_DIMENSION_TIMESERIES_MSG;
|
|
9636
|
+
}
|
|
9637
|
+
return undefined;
|
|
9638
|
+
}
|
|
9639
|
+
if (spec.source.kind === 'analytics-projection' && resolvedProjection) {
|
|
9640
|
+
if (resolvedProjection.source.operation === 'group-by' ||
|
|
9641
|
+
resolvedProjection.source.operation === 'comparison') {
|
|
9642
|
+
const dim = resolvedProjection.bindings?.primaryDimension ??
|
|
9643
|
+
resolvedProjection.bindings?.dimensions?.[0];
|
|
9644
|
+
return dim?.keyFilterField?.trim() || dim?.field?.trim() || undefined;
|
|
9645
|
+
}
|
|
9646
|
+
}
|
|
9647
|
+
return spec.interaction?.crossFilter?.dimensionField?.trim() || undefined;
|
|
9648
|
+
}
|
|
9649
|
+
function expandDimensionKeyVariants(rawKey) {
|
|
9650
|
+
const variants = new Set();
|
|
9651
|
+
const trimmed = rawKey.trim();
|
|
9652
|
+
if (!trimmed) {
|
|
9653
|
+
return variants;
|
|
9654
|
+
}
|
|
9655
|
+
const baseCandidates = new Set([trimmed.toLowerCase()]);
|
|
9656
|
+
for (const pattern of [
|
|
9657
|
+
/_in$/i,
|
|
9658
|
+
/_ids$/i,
|
|
9659
|
+
/(?<=[a-z0-9])IdsIn$/,
|
|
9660
|
+
/(?<=[a-z0-9])IdIn$/,
|
|
9661
|
+
/(?<=[a-z0-9])In$/,
|
|
9662
|
+
/(?<=[a-z0-9])Ids$/,
|
|
9663
|
+
/(?<=[a-z0-9])Id$/,
|
|
9664
|
+
]) {
|
|
9665
|
+
if (pattern.test(trimmed)) {
|
|
9666
|
+
const stripped = trimmed.replace(pattern, '').trim().toLowerCase();
|
|
9667
|
+
if (stripped.length > 1) {
|
|
9668
|
+
baseCandidates.add(stripped);
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
}
|
|
9672
|
+
for (const dim of Array.from(baseCandidates)) {
|
|
9673
|
+
variants.add(dim);
|
|
9674
|
+
variants.add(`${dim}s`);
|
|
9675
|
+
variants.add(`${dim}es`);
|
|
9676
|
+
variants.add(`${dim}in`);
|
|
9677
|
+
variants.add(`${dim}ids`);
|
|
9678
|
+
variants.add(`${dim}_in`);
|
|
9679
|
+
if (dim.endsWith('y') && dim.length > 1) {
|
|
9680
|
+
variants.add(`${dim.slice(0, -1)}ies`);
|
|
9681
|
+
}
|
|
9682
|
+
if (dim.endsWith('ies') && dim.length > 3) {
|
|
9683
|
+
variants.add(`${dim.slice(0, -3)}y`);
|
|
9684
|
+
}
|
|
9685
|
+
if (dim.endsWith('s') && dim.length > 1) {
|
|
9686
|
+
variants.add(dim.slice(0, -1));
|
|
9687
|
+
}
|
|
9688
|
+
if (dim.endsWith('es') && dim.length > 2) {
|
|
9689
|
+
variants.add(dim.slice(0, -2));
|
|
9690
|
+
}
|
|
9691
|
+
if (dim.endsWith('ao') && dim.length > 2) {
|
|
9692
|
+
const stem = dim.slice(0, -2);
|
|
9693
|
+
variants.add(`${stem}oes`);
|
|
9694
|
+
variants.add(`${stem}aes`);
|
|
9695
|
+
variants.add(`${stem}aos`);
|
|
9696
|
+
}
|
|
9697
|
+
if (dim.endsWith('oes') && dim.length > 3) {
|
|
9698
|
+
variants.add(`${dim.slice(0, -3)}ao`);
|
|
9699
|
+
}
|
|
9700
|
+
if (dim.endsWith('aes') && dim.length > 3) {
|
|
9701
|
+
variants.add(`${dim.slice(0, -3)}ao`);
|
|
9702
|
+
}
|
|
9703
|
+
if (dim.endsWith('al') && dim.length > 2) {
|
|
9704
|
+
variants.add(`${dim.slice(0, -2)}ais`);
|
|
9705
|
+
}
|
|
9706
|
+
if (dim.endsWith('ais') && dim.length > 3) {
|
|
9707
|
+
variants.add(`${dim.slice(0, -3)}al`);
|
|
9708
|
+
}
|
|
9709
|
+
if (dim.endsWith('el') && dim.length > 2) {
|
|
9710
|
+
variants.add(`${dim.slice(0, -2)}eis`);
|
|
9711
|
+
}
|
|
9712
|
+
if (dim.endsWith('eis') && dim.length > 3) {
|
|
9713
|
+
variants.add(`${dim.slice(0, -3)}el`);
|
|
9714
|
+
}
|
|
9715
|
+
if (dim.endsWith('ol') && dim.length > 2) {
|
|
9716
|
+
variants.add(`${dim.slice(0, -2)}ois`);
|
|
9717
|
+
}
|
|
9718
|
+
if (dim.endsWith('ois') && dim.length > 3) {
|
|
9719
|
+
variants.add(`${dim.slice(0, -3)}ol`);
|
|
9720
|
+
}
|
|
9721
|
+
if ((dim.endsWith('r') || dim.endsWith('z')) && dim.length > 1) {
|
|
9722
|
+
variants.add(`${dim}es`);
|
|
9723
|
+
}
|
|
9724
|
+
if ((dim.endsWith('res') || dim.endsWith('zes')) && dim.length > 3) {
|
|
9725
|
+
variants.add(dim.slice(0, -2));
|
|
9726
|
+
}
|
|
9727
|
+
if (dim.endsWith('id') && dim.length > 2) {
|
|
9728
|
+
const stem = dim.slice(0, -2);
|
|
9729
|
+
variants.add(stem);
|
|
9730
|
+
variants.add(`${stem}ids`);
|
|
9731
|
+
variants.add(`${stem}idin`);
|
|
9732
|
+
}
|
|
9733
|
+
}
|
|
9734
|
+
return variants;
|
|
9735
|
+
}
|
|
9736
|
+
/**
|
|
9737
|
+
* Symmetric matcher for canonical FilterDTO dimension key variants
|
|
9738
|
+
* (`status` <-> `statuses`, `category` <-> `categories`, `situacao` <-> `situacoes`, `appointmentType` <-> `appointmentTypes`/`appointmentTypeIn`, `departmentId` <-> `departmentIds`/`departmentIdIn`).
|
|
9739
|
+
*/
|
|
9740
|
+
function matchesDimensionFieldKey(filterKey, dimensionField) {
|
|
9741
|
+
const first = expandDimensionKeyVariants(filterKey);
|
|
9742
|
+
const second = expandDimensionKeyVariants(dimensionField);
|
|
9743
|
+
if (first.size === 0 || second.size === 0) {
|
|
9744
|
+
return false;
|
|
9745
|
+
}
|
|
9746
|
+
for (const variant of first) {
|
|
9747
|
+
if (second.has(variant)) {
|
|
9748
|
+
return true;
|
|
9749
|
+
}
|
|
9750
|
+
}
|
|
9751
|
+
return false;
|
|
9752
|
+
}
|
|
9753
|
+
function isDiscreteSetValue(value) {
|
|
9754
|
+
if (Array.isArray(value)) {
|
|
9755
|
+
return value.every((item) => item !== null && typeof item !== 'object');
|
|
9756
|
+
}
|
|
9757
|
+
return value !== null && value !== undefined && typeof value !== 'object';
|
|
9758
|
+
}
|
|
9759
|
+
function intersectDiscreteFilterValues(first, second) {
|
|
9760
|
+
if (!isDiscreteSetValue(first) || !isDiscreteSetValue(second)) {
|
|
9761
|
+
return { compatible: false, value: undefined };
|
|
9762
|
+
}
|
|
9763
|
+
const firstList = (Array.isArray(first) ? first : [first]).filter((entry) => entry !== undefined && entry !== null && entry !== '');
|
|
9764
|
+
const secondTokens = new Set(toScalarOrArrayTokens(second));
|
|
9765
|
+
const seen = new Set();
|
|
9766
|
+
const intersection = [];
|
|
9767
|
+
for (const item of firstList) {
|
|
9768
|
+
const token = `${typeof item}:${String(item)}`;
|
|
9769
|
+
if (secondTokens.has(token) && !seen.has(token)) {
|
|
9770
|
+
seen.add(token);
|
|
9771
|
+
intersection.push(item);
|
|
9772
|
+
}
|
|
9773
|
+
}
|
|
9774
|
+
if (intersection.length === 0) {
|
|
9775
|
+
return { compatible: false, value: undefined };
|
|
9776
|
+
}
|
|
9777
|
+
if (!Array.isArray(first) && !Array.isArray(second) && intersection.length === 1) {
|
|
9778
|
+
return { compatible: true, value: intersection[0] };
|
|
9779
|
+
}
|
|
9780
|
+
return { compatible: true, value: intersection };
|
|
9781
|
+
}
|
|
9782
|
+
function mergeConjunctiveFilterEntry(target, key, incomingValue, preferTargetOnConflict) {
|
|
9783
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
9784
|
+
target[key] = cloneFilterValue(incomingValue);
|
|
9785
|
+
return;
|
|
9786
|
+
}
|
|
9787
|
+
const existingValue = target[key];
|
|
9788
|
+
const intersection = intersectDiscreteFilterValues(existingValue, incomingValue);
|
|
9789
|
+
if (intersection.compatible) {
|
|
9790
|
+
target[key] = intersection.value;
|
|
9791
|
+
return;
|
|
9792
|
+
}
|
|
9793
|
+
if (!preferTargetOnConflict) {
|
|
9794
|
+
target[key] = cloneFilterValue(incomingValue);
|
|
9795
|
+
}
|
|
9796
|
+
}
|
|
9797
|
+
/**
|
|
9798
|
+
* Resolves the ambient context filters supplied by the cockpit (Channel 1 `scopeFilters`
|
|
9799
|
+
* and filtered Channel 2 `crossFilters`), guaranteeing Channel 2 never overwrites or widens
|
|
9800
|
+
* Channel 1 global scope filters.
|
|
9801
|
+
*/
|
|
9802
|
+
function resolveKpiContextFilters(spec, queryContext, resolvedProjection) {
|
|
9803
|
+
const effective = copyNonEmptyFilters(queryContext?.meta?.scopeFilters);
|
|
9804
|
+
const scopeKeys = new Set(Object.keys(effective).map((k) => k.trim().toLowerCase()));
|
|
9805
|
+
const reactionMode = spec.interaction?.filterReaction?.mode ?? 'all-except-own-dimension';
|
|
9806
|
+
const crossFilters = copyNonEmptyFilters(queryContext?.filters);
|
|
9807
|
+
const crossFilterSources = queryContext?.meta?.crossFilterSources ?? {};
|
|
9808
|
+
if (reactionMode !== 'page-scope-only') {
|
|
9809
|
+
const excludeSet = new Set((spec.interaction?.filterReaction?.excludeFields ?? [])
|
|
9810
|
+
.map((field) => field.trim().toLowerCase())
|
|
9811
|
+
.filter(Boolean));
|
|
9812
|
+
const ownCrossFilterField = spec.interaction?.crossFilter?.field?.trim() ?? '';
|
|
9813
|
+
const dimensionField = resolveKpiDimensionField(spec, resolvedProjection);
|
|
9814
|
+
const cardResourceKey = normalizeResourceKey(spec.source.resourcePath);
|
|
9815
|
+
for (const [key, value] of Object.entries(crossFilters)) {
|
|
9816
|
+
const normalizedKey = key.trim().toLowerCase();
|
|
9817
|
+
if (excludeSet.has(normalizedKey)) {
|
|
9818
|
+
continue;
|
|
9819
|
+
}
|
|
9820
|
+
const sourceMeta = crossFilterSources[key];
|
|
9821
|
+
const sourceTargetResource = normalizeResourceKey(sourceMeta?.targetResourcePath);
|
|
9822
|
+
if (sourceTargetResource &&
|
|
9823
|
+
cardResourceKey &&
|
|
9824
|
+
sourceTargetResource !== cardResourceKey) {
|
|
9825
|
+
continue;
|
|
9826
|
+
}
|
|
9827
|
+
if (reactionMode === 'all-except-own-dimension') {
|
|
9828
|
+
if (ownCrossFilterField && matchesDimensionFieldKey(key, ownCrossFilterField)) {
|
|
9829
|
+
continue;
|
|
9830
|
+
}
|
|
9831
|
+
if (sourceMeta?.sourceCardId && sourceMeta.sourceCardId === spec.id) {
|
|
9832
|
+
continue;
|
|
9833
|
+
}
|
|
9834
|
+
if (dimensionField && matchesDimensionFieldKey(key, dimensionField)) {
|
|
9835
|
+
continue;
|
|
9836
|
+
}
|
|
9837
|
+
const sourceDimensionField = typeof sourceMeta?.dimensionField === 'string'
|
|
9838
|
+
? sourceMeta.dimensionField.trim()
|
|
9839
|
+
: '';
|
|
9840
|
+
if (sourceDimensionField &&
|
|
9841
|
+
((dimensionField && matchesDimensionFieldKey(sourceDimensionField, dimensionField)) ||
|
|
9842
|
+
(ownCrossFilterField &&
|
|
9843
|
+
matchesDimensionFieldKey(sourceDimensionField, ownCrossFilterField)))) {
|
|
9844
|
+
continue;
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9847
|
+
// Canal 1 (scopeFilters) nunca pode ser ampliado ou sobrescrito pelo Canal 2 (crossFilters).
|
|
9848
|
+
const preferScopeOnConflict = scopeKeys.has(normalizedKey);
|
|
9849
|
+
mergeConjunctiveFilterEntry(effective, key, value, preferScopeOnConflict);
|
|
9850
|
+
}
|
|
9851
|
+
}
|
|
9852
|
+
return effective;
|
|
9853
|
+
}
|
|
9854
|
+
/**
|
|
9855
|
+
* Resolves effective query filters following the 3-channel precedence contract:
|
|
9856
|
+
* 1. `queryContext.meta.scopeFilters` (always honored, never widened)
|
|
9857
|
+
* 2. `queryContext.filters` filtered by `interaction.filterReaction` and cross-filter target/source guards
|
|
9858
|
+
* 3. Card `baseFilter` / `parameters` intersected conjunctively (preserving locked invariants without widening `scopeFilters`).
|
|
9859
|
+
*/
|
|
9860
|
+
function resolveKpiEffectiveFilters(spec, queryContext, resolvedProjection) {
|
|
9861
|
+
const effective = resolveKpiContextFilters(spec, queryContext, resolvedProjection);
|
|
9862
|
+
const cardConstraints = spec.source.kind === 'stats-query'
|
|
9863
|
+
? copyNonEmptyFilters(spec.source.request.baseFilter)
|
|
9864
|
+
: spec.source.kind === 'analytics-projection'
|
|
9865
|
+
? copyNonEmptyFilters(spec.source.baseFilter)
|
|
9866
|
+
: copyNonEmptyFilters(spec.source.parameters);
|
|
9867
|
+
for (const [key, constraintVal] of Object.entries(cardConstraints)) {
|
|
9868
|
+
mergeConjunctiveFilterEntry(effective, key, constraintVal, false);
|
|
9869
|
+
}
|
|
9870
|
+
return effective;
|
|
9871
|
+
}
|
|
9872
|
+
/**
|
|
9873
|
+
* Resolves the canonical `PraxisStatsExecutionRequest` payload for any supported
|
|
9874
|
+
* `PraxisKpiMetricSource`, or returns `null` if an `analytics-projection` has not hydrated yet.
|
|
9875
|
+
*/
|
|
9876
|
+
function buildKpiStatsExecutionRequest(spec, queryContext, options = {}) {
|
|
9877
|
+
const effectiveFilters = resolveKpiEffectiveFilters(spec, queryContext, options.resolvedProjection);
|
|
9878
|
+
const scopeKey = options.scopeKey?.trim() || undefined;
|
|
9879
|
+
const bypassCache = options.bypassCache === true ? true : undefined;
|
|
9880
|
+
switch (spec.source.kind) {
|
|
9881
|
+
case 'stats-query': {
|
|
9882
|
+
const { resourcePath, operation, request } = spec.source;
|
|
9883
|
+
if (operation === 'group-by') {
|
|
9884
|
+
return {
|
|
9885
|
+
effectiveFilters,
|
|
9886
|
+
request: {
|
|
9887
|
+
resourcePath,
|
|
9888
|
+
operation: 'group-by',
|
|
9889
|
+
payload: {
|
|
9890
|
+
field: request.field,
|
|
9891
|
+
filter: effectiveFilters,
|
|
9892
|
+
...(request.metric ? { metric: request.metric } : {}),
|
|
9893
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
9894
|
+
...(request.orderBy ? { orderBy: request.orderBy } : {}),
|
|
9895
|
+
},
|
|
9896
|
+
...(scopeKey ? { scopeKey } : {}),
|
|
9897
|
+
...(bypassCache ? { bypassCache } : {}),
|
|
9898
|
+
},
|
|
9899
|
+
};
|
|
9900
|
+
}
|
|
9901
|
+
if (operation === 'timeseries') {
|
|
9902
|
+
const timezone = request.timezone?.trim() || options.timezone?.trim() || undefined;
|
|
9903
|
+
return {
|
|
9904
|
+
effectiveFilters,
|
|
9905
|
+
request: {
|
|
9906
|
+
resourcePath,
|
|
9907
|
+
operation: 'timeseries',
|
|
9908
|
+
payload: {
|
|
9909
|
+
field: request.field,
|
|
9910
|
+
granularity: request.granularity,
|
|
9911
|
+
rollingWindow: request.rollingWindow,
|
|
9912
|
+
filter: effectiveFilters,
|
|
9913
|
+
...(request.metric ? { metric: request.metric } : {}),
|
|
9914
|
+
...(timezone ? { timezone } : {}),
|
|
9915
|
+
...(typeof request.fillGaps === 'boolean' ? { fillGaps: request.fillGaps } : {}),
|
|
9916
|
+
},
|
|
9917
|
+
...(scopeKey ? { scopeKey } : {}),
|
|
9918
|
+
...(bypassCache ? { bypassCache } : {}),
|
|
9919
|
+
},
|
|
9920
|
+
};
|
|
9921
|
+
}
|
|
9922
|
+
const timezone = request.timezone?.trim() || options.timezone?.trim() || undefined;
|
|
9923
|
+
return {
|
|
9924
|
+
effectiveFilters,
|
|
9925
|
+
request: {
|
|
9926
|
+
resourcePath,
|
|
9927
|
+
operation: 'comparison',
|
|
9928
|
+
payload: {
|
|
9929
|
+
field: request.field,
|
|
9930
|
+
periodField: request.periodField,
|
|
9931
|
+
periodPreset: request.periodPreset,
|
|
9932
|
+
periodMode: request.periodMode,
|
|
9933
|
+
metrics: request.metrics,
|
|
9934
|
+
filter: effectiveFilters,
|
|
9935
|
+
...(timezone ? { timezone } : {}),
|
|
9936
|
+
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
9937
|
+
...(request.orderBy ? { orderBy: request.orderBy } : {}),
|
|
9938
|
+
},
|
|
9939
|
+
...(scopeKey ? { scopeKey } : {}),
|
|
9940
|
+
...(bypassCache ? { bypassCache } : {}),
|
|
9941
|
+
},
|
|
9942
|
+
};
|
|
9943
|
+
}
|
|
9944
|
+
case 'verified-recipe': {
|
|
9945
|
+
const timezone = options.timezone?.trim() || undefined;
|
|
9946
|
+
const explicitParameters = copyNonEmptyFilters(spec.source.parameters);
|
|
9947
|
+
const rawContextFilters = resolveKpiContextFilters(spec, queryContext, options.resolvedProjection);
|
|
9948
|
+
const contextFilters = {};
|
|
9949
|
+
for (const [key, value] of Object.entries(rawContextFilters)) {
|
|
9950
|
+
if (!Object.prototype.hasOwnProperty.call(explicitParameters, key)) {
|
|
9951
|
+
contextFilters[key] = value;
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9954
|
+
return {
|
|
9955
|
+
effectiveFilters,
|
|
9956
|
+
request: {
|
|
9957
|
+
resourcePath: spec.source.resourcePath,
|
|
9958
|
+
operation: 'verified-recipe',
|
|
9959
|
+
recipeId: spec.source.recipeId,
|
|
9960
|
+
payload: {
|
|
9961
|
+
parameters: explicitParameters,
|
|
9962
|
+
...(Object.keys(contextFilters).length > 0 ? { contextFilters } : {}),
|
|
9963
|
+
...(timezone ? { timezone } : {}),
|
|
9964
|
+
},
|
|
9965
|
+
...(scopeKey ? { scopeKey } : {}),
|
|
9966
|
+
...(bypassCache ? { bypassCache } : {}),
|
|
9967
|
+
},
|
|
9968
|
+
};
|
|
9969
|
+
}
|
|
9970
|
+
case 'analytics-projection': {
|
|
9971
|
+
const projection = options.resolvedProjection;
|
|
9972
|
+
if (!projection || !options.requestBuilder) {
|
|
9973
|
+
return null;
|
|
9974
|
+
}
|
|
9975
|
+
const plan = options.requestBuilder.buildExecutionPlan(projection);
|
|
9976
|
+
const mergedFilter = copyNonEmptyFilters(plan.statsRequest.filter);
|
|
9977
|
+
for (const [key, value] of Object.entries(effectiveFilters)) {
|
|
9978
|
+
mergeConjunctiveFilterEntry(mergedFilter, key, value, false);
|
|
9979
|
+
}
|
|
9980
|
+
return {
|
|
9981
|
+
effectiveFilters: mergedFilter,
|
|
9982
|
+
request: {
|
|
9983
|
+
resourcePath: plan.resourcePath || spec.source.resourcePath,
|
|
9984
|
+
operation: plan.operation,
|
|
9985
|
+
payload: {
|
|
9986
|
+
...plan.statsRequest,
|
|
9987
|
+
filter: mergedFilter,
|
|
9988
|
+
},
|
|
9989
|
+
...(scopeKey ? { scopeKey } : {}),
|
|
9990
|
+
...(bypassCache ? { bypassCache } : {}),
|
|
9991
|
+
},
|
|
9992
|
+
};
|
|
9993
|
+
}
|
|
9994
|
+
}
|
|
9995
|
+
}
|
|
9996
|
+
/**
|
|
9997
|
+
* Checks whether the card's configured `interaction.crossFilter` is currently active in `queryContext.filters`.
|
|
9998
|
+
*/
|
|
9999
|
+
function isKpiCrossFilterActive(spec, queryContext) {
|
|
10000
|
+
const crossFilter = spec.interaction?.crossFilter;
|
|
10001
|
+
if (!crossFilter?.field?.trim() || !crossFilter.values.length) {
|
|
10002
|
+
return false;
|
|
10003
|
+
}
|
|
10004
|
+
const activeFilters = queryContext?.filters;
|
|
10005
|
+
if (!activeFilters || typeof activeFilters !== 'object') {
|
|
10006
|
+
return false;
|
|
10007
|
+
}
|
|
10008
|
+
const currentTokens = toScalarOrArrayTokens(activeFilters[crossFilter.field.trim()]);
|
|
10009
|
+
const expectedTokens = toScalarOrArrayTokens(crossFilter.values);
|
|
10010
|
+
if (currentTokens.length === 0 || currentTokens.length !== expectedTokens.length) {
|
|
10011
|
+
return false;
|
|
10012
|
+
}
|
|
10013
|
+
return currentTokens.every((token, index) => token === expectedTokens[index]);
|
|
10014
|
+
}
|
|
10015
|
+
function findMatchingCrossFilterEntry(spec, queryContext) {
|
|
10016
|
+
const crossFilterField = spec.interaction?.crossFilter?.field?.trim();
|
|
10017
|
+
const activeFilters = queryContext?.filters;
|
|
10018
|
+
if (!crossFilterField || !activeFilters || typeof activeFilters !== 'object') {
|
|
10019
|
+
return null;
|
|
10020
|
+
}
|
|
10021
|
+
const cardResourceKey = normalizeResourceKey(spec.interaction?.crossFilter?.targetResourcePath || spec.source.resourcePath);
|
|
10022
|
+
const sources = queryContext?.meta?.crossFilterSources ?? {};
|
|
10023
|
+
const isEligibleKey = (filterKey) => {
|
|
10024
|
+
const srcTarget = normalizeResourceKey(sources[filterKey]?.targetResourcePath);
|
|
10025
|
+
return !srcTarget || !cardResourceKey || srcTarget === cardResourceKey;
|
|
10026
|
+
};
|
|
10027
|
+
if (Object.prototype.hasOwnProperty.call(activeFilters, crossFilterField) &&
|
|
10028
|
+
activeFilters[crossFilterField] !== undefined &&
|
|
10029
|
+
activeFilters[crossFilterField] !== null &&
|
|
10030
|
+
isEligibleKey(crossFilterField)) {
|
|
10031
|
+
return { key: crossFilterField, value: activeFilters[crossFilterField] };
|
|
10032
|
+
}
|
|
10033
|
+
for (const [candidateKey, candidateValue] of Object.entries(activeFilters)) {
|
|
10034
|
+
if (candidateValue === undefined || candidateValue === null) {
|
|
10035
|
+
continue;
|
|
10036
|
+
}
|
|
10037
|
+
if (matchesDimensionFieldKey(candidateKey, crossFilterField) && isEligibleKey(candidateKey)) {
|
|
10038
|
+
return { key: candidateKey, value: candidateValue };
|
|
10039
|
+
}
|
|
10040
|
+
}
|
|
10041
|
+
return null;
|
|
10042
|
+
}
|
|
10043
|
+
/**
|
|
10044
|
+
* Resolves the primitive filter value(s) currently active on this KPI card's cross-filter dimension.
|
|
10045
|
+
*/
|
|
10046
|
+
function resolveActiveKpiDimensionValues(spec, queryContext) {
|
|
10047
|
+
const matched = findMatchingCrossFilterEntry(spec, queryContext);
|
|
10048
|
+
if (!matched) {
|
|
10049
|
+
return [];
|
|
10050
|
+
}
|
|
10051
|
+
const rawList = Array.isArray(matched.value) ? matched.value : [matched.value];
|
|
10052
|
+
return rawList.filter((entry) => typeof entry === 'string' || typeof entry === 'number' || typeof entry === 'boolean');
|
|
10053
|
+
}
|
|
10054
|
+
/**
|
|
10055
|
+
* Returns true when this card owns the active cross-filter (either via its default
|
|
10056
|
+
* crossFilter values or by clicking one of its composition segments).
|
|
10057
|
+
*/
|
|
10058
|
+
function isKpiCardFilterOwnedActive(spec, queryContext) {
|
|
10059
|
+
if (isKpiCrossFilterActive(spec, queryContext)) {
|
|
10060
|
+
return true;
|
|
10061
|
+
}
|
|
10062
|
+
const matched = findMatchingCrossFilterEntry(spec, queryContext);
|
|
10063
|
+
if (!matched) {
|
|
10064
|
+
return false;
|
|
10065
|
+
}
|
|
10066
|
+
const sourceMeta = queryContext?.meta?.crossFilterSources?.[matched.key];
|
|
10067
|
+
return Boolean(sourceMeta?.sourceCardId && sourceMeta.sourceCardId === spec.id);
|
|
10068
|
+
}
|
|
10069
|
+
/**
|
|
10070
|
+
* Builds the canonical cross-filter toggle event when activating a specific composition
|
|
10071
|
+
* segment key inside a stackedBar KPI card.
|
|
10072
|
+
*/
|
|
10073
|
+
function buildKpiSegmentCrossFilterToggleEvent(spec, segmentKey, queryContext, resolvedProjection) {
|
|
10074
|
+
const crossFilter = spec.interaction?.crossFilter;
|
|
10075
|
+
const field = crossFilter?.field?.trim();
|
|
10076
|
+
const cleanSegmentKey = segmentKey.trim();
|
|
10077
|
+
if (!crossFilter || !field || !cleanSegmentKey) {
|
|
10078
|
+
return null;
|
|
10079
|
+
}
|
|
10080
|
+
const matched = findMatchingCrossFilterEntry(spec, queryContext);
|
|
10081
|
+
const activeValues = resolveActiveKpiDimensionValues(spec, queryContext);
|
|
10082
|
+
const normalizedSegmentKey = cleanSegmentKey.toLowerCase();
|
|
10083
|
+
const isCurrentlyActive = activeValues.some((value) => String(value).trim().toLowerCase() === normalizedSegmentKey);
|
|
10084
|
+
const isMulti = isMultiValueCrossFilterField(field, crossFilter.cardinality);
|
|
10085
|
+
let nextActive;
|
|
10086
|
+
let nextValues;
|
|
10087
|
+
let nextFilterValue;
|
|
10088
|
+
if (isCurrentlyActive && activeValues.length > 1) {
|
|
10089
|
+
const remaining = activeValues.filter((value) => String(value).trim().toLowerCase() !== normalizedSegmentKey);
|
|
10090
|
+
if (remaining.length === 0) {
|
|
10091
|
+
nextActive = false;
|
|
10092
|
+
nextValues = [cleanSegmentKey];
|
|
10093
|
+
nextFilterValue = undefined;
|
|
10094
|
+
}
|
|
10095
|
+
else {
|
|
10096
|
+
nextActive = true;
|
|
10097
|
+
nextValues = remaining;
|
|
10098
|
+
const rawValue = remaining.length === 1 && !isMulti ? remaining[0] : [...remaining];
|
|
10099
|
+
nextFilterValue = coerceCrossFilterValue(field, rawValue);
|
|
10100
|
+
}
|
|
10101
|
+
}
|
|
10102
|
+
else if (isCurrentlyActive) {
|
|
10103
|
+
nextActive = false;
|
|
10104
|
+
nextValues = [cleanSegmentKey];
|
|
10105
|
+
nextFilterValue = undefined;
|
|
10106
|
+
}
|
|
10107
|
+
else {
|
|
10108
|
+
nextActive = true;
|
|
10109
|
+
nextValues = [cleanSegmentKey];
|
|
10110
|
+
const rawValue = !isMulti ? cleanSegmentKey : [cleanSegmentKey];
|
|
10111
|
+
nextFilterValue = coerceCrossFilterValue(field, rawValue);
|
|
10112
|
+
}
|
|
10113
|
+
const targetResourcePath = crossFilter.targetResourcePath?.trim() || spec.source.resourcePath;
|
|
10114
|
+
const dimensionField = resolveKpiDimensionField(spec, resolvedProjection);
|
|
10115
|
+
const filterPatch = {
|
|
10116
|
+
[field]: nextFilterValue,
|
|
10117
|
+
};
|
|
10118
|
+
if (matched && matched.key !== field) {
|
|
10119
|
+
filterPatch[matched.key] = undefined;
|
|
10120
|
+
}
|
|
10121
|
+
return {
|
|
10122
|
+
cardId: spec.id,
|
|
10123
|
+
field,
|
|
10124
|
+
values: [...nextValues],
|
|
10125
|
+
active: nextActive,
|
|
10126
|
+
nextFilterValue,
|
|
10127
|
+
filterPatch,
|
|
10128
|
+
targetResourcePath,
|
|
10129
|
+
...(crossFilter.activateTargetSurfaceId?.trim()
|
|
10130
|
+
? { activateTargetSurfaceId: crossFilter.activateTargetSurfaceId.trim() }
|
|
10131
|
+
: {}),
|
|
10132
|
+
sourceMeta: {
|
|
10133
|
+
sourceCardId: spec.id,
|
|
10134
|
+
...(dimensionField ? { dimensionField } : {}),
|
|
10135
|
+
...(targetResourcePath ? { targetResourcePath } : {}),
|
|
10136
|
+
},
|
|
10137
|
+
};
|
|
10138
|
+
}
|
|
10139
|
+
function isMultiValueCrossFilterField(field, cardinality) {
|
|
10140
|
+
if (cardinality === 'list') {
|
|
10141
|
+
return true;
|
|
10142
|
+
}
|
|
10143
|
+
if (cardinality === 'scalar') {
|
|
10144
|
+
return false;
|
|
10145
|
+
}
|
|
10146
|
+
const trimmed = field.trim();
|
|
10147
|
+
if (!trimmed) {
|
|
10148
|
+
return false;
|
|
10149
|
+
}
|
|
10150
|
+
if (/(?:_in|_ids)$/i.test(trimmed)) {
|
|
10151
|
+
return true;
|
|
10152
|
+
}
|
|
10153
|
+
if (/(?:[a-z0-9](?:In|Ids))$/.test(trimmed) &&
|
|
10154
|
+
!/(?:Check|Sign|Log|Clock|Walk|Drop|Trade|Built|Linked|Opt|Punch)In$/.test(trimmed)) {
|
|
10155
|
+
return true;
|
|
10156
|
+
}
|
|
10157
|
+
if (/(?:us|ss|is|as|Days|Dias)$/i.test(trimmed)) {
|
|
10158
|
+
return false;
|
|
10159
|
+
}
|
|
10160
|
+
return /(?:es|ies|s)$/.test(trimmed);
|
|
10161
|
+
}
|
|
10162
|
+
/**
|
|
10163
|
+
* Builds the canonical cross-filter toggle event payload and metadata for parent cockpit state orchestration.
|
|
10164
|
+
*/
|
|
10165
|
+
function buildKpiCrossFilterToggleEvent(spec, currentlyActive, resolvedProjection, queryContext) {
|
|
10166
|
+
const crossFilter = spec.interaction?.crossFilter;
|
|
10167
|
+
const field = crossFilter?.field?.trim();
|
|
10168
|
+
if (!crossFilter || !field || !crossFilter.values.length) {
|
|
10169
|
+
return null;
|
|
10170
|
+
}
|
|
10171
|
+
const nextActive = !currentlyActive;
|
|
10172
|
+
const rawValue = crossFilter.values.length === 1 &&
|
|
10173
|
+
!isMultiValueCrossFilterField(field, crossFilter.cardinality)
|
|
10174
|
+
? crossFilter.values[0]
|
|
10175
|
+
: [...crossFilter.values];
|
|
10176
|
+
const nextFilterValue = nextActive ? coerceCrossFilterValue(field, rawValue) : undefined;
|
|
10177
|
+
const targetResourcePath = crossFilter.targetResourcePath?.trim() || spec.source.resourcePath;
|
|
10178
|
+
const matched = queryContext ? findMatchingCrossFilterEntry(spec, queryContext) : null;
|
|
10179
|
+
const filterPatch = {
|
|
10180
|
+
[field]: nextFilterValue,
|
|
10181
|
+
};
|
|
10182
|
+
if (matched && matched.key !== field) {
|
|
10183
|
+
filterPatch[matched.key] = undefined;
|
|
10184
|
+
}
|
|
10185
|
+
return {
|
|
10186
|
+
cardId: spec.id,
|
|
10187
|
+
field,
|
|
10188
|
+
values: [...crossFilter.values],
|
|
10189
|
+
active: nextActive,
|
|
10190
|
+
nextFilterValue,
|
|
10191
|
+
filterPatch,
|
|
10192
|
+
targetResourcePath,
|
|
10193
|
+
...(crossFilter.activateTargetSurfaceId?.trim()
|
|
10194
|
+
? { activateTargetSurfaceId: crossFilter.activateTargetSurfaceId.trim() }
|
|
10195
|
+
: {}),
|
|
10196
|
+
sourceMeta: {
|
|
10197
|
+
sourceCardId: spec.id,
|
|
10198
|
+
...(resolveKpiDimensionField(spec, resolvedProjection)
|
|
10199
|
+
? { dimensionField: resolveKpiDimensionField(spec, resolvedProjection) }
|
|
10200
|
+
: {}),
|
|
10201
|
+
...(targetResourcePath ? { targetResourcePath } : {}),
|
|
10202
|
+
},
|
|
10203
|
+
};
|
|
10204
|
+
}
|
|
10205
|
+
|
|
9142
10206
|
const DEFAULT_CHART_CONFIG = {
|
|
9143
10207
|
id: 'praxis-chart-default',
|
|
9144
10208
|
type: 'bar',
|
|
@@ -9187,6 +10251,7 @@ class PraxisChartComponent {
|
|
|
9187
10251
|
canonicalMapper = inject(PraxisChartCanonicalContractMapperService);
|
|
9188
10252
|
statsApi = inject(PraxisChartStatsApiService);
|
|
9189
10253
|
i18n = inject(PraxisI18nService);
|
|
10254
|
+
enterpriseRuntimeContext = inject(EnterpriseRuntimeContextService, { optional: true });
|
|
9190
10255
|
ngZone = inject(NgZone);
|
|
9191
10256
|
componentMetadataRegistry = inject(ComponentMetadataRegistry);
|
|
9192
10257
|
settingsPanel = inject(SETTINGS_PANEL_BRIDGE, { optional: true });
|
|
@@ -9206,6 +10271,13 @@ class PraxisChartComponent {
|
|
|
9206
10271
|
hasRenderedOnce = signal(false, ...(ngDevMode ? [{ debugName: "hasRenderedOnce" }] : /* istanbul ignore next */ []));
|
|
9207
10272
|
remoteResolvedData = signal(null, ...(ngDevMode ? [{ debugName: "remoteResolvedData" }] : /* istanbul ignore next */ []));
|
|
9208
10273
|
remoteRuntimeState = signal('idle', ...(ngDevMode ? [{ debugName: "remoteRuntimeState" }] : /* istanbul ignore next */ []));
|
|
10274
|
+
runtimeContextSuspended = signal(Boolean(this.enterpriseRuntimeContext?.isSwitching) ||
|
|
10275
|
+
(this.enterpriseRuntimeContext?.snapshot != null &&
|
|
10276
|
+
!isEnterpriseRuntimeSnapshotReady(this.enterpriseRuntimeContext.snapshot)), ...(ngDevMode ? [{ debugName: "runtimeContextSuspended" }] : /* istanbul ignore next */ []));
|
|
10277
|
+
runtimeContextRevision = signal(0, ...(ngDevMode ? [{ debugName: "runtimeContextRevision" }] : /* istanbul ignore next */ []));
|
|
10278
|
+
hadNonNullRuntimeContext = isEnterpriseRuntimeSnapshotReady(this.enterpriseRuntimeContext?.snapshot) ||
|
|
10279
|
+
Boolean(this.enterpriseRuntimeContext?.isSwitching);
|
|
10280
|
+
seenInitialRuntimeContext = false;
|
|
9209
10281
|
remoteTechnicalError = signal(null, ...(ngDevMode ? [{ debugName: "remoteTechnicalError" }] : /* istanbul ignore next */ []));
|
|
9210
10282
|
remoteFailureEpistemicMeta = signal(null, ...(ngDevMode ? [{ debugName: "remoteFailureEpistemicMeta" }] : /* istanbul ignore next */ []));
|
|
9211
10283
|
runtimeOwner = linkedSignal({ ...(ngDevMode ? { debugName: "runtimeOwner" } : /* istanbul ignore next */ {}), source: () => ({
|
|
@@ -9272,6 +10344,7 @@ class PraxisChartComponent {
|
|
|
9272
10344
|
mappedRuntimeConfig = computed(() => this.runtimeChartDocumentResolution().config, ...(ngDevMode ? [{ debugName: "mappedRuntimeConfig" }] : /* istanbul ignore next */ []));
|
|
9273
10345
|
chartDocumentMappingError = computed(() => this.runtimeChartDocumentResolution().error, ...(ngDevMode ? [{ debugName: "chartDocumentMappingError" }] : /* istanbul ignore next */ []));
|
|
9274
10346
|
activeSelectionSignature = signal(null, ...(ngDevMode ? [{ debugName: "activeSelectionSignature" }] : /* istanbul ignore next */ []));
|
|
10347
|
+
activeSelectionFilters = signal(null, ...(ngDevMode ? [{ debugName: "activeSelectionFilters" }] : /* istanbul ignore next */ []));
|
|
9275
10348
|
activeHierarchyPath = signal([], ...(ngDevMode ? [{ debugName: "activeHierarchyPath" }] : /* istanbul ignore next */ []));
|
|
9276
10349
|
configEditorContextPending = signal(false, ...(ngDevMode ? [{ debugName: "configEditorContextPending" }] : /* istanbul ignore next */ []));
|
|
9277
10350
|
showAccessibleData = signal(false, ...(ngDevMode ? [{ debugName: "showAccessibleData" }] : /* istanbul ignore next */ []));
|
|
@@ -9830,11 +10903,46 @@ class PraxisChartComponent {
|
|
|
9830
10903
|
this.observeShellSizingContext();
|
|
9831
10904
|
this.observeThemeContext();
|
|
9832
10905
|
});
|
|
10906
|
+
if (this.enterpriseRuntimeContext?.contextChanges$) {
|
|
10907
|
+
this.enterpriseRuntimeContext.contextChanges$
|
|
10908
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
10909
|
+
.subscribe((snapshot) => {
|
|
10910
|
+
const ready = isEnterpriseRuntimeSnapshotReady(snapshot);
|
|
10911
|
+
if (!this.seenInitialRuntimeContext) {
|
|
10912
|
+
this.seenInitialRuntimeContext = true;
|
|
10913
|
+
if (ready) {
|
|
10914
|
+
this.hadNonNullRuntimeContext = true;
|
|
10915
|
+
}
|
|
10916
|
+
return;
|
|
10917
|
+
}
|
|
10918
|
+
if (!ready) {
|
|
10919
|
+
if (!this.hadNonNullRuntimeContext) {
|
|
10920
|
+
return;
|
|
10921
|
+
}
|
|
10922
|
+
this.runtimeContextSuspended.set(true);
|
|
10923
|
+
this.cancelRemoteDataRequest();
|
|
10924
|
+
if (this.effectiveConfig().dataSource?.kind === 'remote') {
|
|
10925
|
+
this.remoteResolvedData.set(null);
|
|
10926
|
+
this.remoteRuntimeState.set('loading');
|
|
10927
|
+
}
|
|
10928
|
+
return;
|
|
10929
|
+
}
|
|
10930
|
+
this.hadNonNullRuntimeContext = true;
|
|
10931
|
+
this.previousRemoteSignature = null;
|
|
10932
|
+
this.cancelRemoteDataRequest();
|
|
10933
|
+
if (this.effectiveConfig().dataSource?.kind === 'remote') {
|
|
10934
|
+
this.remoteResolvedData.set(null);
|
|
10935
|
+
this.remoteRuntimeState.set('idle');
|
|
10936
|
+
}
|
|
10937
|
+
this.runtimeContextSuspended.set(false);
|
|
10938
|
+
this.runtimeContextRevision.update((value) => value + 1);
|
|
10939
|
+
});
|
|
10940
|
+
}
|
|
9833
10941
|
effect(() => {
|
|
9834
10942
|
const config = this.effectiveConfig();
|
|
9835
10943
|
const explicitData = this.runtimeData();
|
|
9836
10944
|
const remoteDataResolver = this.remoteDataResolver();
|
|
9837
|
-
const queryContext = normalizePraxisDataQueryContext(this.runtimeQueryContext());
|
|
10945
|
+
const queryContext = stripCrossFilterSourcesFromQueryContext(normalizePraxisDataQueryContext(this.runtimeQueryContext()));
|
|
9838
10946
|
const nextSignature = explicitData === null || explicitData === undefined
|
|
9839
10947
|
? this.buildRemoteSignature(config, queryContext)
|
|
9840
10948
|
: null;
|
|
@@ -9868,9 +10976,33 @@ class PraxisChartComponent {
|
|
|
9868
10976
|
}
|
|
9869
10977
|
this.previousSelectionScopeSignature = signature;
|
|
9870
10978
|
this.activeSelectionSignature.set(null);
|
|
10979
|
+
this.activeSelectionFilters.set(null);
|
|
9871
10980
|
this.activeHierarchyPath.set([]);
|
|
9872
10981
|
this.dismissActiveQuickView('anchor-invalid');
|
|
9873
10982
|
});
|
|
10983
|
+
effect(() => {
|
|
10984
|
+
const rawQueryContext = this.runtimeQueryContext();
|
|
10985
|
+
const rawMeta = rawQueryContext?.meta;
|
|
10986
|
+
if (!rawMeta ||
|
|
10987
|
+
typeof rawMeta !== 'object' ||
|
|
10988
|
+
!Object.prototype.hasOwnProperty.call(rawMeta, 'crossFilterSources')) {
|
|
10989
|
+
return;
|
|
10990
|
+
}
|
|
10991
|
+
const activeSig = untracked(() => this.activeSelectionSignature());
|
|
10992
|
+
const activeFilters = untracked(() => this.activeSelectionFilters());
|
|
10993
|
+
if (activeSig === null || !activeFilters || Object.keys(activeFilters).length === 0) {
|
|
10994
|
+
return;
|
|
10995
|
+
}
|
|
10996
|
+
const rawSources = rawMeta.crossFilterSources && typeof rawMeta.crossFilterSources === 'object'
|
|
10997
|
+
? rawMeta.crossFilterSources
|
|
10998
|
+
: {};
|
|
10999
|
+
const rawFilters = rawQueryContext?.filters;
|
|
11000
|
+
const stillActive = Object.entries(activeFilters).every(([field, expected]) => isSelectionFilterEntryStillActive(field, expected, rawFilters, rawSources));
|
|
11001
|
+
if (!stillActive) {
|
|
11002
|
+
this.activeSelectionSignature.set(null);
|
|
11003
|
+
this.activeSelectionFilters.set(null);
|
|
11004
|
+
}
|
|
11005
|
+
});
|
|
9874
11006
|
effect(() => {
|
|
9875
11007
|
const nextState = this.loadState();
|
|
9876
11008
|
if (this.dataAlternativeMode() !== 'built-in'
|
|
@@ -9887,6 +11019,16 @@ class PraxisChartComponent {
|
|
|
9887
11019
|
}
|
|
9888
11020
|
});
|
|
9889
11021
|
effect(() => {
|
|
11022
|
+
this.runtimeContextRevision();
|
|
11023
|
+
if (this.runtimeContextSuspended()) {
|
|
11024
|
+
const effectiveConfig = this.effectiveConfig();
|
|
11025
|
+
const explicitData = this.runtimeData();
|
|
11026
|
+
if (effectiveConfig.dataSource?.kind === 'remote' &&
|
|
11027
|
+
(explicitData === null || explicitData === undefined)) {
|
|
11028
|
+
this.remoteRuntimeState.set('loading');
|
|
11029
|
+
}
|
|
11030
|
+
return;
|
|
11031
|
+
}
|
|
9890
11032
|
const effectiveConfig = this.effectiveConfig();
|
|
9891
11033
|
const explicitData = this.runtimeData();
|
|
9892
11034
|
if (effectiveConfig.dataSource?.kind !== 'remote' || (explicitData !== null && explicitData !== undefined)) {
|
|
@@ -9895,7 +11037,7 @@ class PraxisChartComponent {
|
|
|
9895
11037
|
if (this.remoteRuntimeState() === 'loading' || this.remoteResolvedData() !== null) {
|
|
9896
11038
|
return;
|
|
9897
11039
|
}
|
|
9898
|
-
const queryContext = normalizePraxisDataQueryContext(this.runtimeQueryContext());
|
|
11040
|
+
const queryContext = stripCrossFilterSourcesFromQueryContext(normalizePraxisDataQueryContext(this.runtimeQueryContext()));
|
|
9899
11041
|
const event = {
|
|
9900
11042
|
chartId: effectiveConfig.id,
|
|
9901
11043
|
dataSource: effectiveConfig.dataSource,
|
|
@@ -10504,6 +11646,7 @@ class PraxisChartComponent {
|
|
|
10504
11646
|
return;
|
|
10505
11647
|
}
|
|
10506
11648
|
this.activeSelectionSignature.set(null);
|
|
11649
|
+
this.activeSelectionFilters.set(null);
|
|
10507
11650
|
const config = this.renderConfig();
|
|
10508
11651
|
const action = config.interactions?.eventActions?.selectionChange;
|
|
10509
11652
|
const selectionEvent = {
|
|
@@ -10698,10 +11841,15 @@ class PraxisChartComponent {
|
|
|
10698
11841
|
}
|
|
10699
11842
|
buildSelectionEvent(config, event) {
|
|
10700
11843
|
const action = config.interactions?.eventActions?.selectionChange;
|
|
11844
|
+
const crossFilterAction = config.interactions?.eventActions?.crossFilter;
|
|
10701
11845
|
const filters = this.buildEventFilters(config, event, action?.mapping);
|
|
10702
11846
|
const signature = this.buildPointSelectionSignature(config, event);
|
|
10703
11847
|
const selected = this.activeSelectionSignature() !== signature;
|
|
11848
|
+
const selectionFilters = selected
|
|
11849
|
+
? this.buildEventFilters(config, event, crossFilterAction?.mapping ?? action?.mapping)
|
|
11850
|
+
: null;
|
|
10704
11851
|
this.activeSelectionSignature.set(selected ? signature : null);
|
|
11852
|
+
this.activeSelectionFilters.set(selectionFilters && Object.keys(selectionFilters).length > 0 ? selectionFilters : null);
|
|
10705
11853
|
return {
|
|
10706
11854
|
...event,
|
|
10707
11855
|
chartId: config.id ?? event.chartId,
|
|
@@ -10730,7 +11878,7 @@ class PraxisChartComponent {
|
|
|
10730
11878
|
dataSource: config.dataSource,
|
|
10731
11879
|
interactions: config.interactions,
|
|
10732
11880
|
filterCriteria: this.filterCriteria(),
|
|
10733
|
-
queryContext: normalizePraxisDataQueryContext(this.runtimeQueryContext()),
|
|
11881
|
+
queryContext: stripCrossFilterSourcesFromQueryContext(normalizePraxisDataQueryContext(this.runtimeQueryContext())),
|
|
10734
11882
|
sankey: config.sankey,
|
|
10735
11883
|
hierarchy: config.hierarchy,
|
|
10736
11884
|
radar: config.radar,
|
|
@@ -12616,442 +13764,54 @@ function cloneDataRowsPreservingMetadata(rows) {
|
|
|
12616
13764
|
}
|
|
12617
13765
|
return cloned;
|
|
12618
13766
|
}
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
const MONTH_YEAR_RE = /^(\d{1,2})[-/](\d{4})$/;
|
|
12623
|
-
const ISO_DATE_PREFIX_RE = /^(\d{4})-(\d{2})-(\d{2})(?:[T\s].*)?$/;
|
|
12624
|
-
const BR_DATE_RE = /^(\d{2})\/(\d{2})\/(\d{4})$/;
|
|
12625
|
-
const MONTHLY_KEY_PREFIX_OR_EXACT_RE = /^(?:competencia|competenceMonth|referenceMonth|payrollMonth|billingMonth|periodMonth|yearMonth|monthRef|mesReferencia)(?:$|_|In$|Ids$|[A-Z])/i;
|
|
12626
|
-
const MONTHLY_SNAKE_KEY_RE = /^(?:competencia|competence_month|reference_month|payroll_month|billing_month|period_month|year_month|month_ref|mes_referencia)(?:$|_in$|_ids$)/i;
|
|
12627
|
-
function isValidYearMonth(year, month) {
|
|
12628
|
-
return Number.isInteger(year) && year >= 1 && year <= 9999 && Number.isInteger(month) && month >= 1 && month <= 12;
|
|
12629
|
-
}
|
|
12630
|
-
function isValidCalendarDate(year, month, day) {
|
|
12631
|
-
if (!isValidYearMonth(year, month) || !Number.isInteger(day) || day < 1 || day > 31) {
|
|
12632
|
-
return false;
|
|
12633
|
-
}
|
|
12634
|
-
const probe = new Date(Date.UTC(year, month - 1, day));
|
|
12635
|
-
return (probe.getUTCFullYear() === year &&
|
|
12636
|
-
probe.getUTCMonth() === month - 1 &&
|
|
12637
|
-
probe.getUTCDate() === day);
|
|
12638
|
-
}
|
|
12639
|
-
/**
|
|
12640
|
-
* Parses a date or month token into `{ year, month }` strictly rejecting months outside `01..12`.
|
|
12641
|
-
*/
|
|
12642
|
-
function parseYearMonthParts(value) {
|
|
12643
|
-
if (value instanceof Date) {
|
|
12644
|
-
return Number.isNaN(value.getTime())
|
|
12645
|
-
? null
|
|
12646
|
-
: { year: value.getUTCFullYear(), month: value.getUTCMonth() + 1 };
|
|
12647
|
-
}
|
|
12648
|
-
if (typeof value === 'number') {
|
|
12649
|
-
if (!Number.isFinite(value)) {
|
|
12650
|
-
return null;
|
|
12651
|
-
}
|
|
12652
|
-
if (Number.isInteger(value) && value >= 190001 && value <= 999912) {
|
|
12653
|
-
const year = Math.floor(value / 100);
|
|
12654
|
-
const month = value % 100;
|
|
12655
|
-
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
12656
|
-
}
|
|
12657
|
-
if (!Number.isInteger(value) || Math.abs(value) < 1e10) {
|
|
12658
|
-
return null;
|
|
12659
|
-
}
|
|
12660
|
-
const date = new Date(value);
|
|
12661
|
-
return Number.isNaN(date.getTime())
|
|
12662
|
-
? null
|
|
12663
|
-
: { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1 };
|
|
12664
|
-
}
|
|
12665
|
-
if (typeof value !== 'string') {
|
|
12666
|
-
return null;
|
|
12667
|
-
}
|
|
12668
|
-
const raw = value.trim();
|
|
12669
|
-
if (!raw) {
|
|
12670
|
-
return null;
|
|
12671
|
-
}
|
|
12672
|
-
const ymMatch = YEAR_MONTH_RE.exec(raw);
|
|
12673
|
-
if (ymMatch) {
|
|
12674
|
-
const year = Number(ymMatch[1]);
|
|
12675
|
-
const month = Number(ymMatch[2]);
|
|
12676
|
-
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
12677
|
-
}
|
|
12678
|
-
const compactMatch = COMPACT_YEAR_MONTH_RE.exec(raw);
|
|
12679
|
-
if (compactMatch) {
|
|
12680
|
-
const year = Number(compactMatch[1]);
|
|
12681
|
-
const month = Number(compactMatch[2]);
|
|
12682
|
-
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
12683
|
-
}
|
|
12684
|
-
const myMatch = MONTH_YEAR_RE.exec(raw);
|
|
12685
|
-
if (myMatch) {
|
|
12686
|
-
const month = Number(myMatch[1]);
|
|
12687
|
-
const year = Number(myMatch[2]);
|
|
12688
|
-
return isValidYearMonth(year, month) ? { year, month } : null;
|
|
12689
|
-
}
|
|
12690
|
-
const isoMatch = ISO_DATE_PREFIX_RE.exec(raw);
|
|
12691
|
-
if (isoMatch) {
|
|
12692
|
-
const year = Number(isoMatch[1]);
|
|
12693
|
-
const month = Number(isoMatch[2]);
|
|
12694
|
-
const day = Number(isoMatch[3]);
|
|
12695
|
-
if (!isValidCalendarDate(year, month, day)) {
|
|
12696
|
-
return null;
|
|
12697
|
-
}
|
|
12698
|
-
return { year, month };
|
|
12699
|
-
}
|
|
12700
|
-
const brMatch = BR_DATE_RE.exec(raw);
|
|
12701
|
-
if (brMatch) {
|
|
12702
|
-
const day = Number(brMatch[1]);
|
|
12703
|
-
const month = Number(brMatch[2]);
|
|
12704
|
-
const year = Number(brMatch[3]);
|
|
12705
|
-
if (!isValidCalendarDate(year, month, day)) {
|
|
12706
|
-
return null;
|
|
12707
|
-
}
|
|
12708
|
-
return { year, month };
|
|
12709
|
-
}
|
|
12710
|
-
return null;
|
|
12711
|
-
}
|
|
12712
|
-
/**
|
|
12713
|
-
* Formats valid year/month inputs as `'YYYY-MM'`. Returns `null` for invalid tokens or months outside `01..12`.
|
|
12714
|
-
*/
|
|
12715
|
-
function normalizeYearMonthToken(value) {
|
|
12716
|
-
const parts = parseYearMonthParts(value);
|
|
12717
|
-
if (!parts) {
|
|
12718
|
-
return null;
|
|
13767
|
+
function stripCrossFilterSourcesFromQueryContext(ctx) {
|
|
13768
|
+
if (!ctx?.meta || !Object.prototype.hasOwnProperty.call(ctx.meta, 'crossFilterSources')) {
|
|
13769
|
+
return ctx;
|
|
12719
13770
|
}
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
* strictly dropping any tokens outside `01..12`.
|
|
12725
|
-
*/
|
|
12726
|
-
function normalizeMonthlyFilterValues(value) {
|
|
12727
|
-
const rawItems = Array.isArray(value) ? value : [value];
|
|
12728
|
-
const result = [];
|
|
12729
|
-
const seen = new Set();
|
|
12730
|
-
for (const item of rawItems) {
|
|
12731
|
-
const token = normalizeYearMonthToken(item);
|
|
12732
|
-
if (!token || seen.has(token)) {
|
|
12733
|
-
continue;
|
|
12734
|
-
}
|
|
12735
|
-
seen.add(token);
|
|
12736
|
-
result.push(token);
|
|
13771
|
+
const { crossFilterSources: _ignored, ...restMeta } = ctx.meta;
|
|
13772
|
+
if (Object.keys(restMeta).length === 0) {
|
|
13773
|
+
const { meta: _omittedMeta, ...restCtx } = ctx;
|
|
13774
|
+
return Object.keys(restCtx).length > 0 ? restCtx : null;
|
|
12737
13775
|
}
|
|
12738
|
-
return
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
}
|
|
12743
|
-
function formatIsoMonthEnd(parts) {
|
|
12744
|
-
const lastDay = new Date(Date.UTC(parts.year, parts.month, 0)).getUTCDate();
|
|
12745
|
-
return `${String(parts.year).padStart(4, '0')}-${String(parts.month).padStart(2, '0')}-${String(lastDay).padStart(2, '0')}`;
|
|
13776
|
+
return {
|
|
13777
|
+
...ctx,
|
|
13778
|
+
meta: restMeta,
|
|
13779
|
+
};
|
|
12746
13780
|
}
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
if (value.length !== 2) {
|
|
12754
|
-
return null;
|
|
12755
|
-
}
|
|
12756
|
-
const [rawLow, rawHigh] = value;
|
|
12757
|
-
const hasLow = rawLow !== undefined && rawLow !== null && rawLow !== '';
|
|
12758
|
-
const hasHigh = rawHigh !== undefined && rawHigh !== null && rawHigh !== '';
|
|
12759
|
-
if (!hasLow && !hasHigh) {
|
|
12760
|
-
return null;
|
|
12761
|
-
}
|
|
12762
|
-
const lowParts = hasLow ? parseYearMonthParts(rawLow) : null;
|
|
12763
|
-
const highParts = hasHigh ? parseYearMonthParts(rawHigh) : null;
|
|
12764
|
-
if ((hasLow && !lowParts) || (hasHigh && !highParts)) {
|
|
12765
|
-
return null;
|
|
12766
|
-
}
|
|
12767
|
-
return [
|
|
12768
|
-
lowParts ? formatIsoMonthStart(lowParts) : null,
|
|
12769
|
-
highParts ? formatIsoMonthEnd(highParts) : null,
|
|
12770
|
-
];
|
|
12771
|
-
}
|
|
12772
|
-
if (value && typeof value === 'object' && !(value instanceof Date)) {
|
|
12773
|
-
const record = value;
|
|
12774
|
-
const rawLow = record['from'] ?? record['gte'] ?? record['start'];
|
|
12775
|
-
const rawHigh = record['to'] ?? record['lte'] ?? record['lt'] ?? record['end'];
|
|
12776
|
-
return expandMonthlyRangeToIsoDates([rawLow ?? null, rawHigh ?? null]);
|
|
12777
|
-
}
|
|
12778
|
-
const singleParts = parseYearMonthParts(value);
|
|
12779
|
-
if (!singleParts) {
|
|
12780
|
-
return null;
|
|
12781
|
-
}
|
|
12782
|
-
return [formatIsoMonthStart(singleParts), formatIsoMonthEnd(singleParts)];
|
|
13781
|
+
function normalizePrimitiveSelectionTokens(value) {
|
|
13782
|
+
const items = Array.isArray(value) ? value : [value];
|
|
13783
|
+
return items
|
|
13784
|
+
.filter((entry) => entry !== null && entry !== undefined && String(entry).trim() !== '')
|
|
13785
|
+
.map((entry) => String(entry).trim().toLowerCase())
|
|
13786
|
+
.sort();
|
|
12783
13787
|
}
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
*/
|
|
12787
|
-
function isMonthlyFilterKey(key) {
|
|
12788
|
-
const trimmed = key.trim();
|
|
12789
|
-
if (!trimmed) {
|
|
13788
|
+
function areSelectionTokensEqual(left, right) {
|
|
13789
|
+
if (left.length === 0 || left.length !== right.length) {
|
|
12790
13790
|
return false;
|
|
12791
13791
|
}
|
|
12792
|
-
return
|
|
12793
|
-
}
|
|
12794
|
-
|
|
12795
|
-
const RANGE_SUFFIX_RE = /(?:Range|Between|Entre|Period|Dates?)$/i;
|
|
12796
|
-
const DATE_RANGE_KEY_RE = /(?:Dates?|DateRange|DateBetween|DateEntre|DatePeriod|DataRange|DataBetween|DataEntre|DataPeriod)$/i;
|
|
12797
|
-
const MONTH_ONLY_STRING_RE = /^(?:\d{4}[-/]\d{1,2}|\d{1,2}[-/]\d{4}|\d{6})$/;
|
|
12798
|
-
const SCALAR_COMPOUND_IN_KEYS = new Set([
|
|
12799
|
-
'checkin',
|
|
12800
|
-
'signin',
|
|
12801
|
-
'login',
|
|
12802
|
-
'linkedin',
|
|
12803
|
-
'tradein',
|
|
12804
|
-
'walkin',
|
|
12805
|
-
'builtin',
|
|
12806
|
-
'dropin',
|
|
12807
|
-
'clockin',
|
|
12808
|
-
'optin',
|
|
12809
|
-
'punchin',
|
|
12810
|
-
'clock_in',
|
|
12811
|
-
'check_in',
|
|
12812
|
-
'sign_in',
|
|
12813
|
-
'log_in',
|
|
12814
|
-
'walk_in',
|
|
12815
|
-
'built_in',
|
|
12816
|
-
'drop_in',
|
|
12817
|
-
'trade_in',
|
|
12818
|
-
'linked_in',
|
|
12819
|
-
'opt_in',
|
|
12820
|
-
'punch_in',
|
|
12821
|
-
]);
|
|
12822
|
-
const PREFIXED_SCALAR_CAMEL_IN_RE = /(?:Check|Sign|Log|Clock|Walk|Drop|Trade|Built|Linked|Opt|Punch)In$/;
|
|
12823
|
-
const PREFIXED_SCALAR_SNAKE_IN_RE = /(?:^|_)(?:check|sign|log|clock|walk|drop|trade|built|linked|opt|punch)_in$/i;
|
|
12824
|
-
function isRecord(value) {
|
|
12825
|
-
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
12826
|
-
}
|
|
12827
|
-
function coerceMonthlyRangeBounds(key, rawLow, rawHigh) {
|
|
12828
|
-
const hasLow = rawLow !== undefined && rawLow !== null && rawLow !== '';
|
|
12829
|
-
const hasHigh = rawHigh !== undefined && rawHigh !== null && rawHigh !== '';
|
|
12830
|
-
if (DATE_RANGE_KEY_RE.test(key)) {
|
|
12831
|
-
const lowExpanded = hasLow ? expandMonthlyRangeToIsoDates([rawLow, null])?.[0] ?? null : null;
|
|
12832
|
-
const highExpanded = hasHigh ? expandMonthlyRangeToIsoDates([null, rawHigh])?.[1] ?? null : null;
|
|
12833
|
-
return [lowExpanded, highExpanded];
|
|
12834
|
-
}
|
|
12835
|
-
return [
|
|
12836
|
-
hasLow ? (normalizeYearMonthToken(rawLow) ?? null) : null,
|
|
12837
|
-
hasHigh ? (normalizeYearMonthToken(rawHigh) ?? null) : null,
|
|
12838
|
-
];
|
|
12839
|
-
}
|
|
12840
|
-
function isEmptyBound(value) {
|
|
12841
|
-
return value === undefined || value === null || value === '';
|
|
12842
|
-
}
|
|
12843
|
-
function isMonthOnlyToken(value) {
|
|
12844
|
-
return ((typeof value === 'string' && MONTH_ONLY_STRING_RE.test(value.trim())) ||
|
|
12845
|
-
(typeof value === 'number' && Number.isInteger(value) && value >= 190001 && value <= 999912));
|
|
13792
|
+
return left.every((token, index) => token === right[index]);
|
|
12846
13793
|
}
|
|
12847
|
-
function
|
|
12848
|
-
|
|
13794
|
+
function isSelectionFilterEntryStillActive(selKey, selValue, rawFilters, rawSources) {
|
|
13795
|
+
const expectedTokens = normalizePrimitiveSelectionTokens(selValue);
|
|
13796
|
+
if (expectedTokens.length === 0) {
|
|
12849
13797
|
return false;
|
|
12850
13798
|
}
|
|
12851
|
-
const [
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
(
|
|
12855
|
-
|
|
12856
|
-
}
|
|
12857
|
-
/**
|
|
12858
|
-
* Coerces a single cross-filter entry to canonical Praxis FilterDTO wire format:
|
|
12859
|
-
* - Keys targeting `IN` sets (suffix `In`, `Ids`, or collection-bound `IN` fields) -> flat deduplicated array.
|
|
12860
|
-
* - Range objects (`{ from, to }`, `{ start, end }`, `{ gte, lt }`, `{ gte, lte }`) -> `[from, to]` tuple when bounded.
|
|
12861
|
-
* - Primitive scalars remain scalar values.
|
|
12862
|
-
*/
|
|
12863
|
-
function coerceCrossFilterValue(key, rawValue) {
|
|
12864
|
-
if (rawValue === undefined || rawValue === null) {
|
|
12865
|
-
return rawValue;
|
|
12866
|
-
}
|
|
12867
|
-
const trimmedKey = key.trim();
|
|
12868
|
-
const isMonthKey = isMonthlyFilterKey(trimmedKey);
|
|
12869
|
-
const isKnownScalarInCompound = SCALAR_COMPOUND_IN_KEYS.has(trimmedKey.toLowerCase()) ||
|
|
12870
|
-
PREFIXED_SCALAR_CAMEL_IN_RE.test(trimmedKey) ||
|
|
12871
|
-
PREFIXED_SCALAR_SNAKE_IN_RE.test(trimmedKey);
|
|
12872
|
-
const isBooleanInFlag = !Array.isArray(rawValue) &&
|
|
12873
|
-
typeof rawValue === 'boolean' &&
|
|
12874
|
-
/(?:In|_in)$/i.test(trimmedKey);
|
|
12875
|
-
const expectsArray = !isKnownScalarInCompound &&
|
|
12876
|
-
!isBooleanInFlag &&
|
|
12877
|
-
(/(?:In|Ids)$/.test(trimmedKey) ||
|
|
12878
|
-
trimmedKey.toLowerCase().endsWith('_in'));
|
|
12879
|
-
if (isRecord(rawValue)) {
|
|
12880
|
-
const low = rawValue['from'] ?? rawValue['gte'] ?? rawValue['start'];
|
|
12881
|
-
const high = rawValue['to'] ?? rawValue['lte'] ?? rawValue['lt'] ?? rawValue['end'];
|
|
12882
|
-
const hasLow = low !== undefined && low !== null;
|
|
12883
|
-
const hasHigh = high !== undefined && high !== null;
|
|
12884
|
-
if (hasLow || hasHigh) {
|
|
12885
|
-
if (isMonthKey) {
|
|
12886
|
-
return coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
12887
|
-
}
|
|
12888
|
-
if (DATE_RANGE_KEY_RE.test(trimmedKey) && (!hasLow || isMonthOnlyToken(low)) && (!hasHigh || isMonthOnlyToken(high))) {
|
|
12889
|
-
return coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
12890
|
-
}
|
|
12891
|
-
return [hasLow ? low : null, hasHigh ? high : null];
|
|
12892
|
-
}
|
|
12893
|
-
if (isMonthKey && Array.isArray(rawValue['values'])) {
|
|
12894
|
-
return normalizeMonthlyFilterValues(rawValue['values']);
|
|
12895
|
-
}
|
|
12896
|
-
if (Array.isArray(rawValue['values'])) {
|
|
12897
|
-
return [...rawValue['values']];
|
|
12898
|
-
}
|
|
12899
|
-
}
|
|
12900
|
-
if (isMonthKey) {
|
|
12901
|
-
if (Array.isArray(rawValue) && rawValue.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
12902
|
-
return coerceMonthlyRangeBounds(trimmedKey, rawValue[0], rawValue[1]);
|
|
12903
|
-
}
|
|
12904
|
-
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
12905
|
-
return expandMonthlyRangeToIsoDates(rawValue) ?? [];
|
|
12906
|
-
}
|
|
12907
|
-
return normalizeMonthlyFilterValues(rawValue);
|
|
12908
|
-
}
|
|
12909
|
-
if (expectsArray) {
|
|
12910
|
-
const items = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
12911
|
-
const deduped = [];
|
|
12912
|
-
const seen = new Set();
|
|
12913
|
-
for (const item of items) {
|
|
12914
|
-
if (item === undefined || item === null || item === '')
|
|
12915
|
-
continue;
|
|
12916
|
-
const sig = `${typeof item}:${String(item)}`;
|
|
12917
|
-
if (!seen.has(sig)) {
|
|
12918
|
-
seen.add(sig);
|
|
12919
|
-
deduped.push(item);
|
|
12920
|
-
}
|
|
12921
|
-
}
|
|
12922
|
-
return deduped;
|
|
12923
|
-
}
|
|
12924
|
-
if (Array.isArray(rawValue) && rawValue.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
12925
|
-
if (isMonthlyDateRangeTuple(trimmedKey, rawValue)) {
|
|
12926
|
-
return coerceMonthlyRangeBounds(trimmedKey, rawValue[0], rawValue[1]);
|
|
12927
|
-
}
|
|
12928
|
-
return [rawValue[0], rawValue[1]];
|
|
12929
|
-
}
|
|
12930
|
-
return rawValue;
|
|
12931
|
-
}
|
|
12932
|
-
/**
|
|
12933
|
-
* Coerces all keys in a cross-filter map into FilterDTO-compatible payloads (`*In` arrays, `BETWEEN` tuples, scalars).
|
|
12934
|
-
*/
|
|
12935
|
-
function coerceCrossFilterPayload(rawFilters, projection) {
|
|
12936
|
-
if (!isRecord(rawFilters)) {
|
|
12937
|
-
return {};
|
|
12938
|
-
}
|
|
12939
|
-
const dimensionRoleMap = new Map();
|
|
12940
|
-
const registerDimension = (dim) => {
|
|
12941
|
-
if (!dim)
|
|
12942
|
-
return;
|
|
12943
|
-
const role = dim.role ?? 'category';
|
|
12944
|
-
const field = dim.field?.trim();
|
|
12945
|
-
if (field) {
|
|
12946
|
-
dimensionRoleMap.set(field, role);
|
|
12947
|
-
}
|
|
12948
|
-
const keyFilterField = dim.keyFilterField?.trim();
|
|
12949
|
-
if (keyFilterField) {
|
|
12950
|
-
dimensionRoleMap.set(keyFilterField, role);
|
|
12951
|
-
}
|
|
12952
|
-
};
|
|
12953
|
-
registerDimension(projection?.bindings?.primaryDimension);
|
|
12954
|
-
registerDimension(projection?.bindings?.secondaryDimension);
|
|
12955
|
-
if (Array.isArray(projection?.bindings?.dimensions)) {
|
|
12956
|
-
for (const dim of projection.bindings.dimensions) {
|
|
12957
|
-
registerDimension(dim);
|
|
12958
|
-
}
|
|
12959
|
-
}
|
|
12960
|
-
const secondaryDims = projection?.bindings?.secondaryDimensions;
|
|
12961
|
-
if (Array.isArray(secondaryDims)) {
|
|
12962
|
-
for (const dim of secondaryDims) {
|
|
12963
|
-
registerDimension(dim);
|
|
13799
|
+
for (const [candidateKey, entry] of Object.entries(rawSources)) {
|
|
13800
|
+
const matchesKey = matchesDimensionFieldKey(candidateKey, selKey) ||
|
|
13801
|
+
Boolean(entry?.dimensionField && matchesDimensionFieldKey(entry.dimensionField, selKey));
|
|
13802
|
+
if (matchesKey && areSelectionTokensEqual(normalizePrimitiveSelectionTokens(entry?.value), expectedTokens)) {
|
|
13803
|
+
return true;
|
|
12964
13804
|
}
|
|
12965
13805
|
}
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
const role = dimensionRoleMap.get(key);
|
|
12972
|
-
const isMonthRole = role === 'month' || role === 'year-month' || role === 'competence';
|
|
12973
|
-
if (isMonthRole) {
|
|
12974
|
-
if (isRecord(value)) {
|
|
12975
|
-
const low = value['from'] ?? value['gte'] ?? value['start'];
|
|
12976
|
-
const high = value['to'] ?? value['lte'] ?? value['lt'] ?? value['end'];
|
|
12977
|
-
const hasLow = low !== undefined && low !== null;
|
|
12978
|
-
const hasHigh = high !== undefined && high !== null;
|
|
12979
|
-
next[key] = hasLow || hasHigh
|
|
12980
|
-
? coerceMonthlyRangeBounds(trimmedKey, low, high)
|
|
12981
|
-
: Array.isArray(value['values'])
|
|
12982
|
-
? normalizeMonthlyFilterValues(value['values'])
|
|
12983
|
-
: coerceCrossFilterValue(key, value);
|
|
12984
|
-
continue;
|
|
12985
|
-
}
|
|
12986
|
-
if (Array.isArray(value) && value.length === 2 && RANGE_SUFFIX_RE.test(trimmedKey)) {
|
|
12987
|
-
next[key] = coerceMonthlyRangeBounds(trimmedKey, value[0], value[1]);
|
|
12988
|
-
continue;
|
|
12989
|
-
}
|
|
12990
|
-
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
12991
|
-
next[key] = expandMonthlyRangeToIsoDates(value) ?? [];
|
|
12992
|
-
continue;
|
|
12993
|
-
}
|
|
12994
|
-
next[key] = normalizeMonthlyFilterValues(value);
|
|
12995
|
-
continue;
|
|
12996
|
-
}
|
|
12997
|
-
if ((role === 'range' || role === 'bucket') && isRecord(value)) {
|
|
12998
|
-
const low = value['from'] ?? value['gte'] ?? value['start'];
|
|
12999
|
-
const high = value['to'] ?? value['lte'] ?? value['lt'] ?? value['end'];
|
|
13000
|
-
const hasLow = low !== undefined && low !== null;
|
|
13001
|
-
const hasHigh = high !== undefined && high !== null;
|
|
13002
|
-
if (hasLow || hasHigh) {
|
|
13003
|
-
if (isMonthlyFilterKey(trimmedKey)) {
|
|
13004
|
-
next[key] = coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
13005
|
-
continue;
|
|
13006
|
-
}
|
|
13007
|
-
if (DATE_RANGE_KEY_RE.test(trimmedKey) && (!hasLow || isMonthOnlyToken(low)) && (!hasHigh || isMonthOnlyToken(high))) {
|
|
13008
|
-
next[key] = coerceMonthlyRangeBounds(trimmedKey, low, high);
|
|
13009
|
-
continue;
|
|
13010
|
-
}
|
|
13011
|
-
next[key] = [hasLow ? low : null, hasHigh ? high : null];
|
|
13012
|
-
continue;
|
|
13013
|
-
}
|
|
13014
|
-
next[key] = coerceCrossFilterValue(key, value);
|
|
13015
|
-
continue;
|
|
13016
|
-
}
|
|
13017
|
-
if ((role === 'range' || role === 'bucket') && !isRecord(value)) {
|
|
13018
|
-
if (DATE_RANGE_KEY_RE.test(trimmedKey)) {
|
|
13019
|
-
if (Array.isArray(value) && isMonthlyDateRangeTuple(trimmedKey, value)) {
|
|
13020
|
-
next[key] = coerceMonthlyRangeBounds(trimmedKey, value[0], value[1]);
|
|
13021
|
-
continue;
|
|
13022
|
-
}
|
|
13023
|
-
if (isMonthOnlyToken(value)) {
|
|
13024
|
-
next[key] = expandMonthlyRangeToIsoDates(value) ?? [];
|
|
13025
|
-
continue;
|
|
13026
|
-
}
|
|
13806
|
+
if (rawFilters && typeof rawFilters === 'object') {
|
|
13807
|
+
for (const [candidateKey, candidateValue] of Object.entries(rawFilters)) {
|
|
13808
|
+
if (matchesDimensionFieldKey(candidateKey, selKey) &&
|
|
13809
|
+
areSelectionTokensEqual(normalizePrimitiveSelectionTokens(candidateValue), expectedTokens)) {
|
|
13810
|
+
return true;
|
|
13027
13811
|
}
|
|
13028
|
-
next[key] = coerceCrossFilterValue(key, value);
|
|
13029
|
-
continue;
|
|
13030
|
-
}
|
|
13031
|
-
next[key] = coerceCrossFilterValue(key, value);
|
|
13032
|
-
}
|
|
13033
|
-
return next;
|
|
13034
|
-
}
|
|
13035
|
-
function mergeCrossFiltersIntoQueryContext(baseQueryContext, crossFilters, lockedKeys = []) {
|
|
13036
|
-
const lockedSet = new Set(lockedKeys);
|
|
13037
|
-
const baseFilters = isRecord(baseQueryContext?.filters)
|
|
13038
|
-
? { ...baseQueryContext.filters }
|
|
13039
|
-
: {};
|
|
13040
|
-
const mergedFilters = { ...baseFilters };
|
|
13041
|
-
for (const [key, value] of Object.entries(crossFilters)) {
|
|
13042
|
-
if (lockedSet.has(key))
|
|
13043
|
-
continue;
|
|
13044
|
-
if (value === undefined || value === null || (Array.isArray(value) && value.length === 0)) {
|
|
13045
|
-
delete mergedFilters[key];
|
|
13046
|
-
}
|
|
13047
|
-
else {
|
|
13048
|
-
mergedFilters[key] = value;
|
|
13049
13812
|
}
|
|
13050
13813
|
}
|
|
13051
|
-
return
|
|
13052
|
-
...(baseQueryContext ?? {}),
|
|
13053
|
-
filters: mergedFilters,
|
|
13054
|
-
};
|
|
13814
|
+
return false;
|
|
13055
13815
|
}
|
|
13056
13816
|
|
|
13057
13817
|
function isNullFilterCriterion(value) {
|
|
@@ -14783,6 +15543,12 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
14783
15543
|
resultDiagnostic = signal(null, ...(ngDevMode ? [{ debugName: "resultDiagnostic" }] : /* istanbul ignore next */ []));
|
|
14784
15544
|
activeRowCrossFilterSignature = signal(null, ...(ngDevMode ? [{ debugName: "activeRowCrossFilterSignature" }] : /* istanbul ignore next */ []));
|
|
14785
15545
|
runtimeContextRevision = signal(0, ...(ngDevMode ? [{ debugName: "runtimeContextRevision" }] : /* istanbul ignore next */ []));
|
|
15546
|
+
runtimeContextSuspended = signal(Boolean(this.enterpriseRuntimeContext?.isSwitching) ||
|
|
15547
|
+
(this.enterpriseRuntimeContext?.snapshot != null &&
|
|
15548
|
+
!isEnterpriseRuntimeSnapshotReady(this.enterpriseRuntimeContext.snapshot)), ...(ngDevMode ? [{ debugName: "runtimeContextSuspended" }] : /* istanbul ignore next */ []));
|
|
15549
|
+
hadNonNullRuntimeContext = isEnterpriseRuntimeSnapshotReady(this.enterpriseRuntimeContext?.snapshot) ||
|
|
15550
|
+
Boolean(this.enterpriseRuntimeContext?.isSwitching);
|
|
15551
|
+
seenInitialRuntimeContext = false;
|
|
14786
15552
|
activeCrossFilterChartId = null;
|
|
14787
15553
|
activeRowCrossFilterFilters = null;
|
|
14788
15554
|
activeRowCrossFilterObservedInQuery = false;
|
|
@@ -15021,8 +15787,34 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
15021
15787
|
this.syncShellContext();
|
|
15022
15788
|
if (this.enterpriseRuntimeContext?.contextChanges$) {
|
|
15023
15789
|
this.enterpriseRuntimeContext.contextChanges$
|
|
15024
|
-
.pipe(
|
|
15025
|
-
.subscribe(() => {
|
|
15790
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
15791
|
+
.subscribe((snapshot) => {
|
|
15792
|
+
const ready = isEnterpriseRuntimeSnapshotReady(snapshot);
|
|
15793
|
+
if (!this.seenInitialRuntimeContext) {
|
|
15794
|
+
this.seenInitialRuntimeContext = true;
|
|
15795
|
+
if (ready) {
|
|
15796
|
+
this.hadNonNullRuntimeContext = true;
|
|
15797
|
+
}
|
|
15798
|
+
return;
|
|
15799
|
+
}
|
|
15800
|
+
if (!ready) {
|
|
15801
|
+
if (!this.hadNonNullRuntimeContext) {
|
|
15802
|
+
return;
|
|
15803
|
+
}
|
|
15804
|
+
this.runtimeContextSuspended.set(true);
|
|
15805
|
+
this.lastLoadedProjectionKey = null;
|
|
15806
|
+
this.resultRows.set([]);
|
|
15807
|
+
this.resultSuppression.set(null);
|
|
15808
|
+
this.resultState.set('loading');
|
|
15809
|
+
return;
|
|
15810
|
+
}
|
|
15811
|
+
this.hadNonNullRuntimeContext = true;
|
|
15812
|
+
this.runtimeContextSuspended.set(false);
|
|
15813
|
+
const res = this.resourcePath()?.trim() ||
|
|
15814
|
+
this.resolved()?.projection?.source?.resource?.trim();
|
|
15815
|
+
if (res) {
|
|
15816
|
+
this.statsExecution?.invalidateResource(res);
|
|
15817
|
+
}
|
|
15026
15818
|
this.runtimeContextRevision.update((value) => value + 1);
|
|
15027
15819
|
});
|
|
15028
15820
|
}
|
|
@@ -15083,6 +15875,8 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
15083
15875
|
}
|
|
15084
15876
|
});
|
|
15085
15877
|
effect(() => {
|
|
15878
|
+
this.runtimeContextRevision();
|
|
15879
|
+
const suspended = this.runtimeContextSuspended();
|
|
15086
15880
|
const explicitAnalytics = this.analytics();
|
|
15087
15881
|
const resourcePath = this.resourcePath()?.trim() || null;
|
|
15088
15882
|
const operation = this.filterOperation();
|
|
@@ -15093,10 +15887,15 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
15093
15887
|
this.hydrationDiagnostic.set(null);
|
|
15094
15888
|
return;
|
|
15095
15889
|
}
|
|
15890
|
+
if (suspended) {
|
|
15891
|
+
this.hydrationLoading.set(true);
|
|
15892
|
+
return;
|
|
15893
|
+
}
|
|
15096
15894
|
void this.hydrateAnalyticsFromResource(resourcePath, operation, schemaType, generation);
|
|
15097
15895
|
});
|
|
15098
15896
|
effect((onCleanup) => {
|
|
15099
15897
|
this.runtimeContextRevision();
|
|
15898
|
+
const suspended = this.runtimeContextSuspended();
|
|
15100
15899
|
const resolved = this.resolved();
|
|
15101
15900
|
const queryContext = this.queryContext();
|
|
15102
15901
|
const generation = ++this.resultRequestGeneration;
|
|
@@ -15120,6 +15919,10 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
15120
15919
|
this.resultState.set('idle');
|
|
15121
15920
|
return;
|
|
15122
15921
|
}
|
|
15922
|
+
if (suspended) {
|
|
15923
|
+
this.resultState.set('loading');
|
|
15924
|
+
return;
|
|
15925
|
+
}
|
|
15123
15926
|
if (!sameProjection) {
|
|
15124
15927
|
this.lastLoadedProjectionKey = null;
|
|
15125
15928
|
this.resultRows.set([]);
|
|
@@ -16175,7 +16978,7 @@ class PraxisAnalyticsPresentationComponent {
|
|
|
16175
16978
|
provide: PRAXIS_WIDGET_SHELL_ACTION_CONTRIBUTOR,
|
|
16176
16979
|
useExisting: forwardRef(() => PraxisAnalyticsPresentationComponent),
|
|
16177
16980
|
},
|
|
16178
|
-
], viewQueries: [{ propertyName: "analyticTable", first: true, predicate: PraxisTable, descendants: true, isSignal: true }, { propertyName: "childChart", first: true, predicate: PraxisChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<section\n class=\"analytics-presentation\"\n [class.analytics-presentation--refreshing]=\"isResultLoading() && visibleResultRows().length > 0\"\n [attr.aria-busy]=\"isResultLoading() ? 'true' : null\"\n [attr.aria-label]=\"effectiveProjectionId() || resourcePath() || 'analytics'\"\n>\n @if (availableProjections().length > 1 || showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__controls\">\n @if (projectionSelectorItems().length > 1 || (availableProjections().length > 1 && projectionSelectorItems().length > 0)) {\n <div\n class=\"analytics-presentation__projections\"\n role=\"group\"\n [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.projectionSelectorLabel', 'Analytics projection')\"\n >\n @for (option of projectionSelectorItems(); track option.projection.id) {\n <button\n type=\"button\"\n class=\"analytics-presentation__projection-btn\"\n [class.analytics-presentation__projection-btn--fallback]=\"showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily\"\n [attr.data-testid]=\"'projection-option-' + option.projection.id\"\n [attr.data-eligible-families]=\"option.eligibleFamilies.join(',')\"\n [attr.data-active-family-compatible]=\"option.compatibleWithActiveFamily ? 'true' : 'false'\"\n [attr.aria-pressed]=\"option.selected\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.title]=\"option.tooltip\"\n (click)=\"selectProjection(option.projection.id)\"\n >\n <span class=\"analytics-presentation__projection-label\">{{ option.label }}</span>\n @if (showProjectionFamilyIndicators() && option.eligibleBadges.length > 0) {\n <span\n class=\"analytics-presentation__projection-families\"\n data-testid=\"projection-family-indicators\"\n aria-hidden=\"true\"\n >\n @for (badge of option.eligibleBadges; track badge.family) {\n <mat-icon\n class=\"analytics-presentation__projection-family-icon\"\n [attr.data-family]=\"badge.family\"\n [praxisIcon]=\"badge.icon\"\n ></mat-icon>\n }\n </span>\n }\n @if (showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily && option.fallbackLabel) {\n <span\n class=\"analytics-presentation__projection-fallback\"\n data-testid=\"projection-family-fallback-badge\"\n >\n {{ option.fallbackLabel }}\n </span>\n }\n </button>\n }\n </div>\n }\n\n @if (showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__toolbar\" role=\"group\" [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.selectorLabel', 'Analytics presentation')\">\n @if (eligibleFamilies().includes('chart')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'chart'\" (click)=\"selectFamily('chart')\">\n <mat-icon praxisIcon=\"bar_chart\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.chart', 'Chart') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('analytic-table')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'analytic-table'\" (click)=\"selectFamily('analytic-table')\">\n <mat-icon praxisIcon=\"table_view\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.table', 'Table') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('kpi')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'kpi'\" (click)=\"selectFamily('kpi')\">\n <mat-icon praxisIcon=\"monitoring\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.kpi', 'KPI') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('summary-list')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'summary-list'\" (click)=\"selectFamily('summary-list')\">\n <mat-icon praxisIcon=\"format_list_bulleted\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.summaryList', 'Summary list') }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hydrationLoading() && !effectiveAnalytics()) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\">\n <span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span>\n </section>\n } @else if (diagnostic(); as message) {\n <section class=\"analytics-presentation__state analytics-presentation__state--error\" role=\"alert\">\n <strong>{{ t('praxis.charts.analyticsPresentation.unavailable', 'Presentation unavailable') }}</strong>\n <span>{{ message }}</span>\n </section>\n } @else if (activeFamily() === 'chart' && chartConfig(); as config) {\n <praxis-chart\n [config]=\"config\"\n [queryContext]=\"queryContext()\"\n [remoteDataResolver]=\"chartRemoteDataResolver()\"\n [dataAlternativeMode]=\"chartDataAlternativeMode()\"\n [externalDataAlternativeLabel]=\"chartExternalTableLabel()\"\n [enableCustomization]=\"enableCustomization()\"\n (pointClick)=\"pointClick.emit($event)\"\n (pointAction)=\"pointAction.emit($event)\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (drillDown)=\"drillDown.emit($event)\"\n (crossFilter)=\"handleChildCrossFilter($event)\"\n (queryRequest)=\"queryRequest.emit($event)\"\n (loadStateChange)=\"loadStateChange.emit($event)\"\n (chartDocumentApplied)=\"handleChildChartDocumentApplied($event)\"\n (chartDocumentSaved)=\"handleChildChartDocumentSaved($event)\"\n (chartDocumentPatchChange)=\"handleChildChartDocumentPatchChange($event)\"\n />\n } @else if (activeFamily() === 'analytic-table' && tableConfig(); as config) {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (isEmbeddedSurface() && !embeddedInShell() && kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <praxis-table\n [config]=\"config\"\n [data]=\"visibleResultRows()\"\n [tableId]=\"(effectiveProjectionId() || 'analytics') + '-analytic-table'\"\n [configPersistenceStrategy]=\"'volatile'\"\n (rowClick)=\"handleTableRowClick($event)\"\n />\n }\n } @else if (activeFamily() === 'kpi') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__kpi\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.kpiCollection', 'Key metrics')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <div class=\"analytics-presentation__kpi-grid\" role=\"list\">\n @for (item of kpiItems(); track item.trackId) {\n <div role=\"listitem\">\n <button\n class=\"analytics-presentation__kpi-card\"\n type=\"button\"\n [class.analytics-presentation__kpi-card--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__kpi-headline\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n <span>{{ item.label }}</span>\n <small>{{ item.metricLabel }}</small>\n <praxis-micro-visualization\n class=\"analytics-presentation__kpi-viz\"\n [visualization]=\"item.microVisualization\"\n [interactiveContainer]=\"true\"\n />\n </button>\n </div>\n }\n </div>\n </section>\n }\n } @else if (activeFamily() === 'summary-list') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__summary\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.summaryList', 'Summary list')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <ul class=\"analytics-presentation__summary-list\">\n @for (item of summaryListItems(); track item.trackId) {\n <li class=\"analytics-presentation__summary-item\">\n <button\n type=\"button\"\n class=\"analytics-presentation__summary-row\"\n [class.analytics-presentation__summary-row--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__summary-row-top\">\n <span class=\"analytics-presentation__summary-label\">{{ item.label }}</span>\n <div class=\"analytics-presentation__summary-values\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n </div>\n <div class=\"analytics-presentation__summary-track\" aria-hidden=\"true\">\n <span class=\"analytics-presentation__summary-fill\" [style.width.%]=\"item.sharePercent\"></span>\n </div>\n <small class=\"analytics-presentation__summary-meta\">{{ item.metricLabel }}</small>\n </button>\n </li>\n }\n </ul>\n </section>\n }\n }\n</section>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.analytics-presentation{display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%;gap:12px}.analytics-presentation--refreshing .analytics-presentation__kpi,.analytics-presentation--refreshing .analytics-presentation__summary,.analytics-presentation--refreshing praxis-table{opacity:.78;transition:opacity .15s ease}.analytics-presentation__controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.analytics-presentation__projections{display:flex;flex-wrap:wrap;gap:4px}.analytics-presentation__projection-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:999px;background:var(--md-sys-color-surface-container-low, var(--mat-sys-surface-container-low));color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;font-size:.875rem;cursor:pointer}.analytics-presentation__projection-btn--fallback{border-style:dashed}.analytics-presentation__projection-families{display:inline-flex;align-items:center;gap:2px;opacity:.82}.analytics-presentation__projection-family-icon{width:14px;height:14px;font-size:14px;line-height:14px}.analytics-presentation__projection-fallback{padding:1px 6px;border-radius:999px;font-size:.72rem;font-weight:600;background:color-mix(in srgb,var(--praxis-warning, #92400e) 16%,transparent);color:var(--md-sys-color-on-surface, #1a1c1e)}.analytics-presentation__projection-btn[aria-pressed=true]{border-color:var(--md-sys-color-secondary, #0f766e);background:var(--md-sys-color-secondary-container, #d1fae5);color:var(--md-sys-color-on-secondary-container, #064e3b);font-weight:600}.analytics-presentation__projection-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__toolbar{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-left:auto;gap:2px;padding:2px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:10px;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container, #f0f1f3))}.analytics-presentation__toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--md-sys-color-on-surface-variant, #44474e);font:inherit;font-size:.8125rem;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color .14s ease,color .14s ease,box-shadow .14s ease}.analytics-presentation__toolbar button mat-icon{width:16px;height:16px;font-size:16px;line-height:16px;flex-shrink:0}.analytics-presentation__toolbar button:hover:not([aria-pressed=true]){color:var(--md-sys-color-on-surface, #1a1c1e);background:color-mix(in srgb,var(--md-sys-color-on-surface, #1a1c1e) 6%,transparent)}.analytics-presentation__toolbar button[aria-pressed=true]{background:var(--md-sys-color-primary-container, #d7e3ff);color:var(--md-sys-color-on-primary-container, #001b3e);font-weight:600;box-shadow:0 1px 2px color-mix(in srgb,var(--md-sys-color-shadow, #000) 10%,transparent)}.analytics-presentation__toolbar button:focus-visible{outline:2px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 55%,transparent);outline-offset:1px}@media(pointer:coarse){.analytics-presentation__toolbar button{min-height:36px;padding:0 12px}}.analytics-presentation__state{min-height:220px;display:grid;place-content:center;gap:6px;padding:24px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);text-align:center}.analytics-presentation__state--error{border-color:var(--md-sys-color-error, #ba1a1a);color:var(--md-sys-color-error, #ba1a1a)}.analytics-presentation__loading-label{font-weight:600;background-image:var(--pdx-text-shimmer-gradient, linear-gradient(105deg, var(--md-sys-color-on-surface-variant, #44474e) 0%, var(--md-sys-color-on-surface-variant, #44474e) 28%, var(--md-sys-color-primary, #1263b4) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--md-sys-color-on-surface-variant, #44474e) 72%, var(--md-sys-color-on-surface-variant, #44474e) 100%));background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-analytics-loading-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.analytics-presentation__loading-label{animation:none;background-image:none;color:var(--pdx-text-shimmer-fallback-color, var(--md-sys-color-on-surface, #1a1c1e));-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.analytics-presentation__loading-label{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}@keyframes praxis-analytics-loading-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}.analytics-presentation__kpi{display:grid;gap:16px;min-width:0}.analytics-presentation__kpi-header{display:grid;gap:4px}.analytics-presentation__kpi-header h3,.analytics-presentation__kpi-header p{margin:0}.analytics-presentation__kpi-header h3{color:var(--md-sys-color-on-surface, #1a1c1e);font-size:1rem;font-weight:650}.analytics-presentation__kpi-header p{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.875rem}.analytics-presentation__kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr));gap:12px;min-width:0}.analytics-presentation__kpi-card{display:grid;gap:6px;width:100%;height:100%;min-width:0;min-height:132px;align-content:center;padding:18px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__kpi-card:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__kpi-card:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__kpi-card--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__kpi-card strong{overflow-wrap:anywhere;color:var(--md-sys-color-primary, #1263b4);font-size:clamp(1.75rem,5vw,2.5rem);font-variant-numeric:tabular-nums;line-height:1}.analytics-presentation__kpi-card span,.analytics-presentation__kpi-card small{overflow-wrap:anywhere}.analytics-presentation__kpi-card span{font-weight:600}.analytics-presentation__kpi-card small{color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__kpi-headline{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__kpi-viz{display:block;margin-top:6px}.analytics-presentation__delta-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.75rem;font-weight:600;font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 18%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__delta-badge[data-tone=success]{background:color-mix(in srgb,var(--praxis-success, var(--ready, #1b7a43)) 16%,transparent);color:var(--praxis-success, var(--ready, #1b7a43))}.analytics-presentation__delta-badge[data-tone=danger]{background:color-mix(in srgb,var(--destructive, var(--md-sys-color-error, #c62828)) 16%,transparent);color:var(--destructive, var(--md-sys-color-error, #c62828))}.analytics-presentation__summary{display:grid;gap:12px;min-width:0}.analytics-presentation__summary-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}.analytics-presentation__summary-item{margin:0;padding:0}.analytics-presentation__summary-row{width:100%;display:grid;gap:6px;padding:12px 14px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:12px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__summary-row:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__summary-row:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__summary-row--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__state--suppressed{display:grid;gap:6px;background:color-mix(in srgb,var(--md-sys-color-secondary-container, #dbeafe) 22%,transparent)}.analytics-presentation__privacy-badge{display:inline-flex;align-items:center;width:fit-content;max-width:100%;padding:4px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline, #94a3b8) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, #eef2f6) 80%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem;line-height:1.3}.analytics-presentation__summary-row-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__summary-label{font-weight:600;overflow-wrap:anywhere}.analytics-presentation__summary-values{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}.analytics-presentation__summary-track{height:6px;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 28%,transparent)}.analytics-presentation__summary-fill{display:block;height:100%;border-radius:inherit;background:var(--md-sys-color-primary, #1263b4)}.analytics-presentation__summary-meta{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem}@media(max-width:600px){.analytics-presentation__controls{flex-direction:column;align-items:stretch}.analytics-presentation__toolbar{margin-left:0;justify-content:stretch}.analytics-presentation__toolbar button,.analytics-presentation__projection-btn{flex:1 1 0}}:host-context(.pdx-shell:not(.no-shell)) .analytics-presentation{border:var(--praxis-analytics-shell-border, 0);border-radius:var(--praxis-analytics-shell-radius, 0);box-shadow:var(--praxis-analytics-shell-shadow, none);background:var(--praxis-analytics-shell-bg, transparent);padding:var(--praxis-analytics-shell-padding, 0)}@media(forced-colors:active){.analytics-presentation__toolbar button[aria-pressed=true],.analytics-presentation__projection-btn[aria-pressed=true],.analytics-presentation__kpi-card--selected,.analytics-presentation__summary-row--selected{forced-color-adjust:auto;border-color:Highlight;outline:2px solid Highlight;outline-offset:-2px}}@media print{.analytics-presentation__controls{display:none}}\n"], dependencies: [{ kind: "component", type: PraxisChartComponent, selector: "praxis-chart", inputs: ["config", "resourceKey", "data", "chartDocument", "filterCriteria", "queryContext", "remoteDataResolver", "dataAlternativeMode", "externalDataAlternativeLabel", "enableCustomization", "availableResources", "availableFields", "availableTargets", "epistemicBadgeVariant"], outputs: ["pointClick", "pointAction", "selectionChange", "drillDown", "crossFilter", "queryRequest", "loadStateChange", "chartDocumentApplied", "chartDocumentSaved", "chartDocumentPatchChange", "brushSelect", "timelineChange"] }, { kind: "component", type: PraxisTable, selector: "praxis-table", inputs: ["config", "resourcePath", "collectionSurface", "data", "tableId", "componentInstanceId", "configPersistenceStrategy", "title", "subtitle", "icon", "autoDelete", "notifyIfOutdated", "snoozeMs", "autoOpenSettingsOnOutdated", "crudContext", "filterCriteria", "hostOwnsDefaultQuickFilter", "filterTeleport", "widgetId", "queryContext", "lockedFilterFields", "aiContext", "aiAssistantVoiceInputMode", "aiAssistantVoiceLanguage", "horizontalScroll", "enableCustomization", "authoringCapability", "dense"], outputs: ["filterCriteriaChange", "discoveredQuickFiltersChange", "discoveredResourceFactsChange", "discoveredInlineFilterFieldsChange", "queryContextClear", "queryContextChange", "rowClick", "widgetEvent", "resourceEvent", "rowDoubleClick", "rowExpansionChange", "rowAction", "toolbarAction", "bulkAction", "exportAction", "columnReorder", "columnReorderAttempt", "columnResize", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "configChange", "metadataChange", "loadingStateChange", "collectionLinksChange", "selectionChange", "drawerOpen", "drawerClose", "drawerTabChange"] }, { kind: "component", type: PraxisMicroVisualizationComponent, selector: "praxis-micro-visualization", inputs: ["visualization", "fallbackText", "interactiveContainer", "formatValue", "locale", "idPrefix", "disableTooltip"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16981
|
+
], viewQueries: [{ propertyName: "analyticTable", first: true, predicate: PraxisTable, descendants: true, isSignal: true }, { propertyName: "childChart", first: true, predicate: PraxisChartComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<section\n class=\"analytics-presentation\"\n [class.analytics-presentation--refreshing]=\"isResultLoading() && visibleResultRows().length > 0\"\n [attr.aria-busy]=\"isResultLoading() ? 'true' : null\"\n [attr.aria-label]=\"effectiveProjectionId() || resourcePath() || 'analytics'\"\n>\n @if (availableProjections().length > 1 || showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__controls\">\n @if (projectionSelectorItems().length > 1 || (availableProjections().length > 1 && projectionSelectorItems().length > 0)) {\n <div\n class=\"analytics-presentation__projections\"\n role=\"group\"\n [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.projectionSelectorLabel', 'Analytics projection')\"\n >\n @for (option of projectionSelectorItems(); track option.projection.id) {\n <button\n type=\"button\"\n class=\"analytics-presentation__projection-btn\"\n [class.analytics-presentation__projection-btn--fallback]=\"showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily\"\n [attr.data-testid]=\"'projection-option-' + option.projection.id\"\n [attr.data-eligible-families]=\"option.eligibleFamilies.join(',')\"\n [attr.data-active-family-compatible]=\"option.compatibleWithActiveFamily ? 'true' : 'false'\"\n [attr.aria-pressed]=\"option.selected\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.title]=\"option.tooltip\"\n (click)=\"selectProjection(option.projection.id)\"\n >\n <span class=\"analytics-presentation__projection-label\" [attr.title]=\"option.label\">{{ option.label }}</span>\n @if (showProjectionFamilyIndicators() && option.eligibleBadges.length > 0) {\n <span\n class=\"analytics-presentation__projection-families\"\n data-testid=\"projection-family-indicators\"\n aria-hidden=\"true\"\n >\n @for (badge of option.eligibleBadges; track badge.family) {\n <mat-icon\n class=\"analytics-presentation__projection-family-icon\"\n [attr.data-family]=\"badge.family\"\n [praxisIcon]=\"badge.icon\"\n ></mat-icon>\n }\n </span>\n }\n @if (showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily && option.fallbackLabel) {\n <span\n class=\"analytics-presentation__projection-fallback\"\n data-testid=\"projection-family-fallback-badge\"\n >\n {{ option.fallbackLabel }}\n </span>\n }\n </button>\n }\n </div>\n }\n\n @if (showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__toolbar\" role=\"group\" [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.selectorLabel', 'Analytics presentation')\">\n @if (eligibleFamilies().includes('chart')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'chart'\" (click)=\"selectFamily('chart')\">\n <mat-icon praxisIcon=\"bar_chart\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.chart', 'Chart') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('analytic-table')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'analytic-table'\" (click)=\"selectFamily('analytic-table')\">\n <mat-icon praxisIcon=\"table_view\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.table', 'Table') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('kpi')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'kpi'\" (click)=\"selectFamily('kpi')\">\n <mat-icon praxisIcon=\"monitoring\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.kpi', 'KPI') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('summary-list')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'summary-list'\" (click)=\"selectFamily('summary-list')\">\n <mat-icon praxisIcon=\"format_list_bulleted\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.summaryList', 'Summary list') }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hydrationLoading() && !effectiveAnalytics()) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\">\n <span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span>\n </section>\n } @else if (diagnostic(); as message) {\n <section class=\"analytics-presentation__state analytics-presentation__state--error\" role=\"alert\">\n <strong>{{ t('praxis.charts.analyticsPresentation.unavailable', 'Presentation unavailable') }}</strong>\n <span>{{ message }}</span>\n </section>\n } @else if (activeFamily() === 'chart' && chartConfig(); as config) {\n <praxis-chart\n [config]=\"config\"\n [queryContext]=\"queryContext()\"\n [remoteDataResolver]=\"chartRemoteDataResolver()\"\n [dataAlternativeMode]=\"chartDataAlternativeMode()\"\n [externalDataAlternativeLabel]=\"chartExternalTableLabel()\"\n [enableCustomization]=\"enableCustomization()\"\n (pointClick)=\"pointClick.emit($event)\"\n (pointAction)=\"pointAction.emit($event)\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (drillDown)=\"drillDown.emit($event)\"\n (crossFilter)=\"handleChildCrossFilter($event)\"\n (queryRequest)=\"queryRequest.emit($event)\"\n (loadStateChange)=\"loadStateChange.emit($event)\"\n (chartDocumentApplied)=\"handleChildChartDocumentApplied($event)\"\n (chartDocumentSaved)=\"handleChildChartDocumentSaved($event)\"\n (chartDocumentPatchChange)=\"handleChildChartDocumentPatchChange($event)\"\n />\n } @else if (activeFamily() === 'analytic-table' && tableConfig(); as config) {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (isEmbeddedSurface() && !embeddedInShell() && kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <praxis-table\n [config]=\"config\"\n [data]=\"visibleResultRows()\"\n [tableId]=\"(effectiveProjectionId() || 'analytics') + '-analytic-table'\"\n [configPersistenceStrategy]=\"'volatile'\"\n (rowClick)=\"handleTableRowClick($event)\"\n />\n }\n } @else if (activeFamily() === 'kpi') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__kpi\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.kpiCollection', 'Key metrics')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <div class=\"analytics-presentation__kpi-grid\" role=\"list\">\n @for (item of kpiItems(); track item.trackId) {\n <div role=\"listitem\">\n <button\n class=\"analytics-presentation__kpi-card\"\n type=\"button\"\n [class.analytics-presentation__kpi-card--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__kpi-headline\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n <span>{{ item.label }}</span>\n <small>{{ item.metricLabel }}</small>\n <praxis-micro-visualization\n class=\"analytics-presentation__kpi-viz\"\n [visualization]=\"item.microVisualization\"\n [interactiveContainer]=\"true\"\n />\n </button>\n </div>\n }\n </div>\n </section>\n }\n } @else if (activeFamily() === 'summary-list') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__summary\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.summaryList', 'Summary list')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <ul class=\"analytics-presentation__summary-list\">\n @for (item of summaryListItems(); track item.trackId) {\n <li class=\"analytics-presentation__summary-item\">\n <button\n type=\"button\"\n class=\"analytics-presentation__summary-row\"\n [class.analytics-presentation__summary-row--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__summary-row-top\">\n <span class=\"analytics-presentation__summary-label\">{{ item.label }}</span>\n <div class=\"analytics-presentation__summary-values\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n </div>\n <div class=\"analytics-presentation__summary-track\" aria-hidden=\"true\">\n <span class=\"analytics-presentation__summary-fill\" [style.width.%]=\"item.sharePercent\"></span>\n </div>\n <small class=\"analytics-presentation__summary-meta\">{{ item.metricLabel }}</small>\n </button>\n </li>\n }\n </ul>\n </section>\n }\n }\n</section>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.analytics-presentation{display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%;gap:12px}.analytics-presentation--refreshing .analytics-presentation__kpi,.analytics-presentation--refreshing .analytics-presentation__summary,.analytics-presentation--refreshing praxis-table{opacity:.78;transition:opacity .15s ease}.analytics-presentation__controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.analytics-presentation__projections{display:flex;flex-wrap:wrap;gap:4px}.analytics-presentation__projection-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;max-width:100%;min-width:0;padding:6px 12px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:999px;background:var(--md-sys-color-surface-container-low, var(--mat-sys-surface-container-low));color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;font-size:.875rem;line-height:1.25;cursor:pointer}.analytics-presentation__projection-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.analytics-presentation__projection-btn--fallback{border-style:dashed}.analytics-presentation__projection-families{display:inline-flex;align-items:center;gap:2px;opacity:.82}.analytics-presentation__projection-family-icon{width:14px;height:14px;font-size:14px;line-height:14px}.analytics-presentation__projection-fallback{padding:1px 6px;border-radius:999px;font-size:.72rem;font-weight:600;background:color-mix(in srgb,var(--praxis-warning, #92400e) 16%,transparent);color:var(--md-sys-color-on-surface, #1a1c1e)}.analytics-presentation__projection-btn[aria-pressed=true]{border-color:var(--md-sys-color-secondary, #0f766e);background:var(--md-sys-color-secondary-container, #d1fae5);color:var(--md-sys-color-on-secondary-container, #064e3b);font-weight:600}.analytics-presentation__projection-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__toolbar{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-left:auto;gap:2px;padding:2px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:10px;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container, #f0f1f3))}.analytics-presentation__toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--md-sys-color-on-surface-variant, #44474e);font:inherit;font-size:.8125rem;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color .14s ease,color .14s ease,box-shadow .14s ease}.analytics-presentation__toolbar button mat-icon{width:16px;height:16px;font-size:16px;line-height:16px;flex-shrink:0}.analytics-presentation__toolbar button:hover:not([aria-pressed=true]){color:var(--md-sys-color-on-surface, #1a1c1e);background:color-mix(in srgb,var(--md-sys-color-on-surface, #1a1c1e) 6%,transparent)}.analytics-presentation__toolbar button[aria-pressed=true]{background:var(--md-sys-color-primary-container, #d7e3ff);color:var(--md-sys-color-on-primary-container, #001b3e);font-weight:600;box-shadow:0 1px 2px color-mix(in srgb,var(--md-sys-color-shadow, #000) 10%,transparent)}.analytics-presentation__toolbar button:focus-visible{outline:2px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 55%,transparent);outline-offset:1px}@media(pointer:coarse){.analytics-presentation__toolbar button{min-height:36px;padding:0 12px}}.analytics-presentation__state{min-height:220px;display:grid;place-content:center;gap:6px;padding:24px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);text-align:center}.analytics-presentation__state--error{border-color:var(--md-sys-color-error, #ba1a1a);color:var(--md-sys-color-error, #ba1a1a)}.analytics-presentation__loading-label{font-weight:600;background-image:var(--pdx-text-shimmer-gradient, linear-gradient(105deg, var(--md-sys-color-on-surface-variant, #44474e) 0%, var(--md-sys-color-on-surface-variant, #44474e) 28%, var(--md-sys-color-primary, #1263b4) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--md-sys-color-on-surface-variant, #44474e) 72%, var(--md-sys-color-on-surface-variant, #44474e) 100%));background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-analytics-loading-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.analytics-presentation__loading-label{animation:none;background-image:none;color:var(--pdx-text-shimmer-fallback-color, var(--md-sys-color-on-surface, #1a1c1e));-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.analytics-presentation__loading-label{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}@keyframes praxis-analytics-loading-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}.analytics-presentation__kpi{display:grid;gap:16px;min-width:0}.analytics-presentation__kpi-header{display:grid;gap:4px}.analytics-presentation__kpi-header h3,.analytics-presentation__kpi-header p{margin:0}.analytics-presentation__kpi-header h3{color:var(--md-sys-color-on-surface, #1a1c1e);font-size:1rem;font-weight:650}.analytics-presentation__kpi-header p{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.875rem}.analytics-presentation__kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr));gap:12px;min-width:0}.analytics-presentation__kpi-card{display:grid;gap:6px;width:100%;height:100%;min-width:0;min-height:132px;align-content:center;padding:18px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__kpi-card:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__kpi-card:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__kpi-card--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__kpi-card strong{overflow-wrap:anywhere;color:var(--md-sys-color-primary, #1263b4);font-size:clamp(1.75rem,5vw,2.5rem);font-variant-numeric:tabular-nums;line-height:1}.analytics-presentation__kpi-card span,.analytics-presentation__kpi-card small{overflow-wrap:anywhere}.analytics-presentation__kpi-card span{font-weight:600}.analytics-presentation__kpi-card small{color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__kpi-headline{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__kpi-viz{display:block;margin-top:6px}.analytics-presentation__delta-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.75rem;font-weight:600;font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 18%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__delta-badge[data-tone=success]{background:color-mix(in srgb,var(--praxis-success, var(--ready, #1b7a43)) 16%,transparent);color:var(--praxis-success, var(--ready, #1b7a43))}.analytics-presentation__delta-badge[data-tone=danger]{background:color-mix(in srgb,var(--destructive, var(--md-sys-color-error, #c62828)) 16%,transparent);color:var(--destructive, var(--md-sys-color-error, #c62828))}.analytics-presentation__summary{display:grid;gap:12px;min-width:0}.analytics-presentation__summary-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}.analytics-presentation__summary-item{margin:0;padding:0}.analytics-presentation__summary-row{width:100%;display:grid;gap:6px;padding:12px 14px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:12px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__summary-row:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__summary-row:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__summary-row--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__state--suppressed{display:grid;gap:6px;background:color-mix(in srgb,var(--md-sys-color-secondary-container, #dbeafe) 22%,transparent)}.analytics-presentation__privacy-badge{display:inline-flex;align-items:center;width:fit-content;max-width:100%;padding:4px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline, #94a3b8) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, #eef2f6) 80%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem;line-height:1.3}.analytics-presentation__summary-row-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__summary-label{font-weight:600;overflow-wrap:anywhere}.analytics-presentation__summary-values{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}.analytics-presentation__summary-track{height:6px;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 28%,transparent)}.analytics-presentation__summary-fill{display:block;height:100%;border-radius:inherit;background:var(--md-sys-color-primary, #1263b4)}.analytics-presentation__summary-meta{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem}@media(max-width:600px){.analytics-presentation__controls{flex-direction:column;align-items:stretch}.analytics-presentation__toolbar{margin-left:0;justify-content:stretch}.analytics-presentation__toolbar button,.analytics-presentation__projection-btn{flex:1 1 0}}:host-context(.pdx-shell:not(.no-shell)) .analytics-presentation{border:var(--praxis-analytics-shell-border, 0);border-radius:var(--praxis-analytics-shell-radius, 0);box-shadow:var(--praxis-analytics-shell-shadow, none);background:var(--praxis-analytics-shell-bg, transparent);padding:var(--praxis-analytics-shell-padding, 0)}@media(forced-colors:active){.analytics-presentation__toolbar button[aria-pressed=true],.analytics-presentation__projection-btn[aria-pressed=true],.analytics-presentation__kpi-card--selected,.analytics-presentation__summary-row--selected{forced-color-adjust:auto;border-color:Highlight;outline:2px solid Highlight;outline-offset:-2px}}@media print{.analytics-presentation__controls{display:none}}\n"], dependencies: [{ kind: "component", type: PraxisChartComponent, selector: "praxis-chart", inputs: ["config", "resourceKey", "data", "chartDocument", "filterCriteria", "queryContext", "remoteDataResolver", "dataAlternativeMode", "externalDataAlternativeLabel", "enableCustomization", "availableResources", "availableFields", "availableTargets", "epistemicBadgeVariant"], outputs: ["pointClick", "pointAction", "selectionChange", "drillDown", "crossFilter", "queryRequest", "loadStateChange", "chartDocumentApplied", "chartDocumentSaved", "chartDocumentPatchChange", "brushSelect", "timelineChange"] }, { kind: "component", type: PraxisTable, selector: "praxis-table", inputs: ["config", "resourcePath", "collectionSurface", "data", "tableId", "componentInstanceId", "configPersistenceStrategy", "title", "subtitle", "icon", "autoDelete", "notifyIfOutdated", "snoozeMs", "autoOpenSettingsOnOutdated", "crudContext", "filterCriteria", "hostOwnsDefaultQuickFilter", "filterTeleport", "widgetId", "queryContext", "lockedFilterFields", "aiContext", "aiAssistantVoiceInputMode", "aiAssistantVoiceLanguage", "horizontalScroll", "enableCustomization", "authoringCapability", "dense"], outputs: ["filterCriteriaChange", "discoveredQuickFiltersChange", "discoveredResourceFactsChange", "discoveredInlineFilterFieldsChange", "queryContextClear", "queryContextChange", "rowClick", "widgetEvent", "resourceEvent", "rowDoubleClick", "rowExpansionChange", "rowAction", "toolbarAction", "bulkAction", "exportAction", "columnReorder", "columnReorderAttempt", "columnResize", "beforeDelete", "afterDelete", "deleteError", "beforeBulkDelete", "afterBulkDelete", "bulkDeleteError", "schemaStatusChange", "configChange", "metadataChange", "loadingStateChange", "collectionLinksChange", "selectionChange", "drawerOpen", "drawerClose", "drawerTabChange"] }, { kind: "component", type: PraxisMicroVisualizationComponent, selector: "praxis-micro-visualization", inputs: ["visualization", "fallbackText", "interactiveContainer", "formatValue", "locale", "idPrefix", "disableTooltip"], outputs: ["segmentActivate"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16179
16982
|
}
|
|
16180
16983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisAnalyticsPresentationComponent, decorators: [{
|
|
16181
16984
|
type: Component,
|
|
@@ -16184,7 +16987,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
16184
16987
|
provide: PRAXIS_WIDGET_SHELL_ACTION_CONTRIBUTOR,
|
|
16185
16988
|
useExisting: forwardRef(() => PraxisAnalyticsPresentationComponent),
|
|
16186
16989
|
},
|
|
16187
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n class=\"analytics-presentation\"\n [class.analytics-presentation--refreshing]=\"isResultLoading() && visibleResultRows().length > 0\"\n [attr.aria-busy]=\"isResultLoading() ? 'true' : null\"\n [attr.aria-label]=\"effectiveProjectionId() || resourcePath() || 'analytics'\"\n>\n @if (availableProjections().length > 1 || showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__controls\">\n @if (projectionSelectorItems().length > 1 || (availableProjections().length > 1 && projectionSelectorItems().length > 0)) {\n <div\n class=\"analytics-presentation__projections\"\n role=\"group\"\n [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.projectionSelectorLabel', 'Analytics projection')\"\n >\n @for (option of projectionSelectorItems(); track option.projection.id) {\n <button\n type=\"button\"\n class=\"analytics-presentation__projection-btn\"\n [class.analytics-presentation__projection-btn--fallback]=\"showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily\"\n [attr.data-testid]=\"'projection-option-' + option.projection.id\"\n [attr.data-eligible-families]=\"option.eligibleFamilies.join(',')\"\n [attr.data-active-family-compatible]=\"option.compatibleWithActiveFamily ? 'true' : 'false'\"\n [attr.aria-pressed]=\"option.selected\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.title]=\"option.tooltip\"\n (click)=\"selectProjection(option.projection.id)\"\n >\n <span class=\"analytics-presentation__projection-label\">{{ option.label }}</span>\n @if (showProjectionFamilyIndicators() && option.eligibleBadges.length > 0) {\n <span\n class=\"analytics-presentation__projection-families\"\n data-testid=\"projection-family-indicators\"\n aria-hidden=\"true\"\n >\n @for (badge of option.eligibleBadges; track badge.family) {\n <mat-icon\n class=\"analytics-presentation__projection-family-icon\"\n [attr.data-family]=\"badge.family\"\n [praxisIcon]=\"badge.icon\"\n ></mat-icon>\n }\n </span>\n }\n @if (showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily && option.fallbackLabel) {\n <span\n class=\"analytics-presentation__projection-fallback\"\n data-testid=\"projection-family-fallback-badge\"\n >\n {{ option.fallbackLabel }}\n </span>\n }\n </button>\n }\n </div>\n }\n\n @if (showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__toolbar\" role=\"group\" [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.selectorLabel', 'Analytics presentation')\">\n @if (eligibleFamilies().includes('chart')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'chart'\" (click)=\"selectFamily('chart')\">\n <mat-icon praxisIcon=\"bar_chart\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.chart', 'Chart') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('analytic-table')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'analytic-table'\" (click)=\"selectFamily('analytic-table')\">\n <mat-icon praxisIcon=\"table_view\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.table', 'Table') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('kpi')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'kpi'\" (click)=\"selectFamily('kpi')\">\n <mat-icon praxisIcon=\"monitoring\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.kpi', 'KPI') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('summary-list')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'summary-list'\" (click)=\"selectFamily('summary-list')\">\n <mat-icon praxisIcon=\"format_list_bulleted\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.summaryList', 'Summary list') }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hydrationLoading() && !effectiveAnalytics()) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\">\n <span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span>\n </section>\n } @else if (diagnostic(); as message) {\n <section class=\"analytics-presentation__state analytics-presentation__state--error\" role=\"alert\">\n <strong>{{ t('praxis.charts.analyticsPresentation.unavailable', 'Presentation unavailable') }}</strong>\n <span>{{ message }}</span>\n </section>\n } @else if (activeFamily() === 'chart' && chartConfig(); as config) {\n <praxis-chart\n [config]=\"config\"\n [queryContext]=\"queryContext()\"\n [remoteDataResolver]=\"chartRemoteDataResolver()\"\n [dataAlternativeMode]=\"chartDataAlternativeMode()\"\n [externalDataAlternativeLabel]=\"chartExternalTableLabel()\"\n [enableCustomization]=\"enableCustomization()\"\n (pointClick)=\"pointClick.emit($event)\"\n (pointAction)=\"pointAction.emit($event)\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (drillDown)=\"drillDown.emit($event)\"\n (crossFilter)=\"handleChildCrossFilter($event)\"\n (queryRequest)=\"queryRequest.emit($event)\"\n (loadStateChange)=\"loadStateChange.emit($event)\"\n (chartDocumentApplied)=\"handleChildChartDocumentApplied($event)\"\n (chartDocumentSaved)=\"handleChildChartDocumentSaved($event)\"\n (chartDocumentPatchChange)=\"handleChildChartDocumentPatchChange($event)\"\n />\n } @else if (activeFamily() === 'analytic-table' && tableConfig(); as config) {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (isEmbeddedSurface() && !embeddedInShell() && kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <praxis-table\n [config]=\"config\"\n [data]=\"visibleResultRows()\"\n [tableId]=\"(effectiveProjectionId() || 'analytics') + '-analytic-table'\"\n [configPersistenceStrategy]=\"'volatile'\"\n (rowClick)=\"handleTableRowClick($event)\"\n />\n }\n } @else if (activeFamily() === 'kpi') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__kpi\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.kpiCollection', 'Key metrics')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <div class=\"analytics-presentation__kpi-grid\" role=\"list\">\n @for (item of kpiItems(); track item.trackId) {\n <div role=\"listitem\">\n <button\n class=\"analytics-presentation__kpi-card\"\n type=\"button\"\n [class.analytics-presentation__kpi-card--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__kpi-headline\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n <span>{{ item.label }}</span>\n <small>{{ item.metricLabel }}</small>\n <praxis-micro-visualization\n class=\"analytics-presentation__kpi-viz\"\n [visualization]=\"item.microVisualization\"\n [interactiveContainer]=\"true\"\n />\n </button>\n </div>\n }\n </div>\n </section>\n }\n } @else if (activeFamily() === 'summary-list') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__summary\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.summaryList', 'Summary list')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <ul class=\"analytics-presentation__summary-list\">\n @for (item of summaryListItems(); track item.trackId) {\n <li class=\"analytics-presentation__summary-item\">\n <button\n type=\"button\"\n class=\"analytics-presentation__summary-row\"\n [class.analytics-presentation__summary-row--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__summary-row-top\">\n <span class=\"analytics-presentation__summary-label\">{{ item.label }}</span>\n <div class=\"analytics-presentation__summary-values\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n </div>\n <div class=\"analytics-presentation__summary-track\" aria-hidden=\"true\">\n <span class=\"analytics-presentation__summary-fill\" [style.width.%]=\"item.sharePercent\"></span>\n </div>\n <small class=\"analytics-presentation__summary-meta\">{{ item.metricLabel }}</small>\n </button>\n </li>\n }\n </ul>\n </section>\n }\n }\n</section>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.analytics-presentation{display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%;gap:12px}.analytics-presentation--refreshing .analytics-presentation__kpi,.analytics-presentation--refreshing .analytics-presentation__summary,.analytics-presentation--refreshing praxis-table{opacity:.78;transition:opacity .15s ease}.analytics-presentation__controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.analytics-presentation__projections{display:flex;flex-wrap:wrap;gap:4px}.analytics-presentation__projection-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:999px;background:var(--md-sys-color-surface-container-low, var(--mat-sys-surface-container-low));color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;font-size:.875rem;cursor:pointer}.analytics-presentation__projection-btn--fallback{border-style:dashed}.analytics-presentation__projection-families{display:inline-flex;align-items:center;gap:2px;opacity:.82}.analytics-presentation__projection-family-icon{width:14px;height:14px;font-size:14px;line-height:14px}.analytics-presentation__projection-fallback{padding:1px 6px;border-radius:999px;font-size:.72rem;font-weight:600;background:color-mix(in srgb,var(--praxis-warning, #92400e) 16%,transparent);color:var(--md-sys-color-on-surface, #1a1c1e)}.analytics-presentation__projection-btn[aria-pressed=true]{border-color:var(--md-sys-color-secondary, #0f766e);background:var(--md-sys-color-secondary-container, #d1fae5);color:var(--md-sys-color-on-secondary-container, #064e3b);font-weight:600}.analytics-presentation__projection-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__toolbar{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-left:auto;gap:2px;padding:2px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:10px;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container, #f0f1f3))}.analytics-presentation__toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--md-sys-color-on-surface-variant, #44474e);font:inherit;font-size:.8125rem;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color .14s ease,color .14s ease,box-shadow .14s ease}.analytics-presentation__toolbar button mat-icon{width:16px;height:16px;font-size:16px;line-height:16px;flex-shrink:0}.analytics-presentation__toolbar button:hover:not([aria-pressed=true]){color:var(--md-sys-color-on-surface, #1a1c1e);background:color-mix(in srgb,var(--md-sys-color-on-surface, #1a1c1e) 6%,transparent)}.analytics-presentation__toolbar button[aria-pressed=true]{background:var(--md-sys-color-primary-container, #d7e3ff);color:var(--md-sys-color-on-primary-container, #001b3e);font-weight:600;box-shadow:0 1px 2px color-mix(in srgb,var(--md-sys-color-shadow, #000) 10%,transparent)}.analytics-presentation__toolbar button:focus-visible{outline:2px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 55%,transparent);outline-offset:1px}@media(pointer:coarse){.analytics-presentation__toolbar button{min-height:36px;padding:0 12px}}.analytics-presentation__state{min-height:220px;display:grid;place-content:center;gap:6px;padding:24px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);text-align:center}.analytics-presentation__state--error{border-color:var(--md-sys-color-error, #ba1a1a);color:var(--md-sys-color-error, #ba1a1a)}.analytics-presentation__loading-label{font-weight:600;background-image:var(--pdx-text-shimmer-gradient, linear-gradient(105deg, var(--md-sys-color-on-surface-variant, #44474e) 0%, var(--md-sys-color-on-surface-variant, #44474e) 28%, var(--md-sys-color-primary, #1263b4) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--md-sys-color-on-surface-variant, #44474e) 72%, var(--md-sys-color-on-surface-variant, #44474e) 100%));background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-analytics-loading-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.analytics-presentation__loading-label{animation:none;background-image:none;color:var(--pdx-text-shimmer-fallback-color, var(--md-sys-color-on-surface, #1a1c1e));-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.analytics-presentation__loading-label{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}@keyframes praxis-analytics-loading-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}.analytics-presentation__kpi{display:grid;gap:16px;min-width:0}.analytics-presentation__kpi-header{display:grid;gap:4px}.analytics-presentation__kpi-header h3,.analytics-presentation__kpi-header p{margin:0}.analytics-presentation__kpi-header h3{color:var(--md-sys-color-on-surface, #1a1c1e);font-size:1rem;font-weight:650}.analytics-presentation__kpi-header p{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.875rem}.analytics-presentation__kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr));gap:12px;min-width:0}.analytics-presentation__kpi-card{display:grid;gap:6px;width:100%;height:100%;min-width:0;min-height:132px;align-content:center;padding:18px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__kpi-card:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__kpi-card:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__kpi-card--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__kpi-card strong{overflow-wrap:anywhere;color:var(--md-sys-color-primary, #1263b4);font-size:clamp(1.75rem,5vw,2.5rem);font-variant-numeric:tabular-nums;line-height:1}.analytics-presentation__kpi-card span,.analytics-presentation__kpi-card small{overflow-wrap:anywhere}.analytics-presentation__kpi-card span{font-weight:600}.analytics-presentation__kpi-card small{color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__kpi-headline{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__kpi-viz{display:block;margin-top:6px}.analytics-presentation__delta-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.75rem;font-weight:600;font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 18%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__delta-badge[data-tone=success]{background:color-mix(in srgb,var(--praxis-success, var(--ready, #1b7a43)) 16%,transparent);color:var(--praxis-success, var(--ready, #1b7a43))}.analytics-presentation__delta-badge[data-tone=danger]{background:color-mix(in srgb,var(--destructive, var(--md-sys-color-error, #c62828)) 16%,transparent);color:var(--destructive, var(--md-sys-color-error, #c62828))}.analytics-presentation__summary{display:grid;gap:12px;min-width:0}.analytics-presentation__summary-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}.analytics-presentation__summary-item{margin:0;padding:0}.analytics-presentation__summary-row{width:100%;display:grid;gap:6px;padding:12px 14px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:12px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__summary-row:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__summary-row:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__summary-row--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__state--suppressed{display:grid;gap:6px;background:color-mix(in srgb,var(--md-sys-color-secondary-container, #dbeafe) 22%,transparent)}.analytics-presentation__privacy-badge{display:inline-flex;align-items:center;width:fit-content;max-width:100%;padding:4px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline, #94a3b8) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, #eef2f6) 80%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem;line-height:1.3}.analytics-presentation__summary-row-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__summary-label{font-weight:600;overflow-wrap:anywhere}.analytics-presentation__summary-values{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}.analytics-presentation__summary-track{height:6px;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 28%,transparent)}.analytics-presentation__summary-fill{display:block;height:100%;border-radius:inherit;background:var(--md-sys-color-primary, #1263b4)}.analytics-presentation__summary-meta{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem}@media(max-width:600px){.analytics-presentation__controls{flex-direction:column;align-items:stretch}.analytics-presentation__toolbar{margin-left:0;justify-content:stretch}.analytics-presentation__toolbar button,.analytics-presentation__projection-btn{flex:1 1 0}}:host-context(.pdx-shell:not(.no-shell)) .analytics-presentation{border:var(--praxis-analytics-shell-border, 0);border-radius:var(--praxis-analytics-shell-radius, 0);box-shadow:var(--praxis-analytics-shell-shadow, none);background:var(--praxis-analytics-shell-bg, transparent);padding:var(--praxis-analytics-shell-padding, 0)}@media(forced-colors:active){.analytics-presentation__toolbar button[aria-pressed=true],.analytics-presentation__projection-btn[aria-pressed=true],.analytics-presentation__kpi-card--selected,.analytics-presentation__summary-row--selected{forced-color-adjust:auto;border-color:Highlight;outline:2px solid Highlight;outline-offset:-2px}}@media print{.analytics-presentation__controls{display:none}}\n"] }]
|
|
16990
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n class=\"analytics-presentation\"\n [class.analytics-presentation--refreshing]=\"isResultLoading() && visibleResultRows().length > 0\"\n [attr.aria-busy]=\"isResultLoading() ? 'true' : null\"\n [attr.aria-label]=\"effectiveProjectionId() || resourcePath() || 'analytics'\"\n>\n @if (availableProjections().length > 1 || showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__controls\">\n @if (projectionSelectorItems().length > 1 || (availableProjections().length > 1 && projectionSelectorItems().length > 0)) {\n <div\n class=\"analytics-presentation__projections\"\n role=\"group\"\n [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.projectionSelectorLabel', 'Analytics projection')\"\n >\n @for (option of projectionSelectorItems(); track option.projection.id) {\n <button\n type=\"button\"\n class=\"analytics-presentation__projection-btn\"\n [class.analytics-presentation__projection-btn--fallback]=\"showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily\"\n [attr.data-testid]=\"'projection-option-' + option.projection.id\"\n [attr.data-eligible-families]=\"option.eligibleFamilies.join(',')\"\n [attr.data-active-family-compatible]=\"option.compatibleWithActiveFamily ? 'true' : 'false'\"\n [attr.aria-pressed]=\"option.selected\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.title]=\"option.tooltip\"\n (click)=\"selectProjection(option.projection.id)\"\n >\n <span class=\"analytics-presentation__projection-label\" [attr.title]=\"option.label\">{{ option.label }}</span>\n @if (showProjectionFamilyIndicators() && option.eligibleBadges.length > 0) {\n <span\n class=\"analytics-presentation__projection-families\"\n data-testid=\"projection-family-indicators\"\n aria-hidden=\"true\"\n >\n @for (badge of option.eligibleBadges; track badge.family) {\n <mat-icon\n class=\"analytics-presentation__projection-family-icon\"\n [attr.data-family]=\"badge.family\"\n [praxisIcon]=\"badge.icon\"\n ></mat-icon>\n }\n </span>\n }\n @if (showProjectionFamilyIndicators() && !option.compatibleWithActiveFamily && option.fallbackLabel) {\n <span\n class=\"analytics-presentation__projection-fallback\"\n data-testid=\"projection-family-fallback-badge\"\n >\n {{ option.fallbackLabel }}\n </span>\n }\n </button>\n }\n </div>\n }\n\n @if (showInlineFamilyToolbar()) {\n <div class=\"analytics-presentation__toolbar\" role=\"group\" [attr.aria-label]=\"t('praxis.charts.analyticsPresentation.selectorLabel', 'Analytics presentation')\">\n @if (eligibleFamilies().includes('chart')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'chart'\" (click)=\"selectFamily('chart')\">\n <mat-icon praxisIcon=\"bar_chart\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.chart', 'Chart') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('analytic-table')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'analytic-table'\" (click)=\"selectFamily('analytic-table')\">\n <mat-icon praxisIcon=\"table_view\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.table', 'Table') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('kpi')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'kpi'\" (click)=\"selectFamily('kpi')\">\n <mat-icon praxisIcon=\"monitoring\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.kpi', 'KPI') }}</span>\n </button>\n }\n @if (eligibleFamilies().includes('summary-list')) {\n <button type=\"button\" [attr.aria-pressed]=\"activeFamily() === 'summary-list'\" (click)=\"selectFamily('summary-list')\">\n <mat-icon praxisIcon=\"format_list_bulleted\" aria-hidden=\"true\"></mat-icon>\n <span>{{ t('praxis.charts.analyticsPresentation.summaryList', 'Summary list') }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (hydrationLoading() && !effectiveAnalytics()) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\">\n <span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span>\n </section>\n } @else if (diagnostic(); as message) {\n <section class=\"analytics-presentation__state analytics-presentation__state--error\" role=\"alert\">\n <strong>{{ t('praxis.charts.analyticsPresentation.unavailable', 'Presentation unavailable') }}</strong>\n <span>{{ message }}</span>\n </section>\n } @else if (activeFamily() === 'chart' && chartConfig(); as config) {\n <praxis-chart\n [config]=\"config\"\n [queryContext]=\"queryContext()\"\n [remoteDataResolver]=\"chartRemoteDataResolver()\"\n [dataAlternativeMode]=\"chartDataAlternativeMode()\"\n [externalDataAlternativeLabel]=\"chartExternalTableLabel()\"\n [enableCustomization]=\"enableCustomization()\"\n (pointClick)=\"pointClick.emit($event)\"\n (pointAction)=\"pointAction.emit($event)\"\n (selectionChange)=\"selectionChange.emit($event)\"\n (drillDown)=\"drillDown.emit($event)\"\n (crossFilter)=\"handleChildCrossFilter($event)\"\n (queryRequest)=\"queryRequest.emit($event)\"\n (loadStateChange)=\"loadStateChange.emit($event)\"\n (chartDocumentApplied)=\"handleChildChartDocumentApplied($event)\"\n (chartDocumentSaved)=\"handleChildChartDocumentSaved($event)\"\n (chartDocumentPatchChange)=\"handleChildChartDocumentPatchChange($event)\"\n />\n } @else if (activeFamily() === 'analytic-table' && tableConfig(); as config) {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (isEmbeddedSurface() && !embeddedInShell() && kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <praxis-table\n [config]=\"config\"\n [data]=\"visibleResultRows()\"\n [tableId]=\"(effectiveProjectionId() || 'analytics') + '-analytic-table'\"\n [configPersistenceStrategy]=\"'volatile'\"\n (rowClick)=\"handleTableRowClick($event)\"\n />\n }\n } @else if (activeFamily() === 'kpi') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__kpi\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.kpiCollection', 'Key metrics')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <div class=\"analytics-presentation__kpi-grid\" role=\"list\">\n @for (item of kpiItems(); track item.trackId) {\n <div role=\"listitem\">\n <button\n class=\"analytics-presentation__kpi-card\"\n type=\"button\"\n [class.analytics-presentation__kpi-card--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__kpi-headline\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n <span>{{ item.label }}</span>\n <small>{{ item.metricLabel }}</small>\n <praxis-micro-visualization\n class=\"analytics-presentation__kpi-viz\"\n [visualization]=\"item.microVisualization\"\n [interactiveContainer]=\"true\"\n />\n </button>\n </div>\n }\n </div>\n </section>\n }\n } @else if (activeFamily() === 'summary-list') {\n @if (isResultLoading() && visibleResultRows().length === 0) {\n <section class=\"analytics-presentation__state analytics-presentation__state--loading\" role=\"status\"><span class=\"analytics-presentation__loading-label\">{{ t('praxis.charts.analyticsPresentation.loading', 'Loading analytics\u2026') }}</span></section>\n } @else if (isResultEmpty()) {\n <section class=\"analytics-presentation__state\" [class.analytics-presentation__state--suppressed]=\"isResultSuppressed()\" [attr.data-privacy-suppressed]=\"isResultSuppressed() ? 'true' : null\" role=\"status\">\n <strong>{{ emptyStateTitle() }}</strong>\n @if (emptyStateDescription(); as privacyDescription) {\n <span>{{ privacyDescription }}</span>\n }\n </section>\n } @else {\n @if (privacySuppressedNotice(); as privacyNotice) {\n <div class=\"analytics-presentation__privacy-badge\" data-testid=\"analytics-presentation-privacy-notice\" role=\"status\">\n {{ privacyNotice }}\n </div>\n }\n <section class=\"analytics-presentation__summary\" [attr.aria-label]=\"kpiTitle() || t('praxis.charts.analyticsPresentation.summaryList', 'Summary list')\">\n @if (kpiTitle(); as heading) {\n <header class=\"analytics-presentation__kpi-header\">\n <h3>{{ heading }}</h3>\n @if (kpiSubtitle(); as description) {\n <p>{{ description }}</p>\n }\n </header>\n }\n <ul class=\"analytics-presentation__summary-list\">\n @for (item of summaryListItems(); track item.trackId) {\n <li class=\"analytics-presentation__summary-item\">\n <button\n type=\"button\"\n class=\"analytics-presentation__summary-row\"\n [class.analytics-presentation__summary-row--selected]=\"isRowCrossFilterSelected(item.row, item.label) === 'true'\"\n [attr.aria-pressed]=\"isRowCrossFilterSelected(item.row, item.label)\"\n [attr.aria-label]=\"kpiItemAriaLabel(item.label, item.formattedValue, item.metricLabel)\"\n (click)=\"handleKpiClick(item.row, item.label, item.value)\"\n >\n <div class=\"analytics-presentation__summary-row-top\">\n <span class=\"analytics-presentation__summary-label\">{{ item.label }}</span>\n <div class=\"analytics-presentation__summary-values\">\n <strong>{{ item.formattedValue }}</strong>\n @if (item.deltaText) {\n <span\n class=\"analytics-presentation__delta-badge\"\n [attr.data-tone]=\"item.deltaTone\"\n >{{ item.deltaText }}</span>\n }\n </div>\n </div>\n <div class=\"analytics-presentation__summary-track\" aria-hidden=\"true\">\n <span class=\"analytics-presentation__summary-fill\" [style.width.%]=\"item.sharePercent\"></span>\n </div>\n <small class=\"analytics-presentation__summary-meta\">{{ item.metricLabel }}</small>\n </button>\n </li>\n }\n </ul>\n </section>\n }\n }\n</section>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.analytics-presentation{display:grid;grid-template-columns:minmax(0,1fr);width:100%;min-width:0;max-width:100%;gap:12px}.analytics-presentation--refreshing .analytics-presentation__kpi,.analytics-presentation--refreshing .analytics-presentation__summary,.analytics-presentation--refreshing praxis-table{opacity:.78;transition:opacity .15s ease}.analytics-presentation__controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.analytics-presentation__projections{display:flex;flex-wrap:wrap;gap:4px}.analytics-presentation__projection-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;max-width:100%;min-width:0;padding:6px 12px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:999px;background:var(--md-sys-color-surface-container-low, var(--mat-sys-surface-container-low));color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;font-size:.875rem;line-height:1.25;cursor:pointer}.analytics-presentation__projection-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.analytics-presentation__projection-btn--fallback{border-style:dashed}.analytics-presentation__projection-families{display:inline-flex;align-items:center;gap:2px;opacity:.82}.analytics-presentation__projection-family-icon{width:14px;height:14px;font-size:14px;line-height:14px}.analytics-presentation__projection-fallback{padding:1px 6px;border-radius:999px;font-size:.72rem;font-weight:600;background:color-mix(in srgb,var(--praxis-warning, #92400e) 16%,transparent);color:var(--md-sys-color-on-surface, #1a1c1e)}.analytics-presentation__projection-btn[aria-pressed=true]{border-color:var(--md-sys-color-secondary, #0f766e);background:var(--md-sys-color-secondary-container, #d1fae5);color:var(--md-sys-color-on-secondary-container, #064e3b);font-weight:600}.analytics-presentation__projection-btn:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__toolbar{display:inline-flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-left:auto;gap:2px;padding:2px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:10px;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container, #f0f1f3))}.analytics-presentation__toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:0 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--md-sys-color-on-surface-variant, #44474e);font:inherit;font-size:.8125rem;font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;transition:background-color .14s ease,color .14s ease,box-shadow .14s ease}.analytics-presentation__toolbar button mat-icon{width:16px;height:16px;font-size:16px;line-height:16px;flex-shrink:0}.analytics-presentation__toolbar button:hover:not([aria-pressed=true]){color:var(--md-sys-color-on-surface, #1a1c1e);background:color-mix(in srgb,var(--md-sys-color-on-surface, #1a1c1e) 6%,transparent)}.analytics-presentation__toolbar button[aria-pressed=true]{background:var(--md-sys-color-primary-container, #d7e3ff);color:var(--md-sys-color-on-primary-container, #001b3e);font-weight:600;box-shadow:0 1px 2px color-mix(in srgb,var(--md-sys-color-shadow, #000) 10%,transparent)}.analytics-presentation__toolbar button:focus-visible{outline:2px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 55%,transparent);outline-offset:1px}@media(pointer:coarse){.analytics-presentation__toolbar button{min-height:36px;padding:0 12px}}.analytics-presentation__state{min-height:220px;display:grid;place-content:center;gap:6px;padding:24px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);text-align:center}.analytics-presentation__state--error{border-color:var(--md-sys-color-error, #ba1a1a);color:var(--md-sys-color-error, #ba1a1a)}.analytics-presentation__loading-label{font-weight:600;background-image:var(--pdx-text-shimmer-gradient, linear-gradient(105deg, var(--md-sys-color-on-surface-variant, #44474e) 0%, var(--md-sys-color-on-surface-variant, #44474e) 28%, var(--md-sys-color-primary, #1263b4) 44%, var(--md-sys-color-tertiary, #7c3aed) 56%, var(--md-sys-color-on-surface-variant, #44474e) 72%, var(--md-sys-color-on-surface-variant, #44474e) 100%));background-size:260% 100%;background-position:200% 50%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:praxis-analytics-loading-shimmer var(--pdx-text-shimmer-duration, 2.4s) linear infinite}@media(prefers-reduced-motion:reduce),(forced-colors:active),print{.analytics-presentation__loading-label{animation:none;background-image:none;color:var(--pdx-text-shimmer-fallback-color, var(--md-sys-color-on-surface, #1a1c1e));-webkit-text-fill-color:currentColor}}@media(forced-colors:active){.analytics-presentation__loading-label{color:CanvasText!important;-webkit-text-fill-color:CanvasText!important}}@keyframes praxis-analytics-loading-shimmer{0%{background-position:200% 50%}to{background-position:-60% 50%}}.analytics-presentation__kpi{display:grid;gap:16px;min-width:0}.analytics-presentation__kpi-header{display:grid;gap:4px}.analytics-presentation__kpi-header h3,.analytics-presentation__kpi-header p{margin:0}.analytics-presentation__kpi-header h3{color:var(--md-sys-color-on-surface, #1a1c1e);font-size:1rem;font-weight:650}.analytics-presentation__kpi-header p{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.875rem}.analytics-presentation__kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,176px),1fr));gap:12px;min-width:0}.analytics-presentation__kpi-card{display:grid;gap:6px;width:100%;height:100%;min-width:0;min-height:132px;align-content:center;padding:18px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:16px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__kpi-card:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__kpi-card:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__kpi-card--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__kpi-card strong{overflow-wrap:anywhere;color:var(--md-sys-color-primary, #1263b4);font-size:clamp(1.75rem,5vw,2.5rem);font-variant-numeric:tabular-nums;line-height:1}.analytics-presentation__kpi-card span,.analytics-presentation__kpi-card small{overflow-wrap:anywhere}.analytics-presentation__kpi-card span{font-weight:600}.analytics-presentation__kpi-card small{color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__kpi-headline{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__kpi-viz{display:block;margin-top:6px}.analytics-presentation__delta-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:.75rem;font-weight:600;font-variant-numeric:tabular-nums;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 18%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e)}.analytics-presentation__delta-badge[data-tone=success]{background:color-mix(in srgb,var(--praxis-success, var(--ready, #1b7a43)) 16%,transparent);color:var(--praxis-success, var(--ready, #1b7a43))}.analytics-presentation__delta-badge[data-tone=danger]{background:color-mix(in srgb,var(--destructive, var(--md-sys-color-error, #c62828)) 16%,transparent);color:var(--destructive, var(--md-sys-color-error, #c62828))}.analytics-presentation__summary{display:grid;gap:12px;min-width:0}.analytics-presentation__summary-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}.analytics-presentation__summary-item{margin:0;padding:0}.analytics-presentation__summary-row{width:100%;display:grid;gap:6px;padding:12px 14px;border:1px solid var(--md-sys-color-outline-variant, #c4c7c5);border-radius:12px;background:var(--md-sys-color-surface-container-low, #f7f8fa);color:var(--md-sys-color-on-surface, #1a1c1e);font:inherit;text-align:left;cursor:pointer}.analytics-presentation__summary-row:hover{border-color:var(--md-sys-color-primary, #1263b4);background:var(--md-sys-color-surface-container, #f0f1f3)}.analytics-presentation__summary-row:focus-visible{outline:3px solid color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 45%,transparent);outline-offset:2px}.analytics-presentation__summary-row--selected{border-color:var(--md-sys-color-primary, #1263b4);background:color-mix(in srgb,var(--md-sys-color-primary, #1263b4) 10%,var(--md-sys-color-surface-container-low, #f7f8fa))}.analytics-presentation__state--suppressed{display:grid;gap:6px;background:color-mix(in srgb,var(--md-sys-color-secondary-container, #dbeafe) 22%,transparent)}.analytics-presentation__privacy-badge{display:inline-flex;align-items:center;width:fit-content;max-width:100%;padding:4px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline, #94a3b8) 38%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, #eef2f6) 80%,transparent);color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem;line-height:1.3}.analytics-presentation__summary-row-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}.analytics-presentation__summary-label{font-weight:600;overflow-wrap:anywhere}.analytics-presentation__summary-values{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}.analytics-presentation__summary-track{height:6px;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-outline-variant, #94a3b8) 28%,transparent)}.analytics-presentation__summary-fill{display:block;height:100%;border-radius:inherit;background:var(--md-sys-color-primary, #1263b4)}.analytics-presentation__summary-meta{color:var(--md-sys-color-on-surface-variant, #44474e);font-size:.75rem}@media(max-width:600px){.analytics-presentation__controls{flex-direction:column;align-items:stretch}.analytics-presentation__toolbar{margin-left:0;justify-content:stretch}.analytics-presentation__toolbar button,.analytics-presentation__projection-btn{flex:1 1 0}}:host-context(.pdx-shell:not(.no-shell)) .analytics-presentation{border:var(--praxis-analytics-shell-border, 0);border-radius:var(--praxis-analytics-shell-radius, 0);box-shadow:var(--praxis-analytics-shell-shadow, none);background:var(--praxis-analytics-shell-bg, transparent);padding:var(--praxis-analytics-shell-padding, 0)}@media(forced-colors:active){.analytics-presentation__toolbar button[aria-pressed=true],.analytics-presentation__projection-btn[aria-pressed=true],.analytics-presentation__kpi-card--selected,.analytics-presentation__summary-row--selected{forced-color-adjust:auto;border-color:Highlight;outline:2px solid Highlight;outline-offset:-2px}}@media print{.analytics-presentation__controls{display:none}}\n"] }]
|
|
16188
16991
|
}], ctorParameters: () => [], propDecorators: { analytics: [{ type: i0.Input, args: [{ isSignal: true, alias: "analytics", required: false }] }], projectionId: [{ type: i0.Input, args: [{ isSignal: true, alias: "projectionId", required: false }] }], resourcePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourcePath", required: false }] }], filterOperation: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperation", required: false }] }], schemaType: [{ type: i0.Input, args: [{ isSignal: true, alias: "schemaType", required: false }] }], coerceCrossFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "coerceCrossFilters", required: false }] }], availableFamilies: [{ type: i0.Input, args: [{ isSignal: true, alias: "availableFamilies", required: false }] }], preferredFamily: [{ type: i0.Input, args: [{ isSignal: true, alias: "preferredFamily", required: false }] }], queryContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryContext", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], surfaceMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "surfaceMode", required: false }] }], controlsPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlsPlacement", required: false }] }], controlsDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlsDisplay", required: false }] }], enableCustomization: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableCustomization", required: false }] }], chartDocumentOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartDocumentOverrides", required: false }] }], filterProjectionsByFamily: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterProjectionsByFamily", required: false }] }], showProjectionFamilyIndicators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProjectionFamilyIndicators", required: false }] }], analyticsHydrated: [{ type: i0.Output, args: ["analyticsHydrated"] }], presentationChange: [{ type: i0.Output, args: ["presentationChange"] }], projectionChange: [{ type: i0.Output, args: ["projectionChange"] }], chartDocumentApplied: [{ type: i0.Output, args: ["chartDocumentApplied"] }], chartDocumentSaved: [{ type: i0.Output, args: ["chartDocumentSaved"] }], chartDocumentPatchChange: [{ type: i0.Output, args: ["chartDocumentPatchChange"] }], pointClick: [{ type: i0.Output, args: ["pointClick"] }], pointAction: [{ type: i0.Output, args: ["pointAction"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], drillDown: [{ type: i0.Output, args: ["drillDown"] }], crossFilter: [{ type: i0.Output, args: ["crossFilter"] }], queryRequest: [{ type: i0.Output, args: ["queryRequest"] }], loadStateChange: [{ type: i0.Output, args: ["loadStateChange"] }], analyticTable: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PraxisTable), { isSignal: true }] }], childChart: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PraxisChartComponent), { isSignal: true }] }] } });
|
|
16189
16992
|
function stringifyValue(value) {
|
|
16190
16993
|
return value === null || value === undefined ? undefined : String(value);
|
|
@@ -17301,413 +18104,6 @@ function providePraxisAnalyticsCockpitMetadata() {
|
|
|
17301
18104
|
};
|
|
17302
18105
|
}
|
|
17303
18106
|
|
|
17304
|
-
const NON_DIMENSION_TIMESERIES_MSG = undefined;
|
|
17305
|
-
function isEmptyFilterValue(value) {
|
|
17306
|
-
if (value === undefined || value === null || value === '') {
|
|
17307
|
-
return true;
|
|
17308
|
-
}
|
|
17309
|
-
if (Array.isArray(value)) {
|
|
17310
|
-
return value.length === 0;
|
|
17311
|
-
}
|
|
17312
|
-
return false;
|
|
17313
|
-
}
|
|
17314
|
-
function cloneFilterValue(value) {
|
|
17315
|
-
if (Array.isArray(value)) {
|
|
17316
|
-
return [...value];
|
|
17317
|
-
}
|
|
17318
|
-
if (value && typeof value === 'object') {
|
|
17319
|
-
return { ...value };
|
|
17320
|
-
}
|
|
17321
|
-
return value;
|
|
17322
|
-
}
|
|
17323
|
-
function copyNonEmptyFilters(source) {
|
|
17324
|
-
if (!source || typeof source !== 'object' || Array.isArray(source)) {
|
|
17325
|
-
return {};
|
|
17326
|
-
}
|
|
17327
|
-
const result = {};
|
|
17328
|
-
for (const [key, value] of Object.entries(source)) {
|
|
17329
|
-
const trimmedKey = key.trim();
|
|
17330
|
-
if (!trimmedKey || isEmptyFilterValue(value)) {
|
|
17331
|
-
continue;
|
|
17332
|
-
}
|
|
17333
|
-
result[trimmedKey] = cloneFilterValue(value);
|
|
17334
|
-
}
|
|
17335
|
-
return result;
|
|
17336
|
-
}
|
|
17337
|
-
function normalizeResourceKey(resourcePath) {
|
|
17338
|
-
return normalizePraxisResourcePath(resourcePath, {
|
|
17339
|
-
style: 'relative',
|
|
17340
|
-
stripApiPrefix: true,
|
|
17341
|
-
}).toLowerCase();
|
|
17342
|
-
}
|
|
17343
|
-
function toScalarOrArrayTokens(value) {
|
|
17344
|
-
if (value === undefined || value === null || value === '') {
|
|
17345
|
-
return [];
|
|
17346
|
-
}
|
|
17347
|
-
const list = Array.isArray(value) ? value : [value];
|
|
17348
|
-
return list
|
|
17349
|
-
.filter((entry) => entry !== undefined && entry !== null && entry !== '')
|
|
17350
|
-
.map((entry) => `${typeof entry}:${String(entry)}`)
|
|
17351
|
-
.sort();
|
|
17352
|
-
}
|
|
17353
|
-
/**
|
|
17354
|
-
* Resolves the categorical/grouping dimension field used for anti-feedback-loop detection.
|
|
17355
|
-
* Timeseries date fields intentionally return `undefined` unless explicitly configured in `excludeFields`.
|
|
17356
|
-
*/
|
|
17357
|
-
function resolveKpiDimensionField(spec, resolvedProjection) {
|
|
17358
|
-
if (spec.source.kind === 'stats-query') {
|
|
17359
|
-
if (spec.source.operation === 'group-by' || spec.source.operation === 'comparison') {
|
|
17360
|
-
return spec.source.request.field?.trim() || NON_DIMENSION_TIMESERIES_MSG;
|
|
17361
|
-
}
|
|
17362
|
-
return undefined;
|
|
17363
|
-
}
|
|
17364
|
-
if (spec.source.kind === 'analytics-projection' && resolvedProjection) {
|
|
17365
|
-
if (resolvedProjection.source.operation === 'group-by' ||
|
|
17366
|
-
resolvedProjection.source.operation === 'comparison') {
|
|
17367
|
-
const dim = resolvedProjection.bindings?.primaryDimension ??
|
|
17368
|
-
resolvedProjection.bindings?.dimensions?.[0];
|
|
17369
|
-
return dim?.keyFilterField?.trim() || dim?.field?.trim() || undefined;
|
|
17370
|
-
}
|
|
17371
|
-
}
|
|
17372
|
-
return undefined;
|
|
17373
|
-
}
|
|
17374
|
-
/**
|
|
17375
|
-
* Matches canonical Praxis FilterDTO variants against an underlying dimension field name
|
|
17376
|
-
* (`status` <-> `statuses`, `category` <-> `categories`, `appointmentType` <-> `appointmentTypes`/`appointmentTypeIn`, `departmentId` <-> `departmentIds`/`departmentIdIn`).
|
|
17377
|
-
*/
|
|
17378
|
-
function matchesDimensionFieldKey(filterKey, dimensionField) {
|
|
17379
|
-
const key = filterKey.trim().toLowerCase();
|
|
17380
|
-
const dim = dimensionField.trim().toLowerCase();
|
|
17381
|
-
if (!key || !dim) {
|
|
17382
|
-
return false;
|
|
17383
|
-
}
|
|
17384
|
-
const variants = new Set([
|
|
17385
|
-
dim,
|
|
17386
|
-
`${dim}s`,
|
|
17387
|
-
`${dim}es`,
|
|
17388
|
-
`${dim}in`,
|
|
17389
|
-
`${dim}ids`,
|
|
17390
|
-
`${dim}_in`,
|
|
17391
|
-
]);
|
|
17392
|
-
if (dim.endsWith('y') && dim.length > 1) {
|
|
17393
|
-
variants.add(`${dim.slice(0, -1)}ies`);
|
|
17394
|
-
}
|
|
17395
|
-
if (dim.endsWith('id') && dim.length > 2) {
|
|
17396
|
-
const stem = dim.slice(0, -2);
|
|
17397
|
-
variants.add(stem);
|
|
17398
|
-
variants.add(`${stem}ids`);
|
|
17399
|
-
variants.add(`${stem}idin`);
|
|
17400
|
-
}
|
|
17401
|
-
return variants.has(key);
|
|
17402
|
-
}
|
|
17403
|
-
function isDiscreteSetValue(value) {
|
|
17404
|
-
if (Array.isArray(value)) {
|
|
17405
|
-
return value.every((item) => item !== null && typeof item !== 'object');
|
|
17406
|
-
}
|
|
17407
|
-
return value !== null && value !== undefined && typeof value !== 'object';
|
|
17408
|
-
}
|
|
17409
|
-
function intersectDiscreteFilterValues(first, second) {
|
|
17410
|
-
if (!isDiscreteSetValue(first) || !isDiscreteSetValue(second)) {
|
|
17411
|
-
return { compatible: false, value: undefined };
|
|
17412
|
-
}
|
|
17413
|
-
const firstList = (Array.isArray(first) ? first : [first]).filter((entry) => entry !== undefined && entry !== null && entry !== '');
|
|
17414
|
-
const secondTokens = new Set(toScalarOrArrayTokens(second));
|
|
17415
|
-
const seen = new Set();
|
|
17416
|
-
const intersection = [];
|
|
17417
|
-
for (const item of firstList) {
|
|
17418
|
-
const token = `${typeof item}:${String(item)}`;
|
|
17419
|
-
if (secondTokens.has(token) && !seen.has(token)) {
|
|
17420
|
-
seen.add(token);
|
|
17421
|
-
intersection.push(item);
|
|
17422
|
-
}
|
|
17423
|
-
}
|
|
17424
|
-
if (intersection.length === 0) {
|
|
17425
|
-
return { compatible: false, value: undefined };
|
|
17426
|
-
}
|
|
17427
|
-
if (!Array.isArray(first) && !Array.isArray(second) && intersection.length === 1) {
|
|
17428
|
-
return { compatible: true, value: intersection[0] };
|
|
17429
|
-
}
|
|
17430
|
-
return { compatible: true, value: intersection };
|
|
17431
|
-
}
|
|
17432
|
-
function mergeConjunctiveFilterEntry(target, key, incomingValue, preferTargetOnConflict) {
|
|
17433
|
-
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
17434
|
-
target[key] = cloneFilterValue(incomingValue);
|
|
17435
|
-
return;
|
|
17436
|
-
}
|
|
17437
|
-
const existingValue = target[key];
|
|
17438
|
-
const intersection = intersectDiscreteFilterValues(existingValue, incomingValue);
|
|
17439
|
-
if (intersection.compatible) {
|
|
17440
|
-
target[key] = intersection.value;
|
|
17441
|
-
return;
|
|
17442
|
-
}
|
|
17443
|
-
if (!preferTargetOnConflict) {
|
|
17444
|
-
target[key] = cloneFilterValue(incomingValue);
|
|
17445
|
-
}
|
|
17446
|
-
}
|
|
17447
|
-
/**
|
|
17448
|
-
* Resolves the ambient context filters supplied by the cockpit (Channel 1 `scopeFilters`
|
|
17449
|
-
* and filtered Channel 2 `crossFilters`), guaranteeing Channel 2 never overwrites or widens
|
|
17450
|
-
* Channel 1 global scope filters.
|
|
17451
|
-
*/
|
|
17452
|
-
function resolveKpiContextFilters(spec, queryContext, resolvedProjection) {
|
|
17453
|
-
const effective = copyNonEmptyFilters(queryContext?.meta?.scopeFilters);
|
|
17454
|
-
const scopeKeys = new Set(Object.keys(effective).map((k) => k.trim().toLowerCase()));
|
|
17455
|
-
const reactionMode = spec.interaction?.filterReaction?.mode ?? 'all-except-own-dimension';
|
|
17456
|
-
const crossFilters = copyNonEmptyFilters(queryContext?.filters);
|
|
17457
|
-
const crossFilterSources = queryContext?.meta?.crossFilterSources ?? {};
|
|
17458
|
-
if (reactionMode !== 'page-scope-only') {
|
|
17459
|
-
const excludeSet = new Set((spec.interaction?.filterReaction?.excludeFields ?? [])
|
|
17460
|
-
.map((field) => field.trim().toLowerCase())
|
|
17461
|
-
.filter(Boolean));
|
|
17462
|
-
const ownCrossFilterField = spec.interaction?.crossFilter?.field?.trim().toLowerCase() ?? '';
|
|
17463
|
-
const dimensionField = resolveKpiDimensionField(spec, resolvedProjection);
|
|
17464
|
-
const cardResourceKey = normalizeResourceKey(spec.source.resourcePath);
|
|
17465
|
-
for (const [key, value] of Object.entries(crossFilters)) {
|
|
17466
|
-
const normalizedKey = key.trim().toLowerCase();
|
|
17467
|
-
if (excludeSet.has(normalizedKey)) {
|
|
17468
|
-
continue;
|
|
17469
|
-
}
|
|
17470
|
-
const sourceMeta = crossFilterSources[key];
|
|
17471
|
-
const sourceTargetResource = normalizeResourceKey(sourceMeta?.targetResourcePath);
|
|
17472
|
-
if (sourceTargetResource &&
|
|
17473
|
-
cardResourceKey &&
|
|
17474
|
-
sourceTargetResource !== cardResourceKey) {
|
|
17475
|
-
continue;
|
|
17476
|
-
}
|
|
17477
|
-
if (reactionMode === 'all-except-own-dimension') {
|
|
17478
|
-
if (ownCrossFilterField && normalizedKey === ownCrossFilterField) {
|
|
17479
|
-
continue;
|
|
17480
|
-
}
|
|
17481
|
-
if (sourceMeta?.sourceCardId && sourceMeta.sourceCardId === spec.id) {
|
|
17482
|
-
continue;
|
|
17483
|
-
}
|
|
17484
|
-
if (dimensionField && matchesDimensionFieldKey(key, dimensionField)) {
|
|
17485
|
-
continue;
|
|
17486
|
-
}
|
|
17487
|
-
}
|
|
17488
|
-
// Canal 1 (scopeFilters) nunca pode ser ampliado ou sobrescrito pelo Canal 2 (crossFilters).
|
|
17489
|
-
const preferScopeOnConflict = scopeKeys.has(normalizedKey);
|
|
17490
|
-
mergeConjunctiveFilterEntry(effective, key, value, preferScopeOnConflict);
|
|
17491
|
-
}
|
|
17492
|
-
}
|
|
17493
|
-
return effective;
|
|
17494
|
-
}
|
|
17495
|
-
/**
|
|
17496
|
-
* Resolves effective query filters following the 3-channel precedence contract:
|
|
17497
|
-
* 1. `queryContext.meta.scopeFilters` (always honored, never widened)
|
|
17498
|
-
* 2. `queryContext.filters` filtered by `interaction.filterReaction` and cross-filter target/source guards
|
|
17499
|
-
* 3. Card `baseFilter` / `parameters` intersected conjunctively (preserving locked invariants without widening `scopeFilters`).
|
|
17500
|
-
*/
|
|
17501
|
-
function resolveKpiEffectiveFilters(spec, queryContext, resolvedProjection) {
|
|
17502
|
-
const effective = resolveKpiContextFilters(spec, queryContext, resolvedProjection);
|
|
17503
|
-
const cardConstraints = spec.source.kind === 'stats-query'
|
|
17504
|
-
? copyNonEmptyFilters(spec.source.request.baseFilter)
|
|
17505
|
-
: spec.source.kind === 'analytics-projection'
|
|
17506
|
-
? copyNonEmptyFilters(spec.source.baseFilter)
|
|
17507
|
-
: copyNonEmptyFilters(spec.source.parameters);
|
|
17508
|
-
for (const [key, constraintVal] of Object.entries(cardConstraints)) {
|
|
17509
|
-
mergeConjunctiveFilterEntry(effective, key, constraintVal, false);
|
|
17510
|
-
}
|
|
17511
|
-
return effective;
|
|
17512
|
-
}
|
|
17513
|
-
/**
|
|
17514
|
-
* Resolves the canonical `PraxisStatsExecutionRequest` payload for any supported
|
|
17515
|
-
* `PraxisKpiMetricSource`, or returns `null` if an `analytics-projection` has not hydrated yet.
|
|
17516
|
-
*/
|
|
17517
|
-
function buildKpiStatsExecutionRequest(spec, queryContext, options = {}) {
|
|
17518
|
-
const effectiveFilters = resolveKpiEffectiveFilters(spec, queryContext, options.resolvedProjection);
|
|
17519
|
-
const scopeKey = options.scopeKey?.trim() || undefined;
|
|
17520
|
-
const bypassCache = options.bypassCache === true ? true : undefined;
|
|
17521
|
-
switch (spec.source.kind) {
|
|
17522
|
-
case 'stats-query': {
|
|
17523
|
-
const { resourcePath, operation, request } = spec.source;
|
|
17524
|
-
if (operation === 'group-by') {
|
|
17525
|
-
return {
|
|
17526
|
-
effectiveFilters,
|
|
17527
|
-
request: {
|
|
17528
|
-
resourcePath,
|
|
17529
|
-
operation: 'group-by',
|
|
17530
|
-
payload: {
|
|
17531
|
-
field: request.field,
|
|
17532
|
-
filter: effectiveFilters,
|
|
17533
|
-
...(request.metric ? { metric: request.metric } : {}),
|
|
17534
|
-
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
17535
|
-
...(request.orderBy ? { orderBy: request.orderBy } : {}),
|
|
17536
|
-
},
|
|
17537
|
-
...(scopeKey ? { scopeKey } : {}),
|
|
17538
|
-
...(bypassCache ? { bypassCache } : {}),
|
|
17539
|
-
},
|
|
17540
|
-
};
|
|
17541
|
-
}
|
|
17542
|
-
if (operation === 'timeseries') {
|
|
17543
|
-
const timezone = request.timezone?.trim() || options.timezone?.trim() || undefined;
|
|
17544
|
-
return {
|
|
17545
|
-
effectiveFilters,
|
|
17546
|
-
request: {
|
|
17547
|
-
resourcePath,
|
|
17548
|
-
operation: 'timeseries',
|
|
17549
|
-
payload: {
|
|
17550
|
-
field: request.field,
|
|
17551
|
-
granularity: request.granularity,
|
|
17552
|
-
rollingWindow: request.rollingWindow,
|
|
17553
|
-
filter: effectiveFilters,
|
|
17554
|
-
...(request.metric ? { metric: request.metric } : {}),
|
|
17555
|
-
...(timezone ? { timezone } : {}),
|
|
17556
|
-
...(typeof request.fillGaps === 'boolean' ? { fillGaps: request.fillGaps } : {}),
|
|
17557
|
-
},
|
|
17558
|
-
...(scopeKey ? { scopeKey } : {}),
|
|
17559
|
-
...(bypassCache ? { bypassCache } : {}),
|
|
17560
|
-
},
|
|
17561
|
-
};
|
|
17562
|
-
}
|
|
17563
|
-
const timezone = request.timezone?.trim() || options.timezone?.trim() || undefined;
|
|
17564
|
-
return {
|
|
17565
|
-
effectiveFilters,
|
|
17566
|
-
request: {
|
|
17567
|
-
resourcePath,
|
|
17568
|
-
operation: 'comparison',
|
|
17569
|
-
payload: {
|
|
17570
|
-
field: request.field,
|
|
17571
|
-
periodField: request.periodField,
|
|
17572
|
-
periodPreset: request.periodPreset,
|
|
17573
|
-
periodMode: request.periodMode,
|
|
17574
|
-
metrics: request.metrics,
|
|
17575
|
-
filter: effectiveFilters,
|
|
17576
|
-
...(timezone ? { timezone } : {}),
|
|
17577
|
-
...(request.limit !== undefined ? { limit: request.limit } : {}),
|
|
17578
|
-
...(request.orderBy ? { orderBy: request.orderBy } : {}),
|
|
17579
|
-
},
|
|
17580
|
-
...(scopeKey ? { scopeKey } : {}),
|
|
17581
|
-
...(bypassCache ? { bypassCache } : {}),
|
|
17582
|
-
},
|
|
17583
|
-
};
|
|
17584
|
-
}
|
|
17585
|
-
case 'verified-recipe': {
|
|
17586
|
-
const timezone = options.timezone?.trim() || undefined;
|
|
17587
|
-
const explicitParameters = copyNonEmptyFilters(spec.source.parameters);
|
|
17588
|
-
const rawContextFilters = resolveKpiContextFilters(spec, queryContext, options.resolvedProjection);
|
|
17589
|
-
const contextFilters = {};
|
|
17590
|
-
for (const [key, value] of Object.entries(rawContextFilters)) {
|
|
17591
|
-
if (!Object.prototype.hasOwnProperty.call(explicitParameters, key)) {
|
|
17592
|
-
contextFilters[key] = value;
|
|
17593
|
-
}
|
|
17594
|
-
}
|
|
17595
|
-
return {
|
|
17596
|
-
effectiveFilters,
|
|
17597
|
-
request: {
|
|
17598
|
-
resourcePath: spec.source.resourcePath,
|
|
17599
|
-
operation: 'verified-recipe',
|
|
17600
|
-
recipeId: spec.source.recipeId,
|
|
17601
|
-
payload: {
|
|
17602
|
-
parameters: explicitParameters,
|
|
17603
|
-
...(Object.keys(contextFilters).length > 0 ? { contextFilters } : {}),
|
|
17604
|
-
...(timezone ? { timezone } : {}),
|
|
17605
|
-
},
|
|
17606
|
-
...(scopeKey ? { scopeKey } : {}),
|
|
17607
|
-
...(bypassCache ? { bypassCache } : {}),
|
|
17608
|
-
},
|
|
17609
|
-
};
|
|
17610
|
-
}
|
|
17611
|
-
case 'analytics-projection': {
|
|
17612
|
-
const projection = options.resolvedProjection;
|
|
17613
|
-
if (!projection || !options.requestBuilder) {
|
|
17614
|
-
return null;
|
|
17615
|
-
}
|
|
17616
|
-
const plan = options.requestBuilder.buildExecutionPlan(projection);
|
|
17617
|
-
const mergedFilter = copyNonEmptyFilters(plan.statsRequest.filter);
|
|
17618
|
-
for (const [key, value] of Object.entries(effectiveFilters)) {
|
|
17619
|
-
mergeConjunctiveFilterEntry(mergedFilter, key, value, false);
|
|
17620
|
-
}
|
|
17621
|
-
return {
|
|
17622
|
-
effectiveFilters: mergedFilter,
|
|
17623
|
-
request: {
|
|
17624
|
-
resourcePath: plan.resourcePath || spec.source.resourcePath,
|
|
17625
|
-
operation: plan.operation,
|
|
17626
|
-
payload: {
|
|
17627
|
-
...plan.statsRequest,
|
|
17628
|
-
filter: mergedFilter,
|
|
17629
|
-
},
|
|
17630
|
-
...(scopeKey ? { scopeKey } : {}),
|
|
17631
|
-
...(bypassCache ? { bypassCache } : {}),
|
|
17632
|
-
},
|
|
17633
|
-
};
|
|
17634
|
-
}
|
|
17635
|
-
}
|
|
17636
|
-
}
|
|
17637
|
-
/**
|
|
17638
|
-
* Checks whether the card's configured `interaction.crossFilter` is currently active in `queryContext.filters`.
|
|
17639
|
-
*/
|
|
17640
|
-
function isKpiCrossFilterActive(spec, queryContext) {
|
|
17641
|
-
const crossFilter = spec.interaction?.crossFilter;
|
|
17642
|
-
if (!crossFilter?.field?.trim() || !crossFilter.values.length) {
|
|
17643
|
-
return false;
|
|
17644
|
-
}
|
|
17645
|
-
const activeFilters = queryContext?.filters;
|
|
17646
|
-
if (!activeFilters || typeof activeFilters !== 'object') {
|
|
17647
|
-
return false;
|
|
17648
|
-
}
|
|
17649
|
-
const currentTokens = toScalarOrArrayTokens(activeFilters[crossFilter.field.trim()]);
|
|
17650
|
-
const expectedTokens = toScalarOrArrayTokens(crossFilter.values);
|
|
17651
|
-
if (currentTokens.length === 0 || currentTokens.length !== expectedTokens.length) {
|
|
17652
|
-
return false;
|
|
17653
|
-
}
|
|
17654
|
-
return currentTokens.every((token, index) => token === expectedTokens[index]);
|
|
17655
|
-
}
|
|
17656
|
-
function isMultiValueCrossFilterField(field) {
|
|
17657
|
-
const trimmed = field.trim();
|
|
17658
|
-
if (!trimmed) {
|
|
17659
|
-
return false;
|
|
17660
|
-
}
|
|
17661
|
-
if (/(?:_in|_ids)$/i.test(trimmed)) {
|
|
17662
|
-
return true;
|
|
17663
|
-
}
|
|
17664
|
-
if (/(?:[a-z0-9](?:In|Ids))$/.test(trimmed) &&
|
|
17665
|
-
!/(?:Check|Sign|Log|Clock|Walk|Drop|Trade|Built|Linked|Opt|Punch)In$/.test(trimmed)) {
|
|
17666
|
-
return true;
|
|
17667
|
-
}
|
|
17668
|
-
if (/(?:us|ss|is|as|Days|Dias)$/i.test(trimmed)) {
|
|
17669
|
-
return false;
|
|
17670
|
-
}
|
|
17671
|
-
return /(?:es|ies|s)$/.test(trimmed);
|
|
17672
|
-
}
|
|
17673
|
-
/**
|
|
17674
|
-
* Builds the canonical cross-filter toggle event payload and metadata for parent cockpit state orchestration.
|
|
17675
|
-
*/
|
|
17676
|
-
function buildKpiCrossFilterToggleEvent(spec, currentlyActive, resolvedProjection) {
|
|
17677
|
-
const crossFilter = spec.interaction?.crossFilter;
|
|
17678
|
-
const field = crossFilter?.field?.trim();
|
|
17679
|
-
if (!crossFilter || !field || !crossFilter.values.length) {
|
|
17680
|
-
return null;
|
|
17681
|
-
}
|
|
17682
|
-
const nextActive = !currentlyActive;
|
|
17683
|
-
const rawValue = crossFilter.values.length === 1 && !isMultiValueCrossFilterField(field)
|
|
17684
|
-
? crossFilter.values[0]
|
|
17685
|
-
: [...crossFilter.values];
|
|
17686
|
-
const nextFilterValue = nextActive ? coerceCrossFilterValue(field, rawValue) : undefined;
|
|
17687
|
-
const targetResourcePath = crossFilter.targetResourcePath?.trim() || spec.source.resourcePath;
|
|
17688
|
-
return {
|
|
17689
|
-
cardId: spec.id,
|
|
17690
|
-
field,
|
|
17691
|
-
values: [...crossFilter.values],
|
|
17692
|
-
active: nextActive,
|
|
17693
|
-
nextFilterValue,
|
|
17694
|
-
filterPatch: {
|
|
17695
|
-
[field]: nextFilterValue,
|
|
17696
|
-
},
|
|
17697
|
-
targetResourcePath,
|
|
17698
|
-
...(crossFilter.activateTargetSurfaceId?.trim()
|
|
17699
|
-
? { activateTargetSurfaceId: crossFilter.activateTargetSurfaceId.trim() }
|
|
17700
|
-
: {}),
|
|
17701
|
-
sourceMeta: {
|
|
17702
|
-
sourceCardId: spec.id,
|
|
17703
|
-
...(resolveKpiDimensionField(spec, resolvedProjection)
|
|
17704
|
-
? { dimensionField: resolveKpiDimensionField(spec, resolvedProjection) }
|
|
17705
|
-
: {}),
|
|
17706
|
-
...(targetResourcePath ? { targetResourcePath } : {}),
|
|
17707
|
-
},
|
|
17708
|
-
};
|
|
17709
|
-
}
|
|
17710
|
-
|
|
17711
18107
|
function asRecord$3(value) {
|
|
17712
18108
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
17713
18109
|
? value
|
|
@@ -17833,10 +18229,17 @@ class PraxisKpiCardComponent {
|
|
|
17833
18229
|
isLoading = signal(true, ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
17834
18230
|
effectiveFilters = signal({}, ...(ngDevMode ? [{ debugName: "effectiveFilters" }] : /* istanbul ignore next */ []));
|
|
17835
18231
|
refreshEpoch = signal(0, ...(ngDevMode ? [{ debugName: "refreshEpoch" }] : /* istanbul ignore next */ []));
|
|
18232
|
+
runtimeContextSuspended = signal(Boolean(this.enterpriseContext?.isSwitching) ||
|
|
18233
|
+
(this.enterpriseContext?.snapshot != null &&
|
|
18234
|
+
!isEnterpriseRuntimeSnapshotReady(this.enterpriseContext.snapshot)), ...(ngDevMode ? [{ debugName: "runtimeContextSuspended" }] : /* istanbul ignore next */ []));
|
|
17836
18235
|
provenanceOpenSignal = signal(false, ...(ngDevMode ? [{ debugName: "provenanceOpenSignal" }] : /* istanbul ignore next */ []));
|
|
17837
18236
|
bypassCacheOnNextRun = false;
|
|
17838
18237
|
lastSettledSignature = null;
|
|
17839
18238
|
settledRefreshEpoch = -1;
|
|
18239
|
+
lastResolvedProjection = null;
|
|
18240
|
+
hadNonNullRuntimeContext = isEnterpriseRuntimeSnapshotReady(this.enterpriseContext?.snapshot) ||
|
|
18241
|
+
Boolean(this.enterpriseContext?.isSwitching);
|
|
18242
|
+
seenInitialRuntimeContext = false;
|
|
17840
18243
|
resolvedCard = computed(() => this.card() ?? this.config(), ...(ngDevMode ? [{ debugName: "resolvedCard" }] : /* istanbul ignore next */ []));
|
|
17841
18244
|
provenanceOpen = this.provenanceOpenSignal.asReadonly();
|
|
17842
18245
|
provenancePosition = signal(null, ...(ngDevMode ? [{ debugName: "provenancePosition" }] : /* istanbul ignore next */ []));
|
|
@@ -17868,14 +18271,23 @@ class PraxisKpiCardComponent {
|
|
|
17868
18271
|
visualization: null,
|
|
17869
18272
|
};
|
|
17870
18273
|
}
|
|
17871
|
-
const loading = this.isLoading();
|
|
18274
|
+
const loading = this.isLoading() || this.runtimeContextSuspended();
|
|
17872
18275
|
const env = loading ? null : this.envelope();
|
|
17873
|
-
const
|
|
18276
|
+
const queryCtx = this.queryContext();
|
|
18277
|
+
const active = isKpiCardFilterOwnedActive(spec, queryCtx);
|
|
18278
|
+
const enableInteractiveSegments = Boolean(spec.interaction?.crossFilter?.field?.trim() &&
|
|
18279
|
+
spec.derivation.kind === 'composition' &&
|
|
18280
|
+
(spec.visualization?.kind ?? 'stackedBar') === 'stackedBar');
|
|
18281
|
+
const activeFilterValues = enableInteractiveSegments
|
|
18282
|
+
? resolveActiveKpiDimensionValues(spec, queryCtx)
|
|
18283
|
+
: undefined;
|
|
17874
18284
|
return evaluatePraxisKpiDerivation(spec, env, {
|
|
17875
18285
|
i18n: this.i18n,
|
|
17876
18286
|
locale,
|
|
17877
18287
|
active,
|
|
17878
18288
|
effectiveFilters: this.effectiveFilters(),
|
|
18289
|
+
enableInteractiveSegments,
|
|
18290
|
+
activeFilterValues,
|
|
17879
18291
|
});
|
|
17880
18292
|
}, ...(ngDevMode ? [{ debugName: "viewModel" }] : /* istanbul ignore next */ []));
|
|
17881
18293
|
provenanceHeading = computed(() => this.translate('praxis.microViz.kpi.actions.provenance', this.isEnglishLocale()
|
|
@@ -17995,16 +18407,40 @@ class PraxisKpiCardComponent {
|
|
|
17995
18407
|
});
|
|
17996
18408
|
});
|
|
17997
18409
|
this.enterpriseContext?.contextChanges$
|
|
17998
|
-
?.pipe(
|
|
17999
|
-
.subscribe(() => {
|
|
18410
|
+
?.pipe(takeUntilDestroyed(this.destroyRef))
|
|
18411
|
+
.subscribe((snapshot) => {
|
|
18412
|
+
const ready = isEnterpriseRuntimeSnapshotReady(snapshot);
|
|
18413
|
+
if (!this.seenInitialRuntimeContext) {
|
|
18414
|
+
this.seenInitialRuntimeContext = true;
|
|
18415
|
+
if (ready) {
|
|
18416
|
+
this.hadNonNullRuntimeContext = true;
|
|
18417
|
+
}
|
|
18418
|
+
return;
|
|
18419
|
+
}
|
|
18420
|
+
if (!ready) {
|
|
18421
|
+
if (!this.hadNonNullRuntimeContext) {
|
|
18422
|
+
return;
|
|
18423
|
+
}
|
|
18424
|
+
this.suspendForContextTransition();
|
|
18425
|
+
return;
|
|
18426
|
+
}
|
|
18427
|
+
this.hadNonNullRuntimeContext = true;
|
|
18428
|
+
this.runtimeContextSuspended.set(false);
|
|
18000
18429
|
this.resetForTenantOrInvalidation();
|
|
18001
18430
|
});
|
|
18002
18431
|
this.cacheInvalidator?.invalidated$
|
|
18003
18432
|
?.pipe(takeUntilDestroyed(this.destroyRef))
|
|
18004
18433
|
.subscribe(() => {
|
|
18434
|
+
if (this.runtimeContextSuspended()) {
|
|
18435
|
+
this.lastSettledSignature = null;
|
|
18436
|
+
this.settledRefreshEpoch = -1;
|
|
18437
|
+
this.bypassCacheOnNextRun = true;
|
|
18438
|
+
return;
|
|
18439
|
+
}
|
|
18005
18440
|
this.resetForTenantOrInvalidation();
|
|
18006
18441
|
});
|
|
18007
18442
|
effect((onCleanup) => {
|
|
18443
|
+
const suspended = this.runtimeContextSuspended();
|
|
18008
18444
|
const epoch = this.refreshEpoch();
|
|
18009
18445
|
const spec = this.resolvedCard();
|
|
18010
18446
|
const queryContext = this.queryContext();
|
|
@@ -18017,9 +18453,14 @@ class PraxisKpiCardComponent {
|
|
|
18017
18453
|
disposed = true;
|
|
18018
18454
|
subscription?.unsubscribe();
|
|
18019
18455
|
});
|
|
18456
|
+
if (suspended) {
|
|
18457
|
+
this.isLoading.set(true);
|
|
18458
|
+
return;
|
|
18459
|
+
}
|
|
18020
18460
|
if (!spec) {
|
|
18021
18461
|
this.lastSettledSignature = null;
|
|
18022
18462
|
this.settledRefreshEpoch = -1;
|
|
18463
|
+
this.lastResolvedProjection = null;
|
|
18023
18464
|
this.effectiveFilters.set({});
|
|
18024
18465
|
this.envelope.set(null);
|
|
18025
18466
|
this.isLoading.set(false);
|
|
@@ -18034,6 +18475,7 @@ class PraxisKpiCardComponent {
|
|
|
18034
18475
|
subscription = this.hydrator
|
|
18035
18476
|
.resolveProjection(resourcePath, projectionId, explicitAnalytics)
|
|
18036
18477
|
.pipe(switchMap((hydrated) => {
|
|
18478
|
+
this.lastResolvedProjection = hydrated.projection ?? null;
|
|
18037
18479
|
if (!hydrated.projection) {
|
|
18038
18480
|
const failed = {
|
|
18039
18481
|
data: null,
|
|
@@ -18114,6 +18556,7 @@ class PraxisKpiCardComponent {
|
|
|
18114
18556
|
scopeKey,
|
|
18115
18557
|
bypassCache,
|
|
18116
18558
|
});
|
|
18559
|
+
this.lastResolvedProjection = null;
|
|
18117
18560
|
if (!built) {
|
|
18118
18561
|
this.lastSettledSignature = null;
|
|
18119
18562
|
this.settledRefreshEpoch = -1;
|
|
@@ -18169,7 +18612,8 @@ class PraxisKpiCardComponent {
|
|
|
18169
18612
|
status: vm.status,
|
|
18170
18613
|
provenance: vm.provenance,
|
|
18171
18614
|
});
|
|
18172
|
-
const
|
|
18615
|
+
const queryCtx = this.queryContext();
|
|
18616
|
+
const event = buildKpiCrossFilterToggleEvent(spec, isKpiCardFilterOwnedActive(spec, queryCtx), this.lastResolvedProjection, queryCtx);
|
|
18173
18617
|
if (event) {
|
|
18174
18618
|
this.crossFilter.emit(event);
|
|
18175
18619
|
return;
|
|
@@ -18178,6 +18622,23 @@ class PraxisKpiCardComponent {
|
|
|
18178
18622
|
this.onCardDrillDown();
|
|
18179
18623
|
}
|
|
18180
18624
|
}
|
|
18625
|
+
onSegmentActivate(event) {
|
|
18626
|
+
const spec = this.resolvedCard();
|
|
18627
|
+
if (!spec) {
|
|
18628
|
+
return;
|
|
18629
|
+
}
|
|
18630
|
+
const vm = this.viewModel();
|
|
18631
|
+
this.cardAction.emit({
|
|
18632
|
+
cardId: spec.id,
|
|
18633
|
+
action: 'activate',
|
|
18634
|
+
status: vm.status,
|
|
18635
|
+
provenance: vm.provenance,
|
|
18636
|
+
});
|
|
18637
|
+
const toggleEvent = buildKpiSegmentCrossFilterToggleEvent(spec, event.key, this.queryContext(), this.lastResolvedProjection);
|
|
18638
|
+
if (toggleEvent) {
|
|
18639
|
+
this.crossFilter.emit(toggleEvent);
|
|
18640
|
+
}
|
|
18641
|
+
}
|
|
18181
18642
|
onCardRetry() {
|
|
18182
18643
|
const spec = this.resolvedCard();
|
|
18183
18644
|
if (!spec) {
|
|
@@ -18252,6 +18713,15 @@ class PraxisKpiCardComponent {
|
|
|
18252
18713
|
label: vm.label,
|
|
18253
18714
|
});
|
|
18254
18715
|
}
|
|
18716
|
+
suspendForContextTransition() {
|
|
18717
|
+
this.runtimeContextSuspended.set(true);
|
|
18718
|
+
this.lastSettledSignature = null;
|
|
18719
|
+
this.settledRefreshEpoch = -1;
|
|
18720
|
+
this.envelope.set(null);
|
|
18721
|
+
this.isLoading.set(true);
|
|
18722
|
+
this.provenanceOpenSignal.set(false);
|
|
18723
|
+
this.bypassCacheOnNextRun = true;
|
|
18724
|
+
}
|
|
18255
18725
|
resetForTenantOrInvalidation() {
|
|
18256
18726
|
this.lastSettledSignature = null;
|
|
18257
18727
|
this.settledRefreshEpoch = -1;
|
|
@@ -18345,14 +18815,14 @@ class PraxisKpiCardComponent {
|
|
|
18345
18815
|
return resolvePraxisMicroVizMessage(this.i18n, key, undefined, fallback, undefined, this.resolveLocale());
|
|
18346
18816
|
}
|
|
18347
18817
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisKpiCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18348
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisKpiCardComponent, isStandalone: true, selector: "praxis-kpi-card", inputs: { card: { classPropertyName: "card", publicName: "card", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, queryContext: { classPropertyName: "queryContext", publicName: "queryContext", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, scopeKey: { classPropertyName: "scopeKey", publicName: "scopeKey", isSignal: true, isRequired: false, transformFunction: null }, showProvenance: { classPropertyName: "showProvenance", publicName: "showProvenance", isSignal: true, isRequired: false, transformFunction: null }, analytics: { classPropertyName: "analytics", publicName: "analytics", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { crossFilter: "crossFilter", drillDown: "drillDown", cardAction: "cardAction" }, host: { properties: { "attr.data-card-id": "resolvedCard()?.id ?? \"\"" }, classAttribute: "prx-kpi-card-host" }, viewQueries: [{ propertyName: "provenancePanel", first: true, predicate: ["provenancePanel"], descendants: true, isSignal: true }], ngImport: i0, template: "@let vm = viewModel();\n\n<praxis-kpi-card-view\n [viewModel]=\"vm\"\n [density]=\"density()\"\n [allowRetry]=\"true\"\n [allowDrillDown]=\"allowDrillDown()\"\n [showProvenance]=\"showProvenance()\"\n [provenanceExpanded]=\"provenanceOpen()\"\n [governed]=\"isGoverned()\"\n (activate)=\"onCardActivate()\"\n (retry)=\"onCardRetry()\"\n (openProvenance)=\"onToggleProvenance()\"\n (drillDown)=\"onCardDrillDown()\"\n/>\n\n@if (provenanceOpen() && vm.provenance; as prov) {\n <aside\n #provenancePanel\n class=\"prx-kpi-provenance\"\n popover=\"manual\"\n role=\"region\"\n [attr.aria-label]=\"provenanceHeading()\"\n [style.top.px]=\"provenancePosition()?.top ?? null\"\n [style.left.px]=\"provenancePosition()?.left ?? null\"\n [style.width.px]=\"provenancePosition()?.width ?? null\"\n tabindex=\"-1\"\n (keydown)=\"onProvenanceKeydown($event)\"\n >\n <div class=\"prx-kpi-provenance__header\">\n <span class=\"prx-kpi-provenance__title\">{{ provenanceHeading() }}</span>\n <button\n type=\"button\"\n class=\"prx-kpi-provenance__close\"\n [attr.aria-label]=\"provenanceCloseLabel()\"\n (click)=\"closeProvenance()\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n\n <dl class=\"prx-kpi-provenance__list\">\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceResourceLabel() }}</dt>\n <dd><code>{{ prov.resourcePath }}</code></dd>\n </div>\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceOperationLabel() }}</dt>\n <dd>{{ formattedProvenanceOperation() }}</dd>\n </div>\n @if (prov.recipeId) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceRecipeLabel() }}</dt>\n <dd>\n <code>{{ prov.recipeId }}</code>\n @if (prov.recipeVersion) {\n <span> \u00B7 v{{ prov.recipeVersion }}</span>\n }\n </dd>\n </div>\n }\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFiltersLabel() }}</dt>\n <dd>{{ formattedProvenanceFilters() }}</dd>\n </div>\n @if (prov.fetchedAt) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFetchedLabel() }}</dt>\n <dd><time [attr.datetime]=\"prov.fetchedAt\">{{ formattedProvenanceFetchedAt() }}</time></dd>\n </div>\n }\n </dl>\n\n @if (prov.suppressionNote) {\n <p class=\"prx-kpi-provenance__note\">{{ prov.suppressionNote }}</p>\n }\n </aside>\n}\n", styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0}praxis-kpi-card-view{flex:1 1 auto;height:100%}.prx-kpi-provenance{position:fixed;inset:auto;margin:0;z-index:1200;box-sizing:border-box;min-width:240px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overflow-x:hidden;padding:.75rem .85rem;border-radius:var(--prx-kpi-card-radius, 12px);border:1px solid var(--prx-kpi-card-border, rgba(15, 23, 42, .14));background:var(--prx-kpi-card-bg, var(--md-sys-color-surface-container-low, #f8fafc));box-shadow:var(--prx-kpi-card-shadow-hover, 0 12px 28px -8px rgba(15, 23, 42, .22));backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);-webkit-backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);font-size:.74rem;line-height:1.4;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.prx-kpi-provenance__title{font-weight:600;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--prx-micro-label-color, #4b5563);cursor:pointer}.prx-kpi-provenance__close:focus-visible{outline:2px solid var(--prx-kpi-card-focus-ring, #006a6a);outline-offset:2px}.prx-kpi-provenance__close mat-icon{width:1rem;height:1rem;font-size:1rem;line-height:1rem}.prx-kpi-provenance__list{display:grid;gap:.25rem;margin:0}.prx-kpi-provenance__row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.prx-kpi-provenance__row dt{margin:0;font-weight:600;color:var(--prx-micro-label-color, #4b5563);flex:0 0 auto}.prx-kpi-provenance__row dd{margin:0;text-align:right;word-break:break-word}.prx-kpi-provenance__row code{font-size:.7rem}.prx-kpi-provenance__note{margin:.45rem 0 0;padding-top:.35rem;border-top:1px dashed var(--prx-kpi-card-border, rgba(15, 23, 42, .14));color:var(--prx-micro-tone-warning-text, #92400e);font-weight:500}\n"], dependencies: [{ kind: "component", type: PraxisKpiCardViewComponent, selector: "praxis-kpi-card-view", inputs: ["viewModel", "density", "allowRetry", "allowDrillDown", "showProvenance", "provenanceExpanded", "governed"], outputs: ["activate", "retry", "openProvenance", "drillDown"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18818
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisKpiCardComponent, isStandalone: true, selector: "praxis-kpi-card", inputs: { card: { classPropertyName: "card", publicName: "card", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, queryContext: { classPropertyName: "queryContext", publicName: "queryContext", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, scopeKey: { classPropertyName: "scopeKey", publicName: "scopeKey", isSignal: true, isRequired: false, transformFunction: null }, showProvenance: { classPropertyName: "showProvenance", publicName: "showProvenance", isSignal: true, isRequired: false, transformFunction: null }, analytics: { classPropertyName: "analytics", publicName: "analytics", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { crossFilter: "crossFilter", drillDown: "drillDown", cardAction: "cardAction" }, host: { properties: { "attr.data-card-id": "resolvedCard()?.id ?? \"\"" }, classAttribute: "prx-kpi-card-host" }, viewQueries: [{ propertyName: "provenancePanel", first: true, predicate: ["provenancePanel"], descendants: true, isSignal: true }], ngImport: i0, template: "@let vm = viewModel();\n\n<praxis-kpi-card-view\n [viewModel]=\"vm\"\n [density]=\"density()\"\n [allowRetry]=\"true\"\n [allowDrillDown]=\"allowDrillDown()\"\n [showProvenance]=\"showProvenance()\"\n [provenanceExpanded]=\"provenanceOpen()\"\n [governed]=\"isGoverned()\"\n (activate)=\"onCardActivate()\"\n (segmentActivate)=\"onSegmentActivate($event)\"\n (retry)=\"onCardRetry()\"\n (openProvenance)=\"onToggleProvenance()\"\n (drillDown)=\"onCardDrillDown()\"\n/>\n\n@if (provenanceOpen() && vm.provenance; as prov) {\n <aside\n #provenancePanel\n class=\"prx-kpi-provenance\"\n popover=\"manual\"\n role=\"region\"\n [attr.aria-label]=\"provenanceHeading()\"\n [style.top.px]=\"provenancePosition()?.top ?? null\"\n [style.left.px]=\"provenancePosition()?.left ?? null\"\n [style.width.px]=\"provenancePosition()?.width ?? null\"\n tabindex=\"-1\"\n (keydown)=\"onProvenanceKeydown($event)\"\n >\n <div class=\"prx-kpi-provenance__header\">\n <span class=\"prx-kpi-provenance__title\">{{ provenanceHeading() }}</span>\n <button\n type=\"button\"\n class=\"prx-kpi-provenance__close\"\n [attr.aria-label]=\"provenanceCloseLabel()\"\n (click)=\"closeProvenance()\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n\n <dl class=\"prx-kpi-provenance__list\">\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceResourceLabel() }}</dt>\n <dd><code>{{ prov.resourcePath }}</code></dd>\n </div>\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceOperationLabel() }}</dt>\n <dd>{{ formattedProvenanceOperation() }}</dd>\n </div>\n @if (prov.recipeId) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceRecipeLabel() }}</dt>\n <dd>\n <code>{{ prov.recipeId }}</code>\n @if (prov.recipeVersion) {\n <span> \u00B7 v{{ prov.recipeVersion }}</span>\n }\n </dd>\n </div>\n }\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFiltersLabel() }}</dt>\n <dd>{{ formattedProvenanceFilters() }}</dd>\n </div>\n @if (prov.fetchedAt) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFetchedLabel() }}</dt>\n <dd><time [attr.datetime]=\"prov.fetchedAt\">{{ formattedProvenanceFetchedAt() }}</time></dd>\n </div>\n }\n </dl>\n\n @if (prov.suppressionNote) {\n <p class=\"prx-kpi-provenance__note\">{{ prov.suppressionNote }}</p>\n }\n </aside>\n}\n", styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0}praxis-kpi-card-view{flex:1 1 auto;height:100%}.prx-kpi-provenance{position:fixed;inset:auto;margin:0;z-index:1200;box-sizing:border-box;min-width:240px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overflow-x:hidden;padding:.75rem .85rem;border-radius:var(--prx-kpi-card-radius, 12px);border:1px solid var(--prx-kpi-card-border, rgba(15, 23, 42, .14));background:var(--prx-kpi-card-bg, var(--md-sys-color-surface-container-low, #f8fafc));box-shadow:var(--prx-kpi-card-shadow-hover, 0 12px 28px -8px rgba(15, 23, 42, .22));backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);-webkit-backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);font-size:.74rem;line-height:1.4;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.prx-kpi-provenance__title{font-weight:600;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--prx-micro-label-color, #4b5563);cursor:pointer}.prx-kpi-provenance__close:focus-visible{outline:2px solid var(--prx-kpi-card-focus-ring, #006a6a);outline-offset:2px}.prx-kpi-provenance__close mat-icon{width:1rem;height:1rem;font-size:1rem;line-height:1rem}.prx-kpi-provenance__list{display:grid;gap:.25rem;margin:0}.prx-kpi-provenance__row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.prx-kpi-provenance__row dt{margin:0;font-weight:600;color:var(--prx-micro-label-color, #4b5563);flex:0 0 auto}.prx-kpi-provenance__row dd{margin:0;text-align:right;word-break:break-word}.prx-kpi-provenance__row code{font-size:.7rem}.prx-kpi-provenance__note{margin:.45rem 0 0;padding-top:.35rem;border-top:1px dashed var(--prx-kpi-card-border, rgba(15, 23, 42, .14));color:var(--prx-micro-tone-warning-text, #92400e);font-weight:500}\n"], dependencies: [{ kind: "component", type: PraxisKpiCardViewComponent, selector: "praxis-kpi-card-view", inputs: ["viewModel", "density", "allowRetry", "allowDrillDown", "showProvenance", "provenanceExpanded", "governed"], outputs: ["activate", "segmentActivate", "retry", "openProvenance", "drillDown"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18349
18819
|
}
|
|
18350
18820
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisKpiCardComponent, decorators: [{
|
|
18351
18821
|
type: Component,
|
|
18352
18822
|
args: [{ selector: 'praxis-kpi-card', imports: [PraxisKpiCardViewComponent, MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
18353
18823
|
class: 'prx-kpi-card-host',
|
|
18354
18824
|
'[attr.data-card-id]': 'resolvedCard()?.id ?? ""',
|
|
18355
|
-
}, template: "@let vm = viewModel();\n\n<praxis-kpi-card-view\n [viewModel]=\"vm\"\n [density]=\"density()\"\n [allowRetry]=\"true\"\n [allowDrillDown]=\"allowDrillDown()\"\n [showProvenance]=\"showProvenance()\"\n [provenanceExpanded]=\"provenanceOpen()\"\n [governed]=\"isGoverned()\"\n (activate)=\"onCardActivate()\"\n (retry)=\"onCardRetry()\"\n (openProvenance)=\"onToggleProvenance()\"\n (drillDown)=\"onCardDrillDown()\"\n/>\n\n@if (provenanceOpen() && vm.provenance; as prov) {\n <aside\n #provenancePanel\n class=\"prx-kpi-provenance\"\n popover=\"manual\"\n role=\"region\"\n [attr.aria-label]=\"provenanceHeading()\"\n [style.top.px]=\"provenancePosition()?.top ?? null\"\n [style.left.px]=\"provenancePosition()?.left ?? null\"\n [style.width.px]=\"provenancePosition()?.width ?? null\"\n tabindex=\"-1\"\n (keydown)=\"onProvenanceKeydown($event)\"\n >\n <div class=\"prx-kpi-provenance__header\">\n <span class=\"prx-kpi-provenance__title\">{{ provenanceHeading() }}</span>\n <button\n type=\"button\"\n class=\"prx-kpi-provenance__close\"\n [attr.aria-label]=\"provenanceCloseLabel()\"\n (click)=\"closeProvenance()\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n\n <dl class=\"prx-kpi-provenance__list\">\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceResourceLabel() }}</dt>\n <dd><code>{{ prov.resourcePath }}</code></dd>\n </div>\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceOperationLabel() }}</dt>\n <dd>{{ formattedProvenanceOperation() }}</dd>\n </div>\n @if (prov.recipeId) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceRecipeLabel() }}</dt>\n <dd>\n <code>{{ prov.recipeId }}</code>\n @if (prov.recipeVersion) {\n <span> \u00B7 v{{ prov.recipeVersion }}</span>\n }\n </dd>\n </div>\n }\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFiltersLabel() }}</dt>\n <dd>{{ formattedProvenanceFilters() }}</dd>\n </div>\n @if (prov.fetchedAt) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFetchedLabel() }}</dt>\n <dd><time [attr.datetime]=\"prov.fetchedAt\">{{ formattedProvenanceFetchedAt() }}</time></dd>\n </div>\n }\n </dl>\n\n @if (prov.suppressionNote) {\n <p class=\"prx-kpi-provenance__note\">{{ prov.suppressionNote }}</p>\n }\n </aside>\n}\n", styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0}praxis-kpi-card-view{flex:1 1 auto;height:100%}.prx-kpi-provenance{position:fixed;inset:auto;margin:0;z-index:1200;box-sizing:border-box;min-width:240px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overflow-x:hidden;padding:.75rem .85rem;border-radius:var(--prx-kpi-card-radius, 12px);border:1px solid var(--prx-kpi-card-border, rgba(15, 23, 42, .14));background:var(--prx-kpi-card-bg, var(--md-sys-color-surface-container-low, #f8fafc));box-shadow:var(--prx-kpi-card-shadow-hover, 0 12px 28px -8px rgba(15, 23, 42, .22));backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);-webkit-backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);font-size:.74rem;line-height:1.4;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.prx-kpi-provenance__title{font-weight:600;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--prx-micro-label-color, #4b5563);cursor:pointer}.prx-kpi-provenance__close:focus-visible{outline:2px solid var(--prx-kpi-card-focus-ring, #006a6a);outline-offset:2px}.prx-kpi-provenance__close mat-icon{width:1rem;height:1rem;font-size:1rem;line-height:1rem}.prx-kpi-provenance__list{display:grid;gap:.25rem;margin:0}.prx-kpi-provenance__row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.prx-kpi-provenance__row dt{margin:0;font-weight:600;color:var(--prx-micro-label-color, #4b5563);flex:0 0 auto}.prx-kpi-provenance__row dd{margin:0;text-align:right;word-break:break-word}.prx-kpi-provenance__row code{font-size:.7rem}.prx-kpi-provenance__note{margin:.45rem 0 0;padding-top:.35rem;border-top:1px dashed var(--prx-kpi-card-border, rgba(15, 23, 42, .14));color:var(--prx-micro-tone-warning-text, #92400e);font-weight:500}\n"] }]
|
|
18825
|
+
}, template: "@let vm = viewModel();\n\n<praxis-kpi-card-view\n [viewModel]=\"vm\"\n [density]=\"density()\"\n [allowRetry]=\"true\"\n [allowDrillDown]=\"allowDrillDown()\"\n [showProvenance]=\"showProvenance()\"\n [provenanceExpanded]=\"provenanceOpen()\"\n [governed]=\"isGoverned()\"\n (activate)=\"onCardActivate()\"\n (segmentActivate)=\"onSegmentActivate($event)\"\n (retry)=\"onCardRetry()\"\n (openProvenance)=\"onToggleProvenance()\"\n (drillDown)=\"onCardDrillDown()\"\n/>\n\n@if (provenanceOpen() && vm.provenance; as prov) {\n <aside\n #provenancePanel\n class=\"prx-kpi-provenance\"\n popover=\"manual\"\n role=\"region\"\n [attr.aria-label]=\"provenanceHeading()\"\n [style.top.px]=\"provenancePosition()?.top ?? null\"\n [style.left.px]=\"provenancePosition()?.left ?? null\"\n [style.width.px]=\"provenancePosition()?.width ?? null\"\n tabindex=\"-1\"\n (keydown)=\"onProvenanceKeydown($event)\"\n >\n <div class=\"prx-kpi-provenance__header\">\n <span class=\"prx-kpi-provenance__title\">{{ provenanceHeading() }}</span>\n <button\n type=\"button\"\n class=\"prx-kpi-provenance__close\"\n [attr.aria-label]=\"provenanceCloseLabel()\"\n (click)=\"closeProvenance()\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n </div>\n\n <dl class=\"prx-kpi-provenance__list\">\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceResourceLabel() }}</dt>\n <dd><code>{{ prov.resourcePath }}</code></dd>\n </div>\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceOperationLabel() }}</dt>\n <dd>{{ formattedProvenanceOperation() }}</dd>\n </div>\n @if (prov.recipeId) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceRecipeLabel() }}</dt>\n <dd>\n <code>{{ prov.recipeId }}</code>\n @if (prov.recipeVersion) {\n <span> \u00B7 v{{ prov.recipeVersion }}</span>\n }\n </dd>\n </div>\n }\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFiltersLabel() }}</dt>\n <dd>{{ formattedProvenanceFilters() }}</dd>\n </div>\n @if (prov.fetchedAt) {\n <div class=\"prx-kpi-provenance__row\">\n <dt>{{ provenanceFetchedLabel() }}</dt>\n <dd><time [attr.datetime]=\"prov.fetchedAt\">{{ formattedProvenanceFetchedAt() }}</time></dd>\n </div>\n }\n </dl>\n\n @if (prov.suppressionNote) {\n <p class=\"prx-kpi-provenance__note\">{{ prov.suppressionNote }}</p>\n }\n </aside>\n}\n", styles: [":host{position:relative;display:flex;flex-direction:column;min-width:0}praxis-kpi-card-view{flex:1 1 auto;height:100%}.prx-kpi-provenance{position:fixed;inset:auto;margin:0;z-index:1200;box-sizing:border-box;min-width:240px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow-y:auto;overflow-x:hidden;padding:.75rem .85rem;border-radius:var(--prx-kpi-card-radius, 12px);border:1px solid var(--prx-kpi-card-border, rgba(15, 23, 42, .14));background:var(--prx-kpi-card-bg, var(--md-sys-color-surface-container-low, #f8fafc));box-shadow:var(--prx-kpi-card-shadow-hover, 0 12px 28px -8px rgba(15, 23, 42, .22));backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);-webkit-backdrop-filter:var(--prx-kpi-card-backdrop-filter, none);font-size:.74rem;line-height:1.4;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.prx-kpi-provenance__title{font-weight:600;color:var(--prx-micro-text-color, inherit)}.prx-kpi-provenance__close{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--prx-micro-label-color, #4b5563);cursor:pointer}.prx-kpi-provenance__close:focus-visible{outline:2px solid var(--prx-kpi-card-focus-ring, #006a6a);outline-offset:2px}.prx-kpi-provenance__close mat-icon{width:1rem;height:1rem;font-size:1rem;line-height:1rem}.prx-kpi-provenance__list{display:grid;gap:.25rem;margin:0}.prx-kpi-provenance__row{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}.prx-kpi-provenance__row dt{margin:0;font-weight:600;color:var(--prx-micro-label-color, #4b5563);flex:0 0 auto}.prx-kpi-provenance__row dd{margin:0;text-align:right;word-break:break-word}.prx-kpi-provenance__row code{font-size:.7rem}.prx-kpi-provenance__note{margin:.45rem 0 0;padding-top:.35rem;border-top:1px dashed var(--prx-kpi-card-border, rgba(15, 23, 42, .14));color:var(--prx-micro-tone-warning-text, #92400e);font-weight:500}\n"] }]
|
|
18356
18826
|
}], ctorParameters: () => [], propDecorators: { card: [{ type: i0.Input, args: [{ isSignal: true, alias: "card", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], queryContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryContext", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], scopeKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "scopeKey", required: false }] }], showProvenance: [{ type: i0.Input, args: [{ isSignal: true, alias: "showProvenance", required: false }] }], analytics: [{ type: i0.Input, args: [{ isSignal: true, alias: "analytics", required: false }] }], crossFilter: [{ type: i0.Output, args: ["crossFilter"] }], drillDown: [{ type: i0.Output, args: ["drillDown"] }], cardAction: [{ type: i0.Output, args: ["cardAction"] }], provenancePanel: [{ type: i0.ViewChild, args: ['provenancePanel', { isSignal: true }] }] } });
|
|
18357
18827
|
|
|
18358
18828
|
const DEFAULT_PAGE_SCOPE_KEY = 'default';
|
|
@@ -30900,18 +31370,19 @@ class EChartsOptionBuilderService {
|
|
|
30900
31370
|
const hasChartTitle = this.hasText(config.title) || this.hasText(config.subtitle);
|
|
30901
31371
|
const labelsVisible = config.series[0]?.labels?.visible ?? transformed.slices.length <= 4;
|
|
30902
31372
|
const titledRadius = config.type === 'donut'
|
|
30903
|
-
? labelsVisible ? ['
|
|
30904
|
-
: labelsVisible ? '
|
|
31373
|
+
? labelsVisible ? ['30%', '48%'] : ['38%', '56%']
|
|
31374
|
+
: labelsVisible ? '48%' : '56%';
|
|
30905
31375
|
const pieLabelLayout = this.resolveSeriesLabelLayout(config, false);
|
|
30906
31376
|
const pieSeries = {
|
|
30907
31377
|
id: config.series[0]?.id,
|
|
30908
31378
|
type: 'pie',
|
|
30909
31379
|
universalTransition,
|
|
31380
|
+
...(labelsVisible ? { left: '4%', right: '4%' } : {}),
|
|
30910
31381
|
radius: hasChartTitle
|
|
30911
31382
|
? titledRadius
|
|
30912
31383
|
: config.type === 'donut'
|
|
30913
|
-
? labelsVisible ? ['
|
|
30914
|
-
: labelsVisible ? '
|
|
31384
|
+
? labelsVisible ? ['30%', '48%'] : ['42%', '64%']
|
|
31385
|
+
: labelsVisible ? '48%' : '66%',
|
|
30915
31386
|
center: ['50%', hasChartTitle ? '58%' : '50%'],
|
|
30916
31387
|
avoidLabelOverlap: true,
|
|
30917
31388
|
...(pieLabelLayout ? { labelLayout: pieLabelLayout } : {}),
|
|
@@ -30919,7 +31390,8 @@ class EChartsOptionBuilderService {
|
|
|
30919
31390
|
show: labelsVisible,
|
|
30920
31391
|
color: textColor,
|
|
30921
31392
|
overflow: 'truncate',
|
|
30922
|
-
|
|
31393
|
+
ellipsis: '…',
|
|
31394
|
+
width: 96,
|
|
30923
31395
|
formatter: labelsVisible
|
|
30924
31396
|
? (params) => {
|
|
30925
31397
|
const formatted = this.formatValue(params.value, config.series[0]?.labels?.format);
|
|
@@ -30928,7 +31400,7 @@ class EChartsOptionBuilderService {
|
|
|
30928
31400
|
: undefined,
|
|
30929
31401
|
},
|
|
30930
31402
|
labelLine: labelsVisible
|
|
30931
|
-
? { show: true, length:
|
|
31403
|
+
? { show: true, length: 10, length2: 8, lineStyle: { color: textColor } }
|
|
30932
31404
|
: { show: false },
|
|
30933
31405
|
data: transformed.slices.map((slice) => ({
|
|
30934
31406
|
...(slice.data || {}),
|
|
@@ -30967,7 +31439,7 @@ class EChartsOptionBuilderService {
|
|
|
30967
31439
|
funnelAlign: 'center',
|
|
30968
31440
|
left: '6%',
|
|
30969
31441
|
top: this.hasText(config.title) || this.hasText(config.subtitle) ? 88 : 32,
|
|
30970
|
-
bottom: legendVisible ? 56 :
|
|
31442
|
+
bottom: legendVisible ? 56 : 28,
|
|
30971
31443
|
width: '56%',
|
|
30972
31444
|
minSize: '0%',
|
|
30973
31445
|
maxSize: '100%',
|
|
@@ -31180,7 +31652,7 @@ class EChartsOptionBuilderService {
|
|
|
31180
31652
|
},
|
|
31181
31653
|
xAxis: {
|
|
31182
31654
|
type: 'category',
|
|
31183
|
-
name: config.axes?.x?.label,
|
|
31655
|
+
name: this.resolveVisibleAxisName(config.axes?.x?.label),
|
|
31184
31656
|
nameTextStyle: { color: textColor },
|
|
31185
31657
|
data: heatmap.xCategories,
|
|
31186
31658
|
nameLocation: 'middle',
|
|
@@ -31196,7 +31668,7 @@ class EChartsOptionBuilderService {
|
|
|
31196
31668
|
},
|
|
31197
31669
|
yAxis: {
|
|
31198
31670
|
type: 'category',
|
|
31199
|
-
name: config.axes?.y?.label,
|
|
31671
|
+
name: this.resolveVisibleAxisName(config.axes?.y?.label),
|
|
31200
31672
|
nameTextStyle: { color: textColor },
|
|
31201
31673
|
data: heatmap.yCategories,
|
|
31202
31674
|
nameLocation: 'middle',
|
|
@@ -31241,6 +31713,7 @@ class EChartsOptionBuilderService {
|
|
|
31241
31713
|
id: series.id,
|
|
31242
31714
|
name: series.name,
|
|
31243
31715
|
type: 'scatter',
|
|
31716
|
+
clip: false,
|
|
31244
31717
|
universalTransition,
|
|
31245
31718
|
yAxisIndex: hasVerticalSecondary && series.axis === 'secondary' ? 1 : 0,
|
|
31246
31719
|
...(labelLayout ? { labelLayout } : {}),
|
|
@@ -31259,14 +31732,19 @@ class EChartsOptionBuilderService {
|
|
|
31259
31732
|
});
|
|
31260
31733
|
const scatterOverlaySeries = this.buildCartesianUncertaintySeries(transformed.series, palette, false, hasVerticalSecondary);
|
|
31261
31734
|
const hasScatterIntervals = this.hasUncertaintyIntervals(transformed);
|
|
31735
|
+
const scatterYType = config.axes?.y?.type ?? 'value';
|
|
31736
|
+
const hasExplicitScatterYBounds = config.axes?.y?.min !== undefined || config.axes?.y?.max !== undefined;
|
|
31262
31737
|
const primaryScatterYAxis = {
|
|
31263
|
-
type:
|
|
31264
|
-
name: config.axes?.y?.label,
|
|
31738
|
+
type: scatterYType,
|
|
31739
|
+
name: this.resolveVisibleAxisName(config.axes?.y?.label),
|
|
31265
31740
|
nameTextStyle: { color: textColor },
|
|
31266
31741
|
nameLocation: 'middle',
|
|
31267
31742
|
nameGap: 40,
|
|
31268
31743
|
min: config.axes?.y?.min,
|
|
31269
31744
|
max: config.axes?.y?.max,
|
|
31745
|
+
...(scatterYType === 'value' && !hasExplicitScatterYBounds
|
|
31746
|
+
? { boundaryGap: ['8%', '8%'] }
|
|
31747
|
+
: {}),
|
|
31270
31748
|
...(primaryBreakConfig ?? {}),
|
|
31271
31749
|
axisLabel: {
|
|
31272
31750
|
show: config.axes?.y?.labels?.visible ?? true,
|
|
@@ -31319,26 +31797,35 @@ class EChartsOptionBuilderService {
|
|
|
31319
31797
|
legend: this.buildLegend(config, legendVisible, 'bottom', textColor),
|
|
31320
31798
|
grid: this.buildGrid(config, { legendVisible }),
|
|
31321
31799
|
...(dataZoom ? { dataZoom } : {}),
|
|
31322
|
-
xAxis: {
|
|
31323
|
-
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31330
|
-
|
|
31331
|
-
|
|
31332
|
-
|
|
31333
|
-
|
|
31334
|
-
|
|
31335
|
-
|
|
31800
|
+
xAxis: (() => {
|
|
31801
|
+
const scatterXType = config.axes?.x?.type ?? 'value';
|
|
31802
|
+
const hasExplicitScatterXBounds = config.axes?.x?.min !== undefined || config.axes?.x?.max !== undefined;
|
|
31803
|
+
return {
|
|
31804
|
+
type: scatterXType,
|
|
31805
|
+
name: this.resolveVisibleAxisName(config.axes?.x?.label),
|
|
31806
|
+
nameTextStyle: { color: textColor },
|
|
31807
|
+
nameLocation: 'middle',
|
|
31808
|
+
nameGap: 32,
|
|
31809
|
+
min: config.axes?.x?.min,
|
|
31810
|
+
max: config.axes?.x?.max,
|
|
31811
|
+
...(scatterXType === 'value' && !hasExplicitScatterXBounds
|
|
31812
|
+
? { boundaryGap: ['8%', '8%'] }
|
|
31813
|
+
: {}),
|
|
31814
|
+
axisLabel: {
|
|
31815
|
+
show: config.axes?.x?.labels?.visible ?? true,
|
|
31816
|
+
color: textColor,
|
|
31817
|
+
rotate: config.axes?.x?.labels?.rotate ?? 0,
|
|
31818
|
+
hideOverlap: true,
|
|
31819
|
+
formatter: this.axisLabelFormatter(config.axes?.x?.labels?.format),
|
|
31820
|
+
},
|
|
31821
|
+
};
|
|
31822
|
+
})(),
|
|
31336
31823
|
yAxis: hasVerticalSecondary && config.axes?.ySecondary
|
|
31337
31824
|
? [
|
|
31338
31825
|
primaryScatterYAxis,
|
|
31339
31826
|
{
|
|
31340
31827
|
type: config.axes.ySecondary.type ?? 'value',
|
|
31341
|
-
name: config.axes.ySecondary.label,
|
|
31828
|
+
name: this.resolveVisibleAxisName(config.axes.ySecondary.label),
|
|
31342
31829
|
nameTextStyle: { color: textColor },
|
|
31343
31830
|
nameLocation: 'middle',
|
|
31344
31831
|
nameGap: 40,
|
|
@@ -31436,9 +31923,12 @@ class EChartsOptionBuilderService {
|
|
|
31436
31923
|
? this.buildHorizontalCartesianValueAxis(config, transformed.series, primaryBreakConfig, hasDualValueAxes)
|
|
31437
31924
|
: {
|
|
31438
31925
|
type: xAxisType,
|
|
31439
|
-
name: config.axes?.x?.label,
|
|
31926
|
+
name: this.resolveVisibleAxisName(config.axes?.x?.label),
|
|
31440
31927
|
nameTextStyle: { color: textColor },
|
|
31441
31928
|
data: xAxisType === 'time' ? undefined : transformed.categories,
|
|
31929
|
+
...(xAxisType === 'time'
|
|
31930
|
+
? this.buildCanonicalTimeAxisScale(config, transformed.series)
|
|
31931
|
+
: {}),
|
|
31442
31932
|
nameLocation: 'middle',
|
|
31443
31933
|
nameGap: 18,
|
|
31444
31934
|
axisLabel: {
|
|
@@ -31462,7 +31952,7 @@ class EChartsOptionBuilderService {
|
|
|
31462
31952
|
yAxis: horizontal
|
|
31463
31953
|
? {
|
|
31464
31954
|
type: config.axes?.x?.type ?? 'category',
|
|
31465
|
-
name: config.axes?.x?.label,
|
|
31955
|
+
name: this.resolveVisibleAxisName(config.axes?.x?.label),
|
|
31466
31956
|
nameTextStyle: { color: textColor },
|
|
31467
31957
|
data: transformed.categories,
|
|
31468
31958
|
...(config.yAxisInverse || config.axes?.x?.inverse || config.axes?.y?.inverse
|
|
@@ -31474,8 +31964,9 @@ class EChartsOptionBuilderService {
|
|
|
31474
31964
|
rotate: config.axes?.x?.labels?.rotate ?? 0,
|
|
31475
31965
|
hideOverlap: true,
|
|
31476
31966
|
overflow: 'truncate',
|
|
31477
|
-
|
|
31478
|
-
|
|
31967
|
+
ellipsis: '…',
|
|
31968
|
+
width: 172,
|
|
31969
|
+
formatter: this.formatHorizontalCategoryLabels(transformed.categories, config.axes?.x?.labels?.format),
|
|
31479
31970
|
},
|
|
31480
31971
|
}
|
|
31481
31972
|
: this.buildCartesianYAxis(config, primaryBreakConfig, hasDualValueAxes, transformed.series),
|
|
@@ -31779,7 +32270,7 @@ class EChartsOptionBuilderService {
|
|
|
31779
32270
|
const textColor = this.resolveTextColor(config);
|
|
31780
32271
|
const primaryAxis = {
|
|
31781
32272
|
type: config.axes?.y?.type ?? 'value',
|
|
31782
|
-
name: config.axes?.y?.label,
|
|
32273
|
+
name: this.resolveVisibleAxisName(config.axes?.y?.label),
|
|
31783
32274
|
nameTextStyle: { color: textColor },
|
|
31784
32275
|
nameLocation: 'middle',
|
|
31785
32276
|
nameGap: 40,
|
|
@@ -31804,7 +32295,7 @@ class EChartsOptionBuilderService {
|
|
|
31804
32295
|
primaryAxis,
|
|
31805
32296
|
{
|
|
31806
32297
|
type: secondaryAxisCfg?.type ?? 'value',
|
|
31807
|
-
name: secondaryAxisCfg?.label ?? secondarySeries?.name,
|
|
32298
|
+
name: this.resolveVisibleAxisName(secondaryAxisCfg?.label ?? secondarySeries?.name),
|
|
31808
32299
|
nameTextStyle: { color: textColor },
|
|
31809
32300
|
nameLocation: 'middle',
|
|
31810
32301
|
nameGap: 40,
|
|
@@ -31824,7 +32315,7 @@ class EChartsOptionBuilderService {
|
|
|
31824
32315
|
const textColor = this.resolveTextColor(config);
|
|
31825
32316
|
const primaryAxis = {
|
|
31826
32317
|
type: config.axes?.y?.type ?? 'value',
|
|
31827
|
-
name: config.axes?.y?.label,
|
|
32318
|
+
name: this.resolveVisibleAxisName(config.axes?.y?.label),
|
|
31828
32319
|
nameTextStyle: { color: textColor },
|
|
31829
32320
|
nameLocation: 'middle',
|
|
31830
32321
|
nameGap: 32,
|
|
@@ -31849,7 +32340,7 @@ class EChartsOptionBuilderService {
|
|
|
31849
32340
|
primaryAxis,
|
|
31850
32341
|
{
|
|
31851
32342
|
type: secondaryAxisCfg?.type ?? 'value',
|
|
31852
|
-
name: secondaryAxisCfg?.label ?? secondarySeries?.name,
|
|
32343
|
+
name: this.resolveVisibleAxisName(secondaryAxisCfg?.label ?? secondarySeries?.name),
|
|
31853
32344
|
nameTextStyle: { color: textColor },
|
|
31854
32345
|
nameLocation: 'middle',
|
|
31855
32346
|
nameGap: 32,
|
|
@@ -31966,6 +32457,135 @@ class EChartsOptionBuilderService {
|
|
|
31966
32457
|
return config.axes?.x?.type === 'time'
|
|
31967
32458
|
|| config.dataSource.query.statsOperation === 'timeseries';
|
|
31968
32459
|
}
|
|
32460
|
+
buildCanonicalTimeAxisScale(config, series) {
|
|
32461
|
+
const DAY_MS = 86_400_000;
|
|
32462
|
+
const rawValues = [];
|
|
32463
|
+
let rowGranularity;
|
|
32464
|
+
for (const entry of series) {
|
|
32465
|
+
for (const point of entry.points) {
|
|
32466
|
+
if (Array.isArray(point)) {
|
|
32467
|
+
if (point.length > 0 && point[0] !== null && point[0] !== undefined && point[0] !== '') {
|
|
32468
|
+
rawValues.push(point[0]);
|
|
32469
|
+
}
|
|
32470
|
+
continue;
|
|
32471
|
+
}
|
|
32472
|
+
if (point && typeof point === 'object') {
|
|
32473
|
+
const record = point;
|
|
32474
|
+
if (!rowGranularity && typeof record['granularity'] === 'string' && record['granularity'].trim()) {
|
|
32475
|
+
rowGranularity = record['granularity'];
|
|
32476
|
+
}
|
|
32477
|
+
const tuple = record['value'];
|
|
32478
|
+
if (Array.isArray(tuple) && tuple.length > 0 && tuple[0] !== null && tuple[0] !== undefined && tuple[0] !== '') {
|
|
32479
|
+
rawValues.push(tuple[0]);
|
|
32480
|
+
}
|
|
32481
|
+
}
|
|
32482
|
+
}
|
|
32483
|
+
}
|
|
32484
|
+
const query = config.dataSource?.kind === 'remote' ? config.dataSource.query : undefined;
|
|
32485
|
+
const statsRequestGranularity = query?.statsRequest && typeof query.statsRequest === 'object'
|
|
32486
|
+
? query.statsRequest['granularity']
|
|
32487
|
+
: undefined;
|
|
32488
|
+
let granularity = (typeof query?.granularity === 'string'
|
|
32489
|
+
? query.granularity
|
|
32490
|
+
: typeof statsRequestGranularity === 'string'
|
|
32491
|
+
? statsRequestGranularity
|
|
32492
|
+
: rowGranularity)
|
|
32493
|
+
?.trim()
|
|
32494
|
+
.toLowerCase();
|
|
32495
|
+
if (!granularity && this.usesCanonicalStatsTime(config) && rawValues.length > 0) {
|
|
32496
|
+
const stringValues = rawValues
|
|
32497
|
+
.filter((value) => typeof value === 'string')
|
|
32498
|
+
.map((value) => value.trim())
|
|
32499
|
+
.filter((value) => value.length > 0);
|
|
32500
|
+
if (stringValues.length === rawValues.length &&
|
|
32501
|
+
stringValues.every((value) => /^\d{4}-\d{2}(-\d{2})?$/.test(value))) {
|
|
32502
|
+
granularity = stringValues.every((value) => /^\d{4}-\d{2}$/.test(value)) ? 'month' : 'day';
|
|
32503
|
+
}
|
|
32504
|
+
}
|
|
32505
|
+
const minIntervalByGranularity = {
|
|
32506
|
+
day: DAY_MS,
|
|
32507
|
+
week: 7 * DAY_MS,
|
|
32508
|
+
month: 28 * DAY_MS,
|
|
32509
|
+
quarter: 89 * DAY_MS,
|
|
32510
|
+
year: 365 * DAY_MS,
|
|
32511
|
+
};
|
|
32512
|
+
const minInterval = granularity ? minIntervalByGranularity[granularity] : undefined;
|
|
32513
|
+
const parseTimeMs = (raw) => {
|
|
32514
|
+
if (typeof raw === 'number') {
|
|
32515
|
+
return Number.isFinite(raw) ? raw : null;
|
|
32516
|
+
}
|
|
32517
|
+
if (raw instanceof Date) {
|
|
32518
|
+
const ms = raw.getTime();
|
|
32519
|
+
return Number.isFinite(ms) ? ms : null;
|
|
32520
|
+
}
|
|
32521
|
+
if (typeof raw !== 'string') {
|
|
32522
|
+
return null;
|
|
32523
|
+
}
|
|
32524
|
+
const text = raw.trim();
|
|
32525
|
+
if (!text) {
|
|
32526
|
+
return null;
|
|
32527
|
+
}
|
|
32528
|
+
const ymMatch = /^(\d{4})-(\d{2})$/.exec(text);
|
|
32529
|
+
if (ymMatch) {
|
|
32530
|
+
return Date.UTC(Number(ymMatch[1]), Number(ymMatch[2]) - 1, 1);
|
|
32531
|
+
}
|
|
32532
|
+
const ymdMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(text);
|
|
32533
|
+
if (ymdMatch) {
|
|
32534
|
+
return Date.UTC(Number(ymdMatch[1]), Number(ymdMatch[2]) - 1, Number(ymdMatch[3]));
|
|
32535
|
+
}
|
|
32536
|
+
const parsed = Date.parse(text);
|
|
32537
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
32538
|
+
};
|
|
32539
|
+
const uniqueTimestamps = Array.from(new Set(rawValues
|
|
32540
|
+
.map(parseTimeMs)
|
|
32541
|
+
.filter((ms) => ms !== null && Number.isFinite(ms))));
|
|
32542
|
+
const explicitMin = config.axes?.x?.min;
|
|
32543
|
+
const explicitMax = config.axes?.x?.max;
|
|
32544
|
+
let singlePointMin;
|
|
32545
|
+
let singlePointMax;
|
|
32546
|
+
if (uniqueTimestamps.length === 1 &&
|
|
32547
|
+
granularity &&
|
|
32548
|
+
explicitMin === undefined &&
|
|
32549
|
+
explicitMax === undefined) {
|
|
32550
|
+
const ts = uniqueTimestamps[0];
|
|
32551
|
+
const utcDate = new Date(ts);
|
|
32552
|
+
switch (granularity) {
|
|
32553
|
+
case 'month':
|
|
32554
|
+
singlePointMin = Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth() - 1, 1);
|
|
32555
|
+
singlePointMax = Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth() + 1, 1);
|
|
32556
|
+
break;
|
|
32557
|
+
case 'quarter':
|
|
32558
|
+
singlePointMin = Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth() - 3, 1);
|
|
32559
|
+
singlePointMax = Date.UTC(utcDate.getUTCFullYear(), utcDate.getUTCMonth() + 3, 1);
|
|
32560
|
+
break;
|
|
32561
|
+
case 'year':
|
|
32562
|
+
singlePointMin = Date.UTC(utcDate.getUTCFullYear() - 1, 0, 1);
|
|
32563
|
+
singlePointMax = Date.UTC(utcDate.getUTCFullYear() + 1, 0, 1);
|
|
32564
|
+
break;
|
|
32565
|
+
case 'week':
|
|
32566
|
+
singlePointMin = ts - 7 * DAY_MS;
|
|
32567
|
+
singlePointMax = ts + 7 * DAY_MS;
|
|
32568
|
+
break;
|
|
32569
|
+
case 'day':
|
|
32570
|
+
singlePointMin = ts - DAY_MS;
|
|
32571
|
+
singlePointMax = ts + DAY_MS;
|
|
32572
|
+
break;
|
|
32573
|
+
}
|
|
32574
|
+
}
|
|
32575
|
+
return {
|
|
32576
|
+
...(minInterval !== undefined ? { minInterval } : {}),
|
|
32577
|
+
...(explicitMin !== undefined
|
|
32578
|
+
? { min: explicitMin }
|
|
32579
|
+
: singlePointMin !== undefined
|
|
32580
|
+
? { min: singlePointMin }
|
|
32581
|
+
: {}),
|
|
32582
|
+
...(explicitMax !== undefined
|
|
32583
|
+
? { max: explicitMax }
|
|
32584
|
+
: singlePointMax !== undefined
|
|
32585
|
+
? { max: singlePointMax }
|
|
32586
|
+
: {}),
|
|
32587
|
+
};
|
|
32588
|
+
}
|
|
31969
32589
|
formatCanonicalTimeTooltip(params, config) {
|
|
31970
32590
|
const items = (Array.isArray(params) ? params : [params])
|
|
31971
32591
|
.filter((item) => !!item && typeof item === 'object')
|
|
@@ -32035,6 +32655,25 @@ class EChartsOptionBuilderService {
|
|
|
32035
32655
|
: escapeTooltipHtml(valueText);
|
|
32036
32656
|
return [escapeTooltipHtml(header), line].filter(Boolean).join('<br/>');
|
|
32037
32657
|
}
|
|
32658
|
+
resolveVisibleAxisName(label) {
|
|
32659
|
+
const text = this.nonEmptyText(label);
|
|
32660
|
+
if (!text) {
|
|
32661
|
+
return undefined;
|
|
32662
|
+
}
|
|
32663
|
+
if (/[^a-zA-Z0-9_]/.test(text)) {
|
|
32664
|
+
return text;
|
|
32665
|
+
}
|
|
32666
|
+
if (/^[a-z][a-zA-Z0-9]*[A-Z][a-zA-Z0-9]*$/.test(text) || /^[a-z0-9]+_[a-z0-9_]+$/.test(text)) {
|
|
32667
|
+
return text
|
|
32668
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
32669
|
+
.replace(/_+/g, ' ')
|
|
32670
|
+
.trim()
|
|
32671
|
+
.split(/\s+/)
|
|
32672
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
32673
|
+
.join(' ');
|
|
32674
|
+
}
|
|
32675
|
+
return text;
|
|
32676
|
+
}
|
|
32038
32677
|
nonEmptyText(value) {
|
|
32039
32678
|
if (value === null || value === undefined) {
|
|
32040
32679
|
return undefined;
|
|
@@ -32048,6 +32687,26 @@ class EChartsOptionBuilderService {
|
|
|
32048
32687
|
axisLabelFormatter(format) {
|
|
32049
32688
|
return format ? (value) => this.formatValue(value, format) : undefined;
|
|
32050
32689
|
}
|
|
32690
|
+
formatHorizontalCategoryLabels(categories, format, maxLen = 26) {
|
|
32691
|
+
const base = this.axisLabelFormatter(format);
|
|
32692
|
+
const formatted = categories.map((cat) => (base ? base(cat) : String(cat ?? '')));
|
|
32693
|
+
const uniqueLabels = new Set(formatted);
|
|
32694
|
+
const truncatedPrefixes = new Set(formatted.map((label) => (label.length > maxLen ? label.slice(0, maxLen - 3) : label)));
|
|
32695
|
+
if (uniqueLabels.size <= 1 || truncatedPrefixes.size >= uniqueLabels.size) {
|
|
32696
|
+
return base;
|
|
32697
|
+
}
|
|
32698
|
+
const headLen = 11;
|
|
32699
|
+
const tailLen = Math.max(8, maxLen - headLen - 1);
|
|
32700
|
+
return (value) => {
|
|
32701
|
+
const label = base ? base(value) : String(value ?? '');
|
|
32702
|
+
if (label.length <= maxLen) {
|
|
32703
|
+
return label;
|
|
32704
|
+
}
|
|
32705
|
+
const head = label.slice(0, headLen).trimEnd();
|
|
32706
|
+
const tail = label.slice(label.length - tailLen).trimStart();
|
|
32707
|
+
return `${head}…${tail}`;
|
|
32708
|
+
};
|
|
32709
|
+
}
|
|
32051
32710
|
resolveValueLocale() {
|
|
32052
32711
|
return this.i18n?.getLocale?.()?.trim() || DEFAULT_VALUE_LOCALE;
|
|
32053
32712
|
}
|
|
@@ -32601,9 +33260,10 @@ class EChartsOptionBuilderService {
|
|
|
32601
33260
|
const matchingLines = (config.referenceLines ?? [])
|
|
32602
33261
|
.filter((line) => (line.axis === 'ySecondary' ? isSecondaryHost : isPrimaryHost));
|
|
32603
33262
|
const lineItems = matchingLines.map((line, lineIndex) => this.toEChartsMarkLineData(line, horizontal, textColor, lineIndex, matchingLines.length));
|
|
33263
|
+
const hasYReferenceLines = matchingLines.some((line) => line.axis !== 'x');
|
|
32604
33264
|
const areaItems = (config.referenceBands ?? [])
|
|
32605
33265
|
.filter((band) => (band.axis === 'ySecondary' ? isSecondaryHost : isPrimaryHost))
|
|
32606
|
-
.map((band) => this.toEChartsMarkAreaData(band, horizontal, textColor));
|
|
33266
|
+
.map((band) => this.toEChartsMarkAreaData(band, horizontal, textColor, hasYReferenceLines));
|
|
32607
33267
|
const pointItems = (config.targetMarkers ?? [])
|
|
32608
33268
|
.filter((marker) => {
|
|
32609
33269
|
if (marker.emphasis === 'pulse') {
|
|
@@ -32675,11 +33335,12 @@ class EChartsOptionBuilderService {
|
|
|
32675
33335
|
},
|
|
32676
33336
|
};
|
|
32677
33337
|
}
|
|
32678
|
-
toEChartsMarkAreaData(band, horizontal, textColor) {
|
|
33338
|
+
toEChartsMarkAreaData(band, horizontal, textColor, hasYReferenceLines = false) {
|
|
32679
33339
|
const labelText = this.resolveText(band.label);
|
|
32680
33340
|
const targetEChartsAxis = horizontal
|
|
32681
33341
|
? (band.axis === 'x' ? 'yAxis' : 'xAxis')
|
|
32682
33342
|
: (band.axis === 'x' ? 'xAxis' : 'yAxis');
|
|
33343
|
+
const clearTopLine = !horizontal && band.axis === 'x' && hasYReferenceLines;
|
|
32683
33344
|
return [
|
|
32684
33345
|
{
|
|
32685
33346
|
name: labelText ?? `${band.min}–${band.max}`,
|
|
@@ -32691,7 +33352,8 @@ class EChartsOptionBuilderService {
|
|
|
32691
33352
|
label: {
|
|
32692
33353
|
show: Boolean(labelText),
|
|
32693
33354
|
color: textColor,
|
|
32694
|
-
position: 'insideTopLeft',
|
|
33355
|
+
position: clearTopLine ? 'insideTop' : 'insideTopLeft',
|
|
33356
|
+
...(clearTopLine ? { distance: 22 } : {}),
|
|
32695
33357
|
},
|
|
32696
33358
|
},
|
|
32697
33359
|
{
|
|
@@ -50337,7 +50999,7 @@ class PraxisKpiCardConfigEditorComponent {
|
|
|
50337
50999
|
return tokenLocale || 'pt-BR';
|
|
50338
51000
|
}
|
|
50339
51001
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisKpiCardConfigEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50340
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisKpiCardConfigEditorComponent, isStandalone: true, selector: "praxis-kpi-card-config-editor", inputs: { spec: "spec", embeddedInStrip: "embeddedInStrip", queryContext: "queryContext", allowGovernanceEditing: "allowGovernanceEditing" }, outputs: { specChange: "specChange", validationChange: "validationChange" }, providers: [providePraxisChartsI18n()], usesOnChanges: true, ngImport: i0, template: "@let card = draftSpec();\n@let simVm = simulatedViewModel();\n@let validation = validationResult();\n@let resDetails = resourceDetails();\n\n<section class=\"prx-kpi-editor\" data-testid=\"kpi-card-config-editor\">\n <div class=\"prx-kpi-editor__preview-panel\">\n <div class=\"prx-kpi-editor__preview-header\">\n <div class=\"prx-kpi-editor__preview-heading\">\n <strong>{{ t('praxis.charts.kpiEditor.preview.title', 'Live preview') }}</strong>\n <span class=\"prx-kpi-editor__preview-hint\">\n {{\n t(\n 'praxis.charts.kpiEditor.preview.simulatorHint',\n 'Editor preview only; no simulated payload is ever persisted.'\n )\n }}\n </span>\n </div>\n\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"prx-kpi-editor__sim-select\"\n >\n <mat-label>\n {{ t('praxis.charts.kpiEditor.preview.simulatorLabel', 'Epistemic / k-anonymity simulator') }}\n </mat-label>\n <mat-select\n data-testid=\"kpi-simulator-mode\"\n [ngModel]=\"simulationMode()\"\n (ngModelChange)=\"simulationMode.set($event)\"\n >\n @for (mode of simulationModes; track mode) {\n <mat-option [value]=\"mode\">{{ simulationModeLabel(mode) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class=\"prx-kpi-editor__preview-stage\" data-testid=\"kpi-editor-preview-stage\">\n @if (simulationMode() === 'live') {\n <praxis-kpi-card\n [card]=\"card\"\n [queryContext]=\"queryContext\"\n density=\"compact\"\n [showProvenance]=\"false\"\n />\n } @else if (simVm) {\n <praxis-kpi-card-view\n [viewModel]=\"simVm\"\n density=\"compact\"\n [allowRetry]=\"false\"\n [allowDrillDown]=\"false\"\n [showProvenance]=\"false\"\n />\n }\n </div>\n </div>\n\n @if (isFullLocked()) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--locked\" role=\"status\" data-testid=\"kpi-lock-banner\">\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\n <span>\n {{\n t(\n 'praxis.charts.kpiEditor.lock.full',\n 'Indicator locked by corporate governance (read-only).'\n )\n }}\n </span>\n </div>\n } @else if (isMetricLocked()) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--warn\" role=\"status\" data-testid=\"kpi-lock-banner\">\n <mat-icon aria-hidden=\"true\">verified_user</mat-icon>\n <span>\n {{\n t(\n 'praxis.charts.kpiEditor.lock.metricLocked',\n 'Metric locked by corporate governance: edit presentation, targets, thresholds, and interactions only.'\n )\n }}\n </span>\n </div>\n }\n\n @if (catalogDiagnostics().length > 0) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--error\" role=\"status\" data-testid=\"kpi-catalog-diagnostics\">\n <div class=\"prx-kpi-editor__banner-content\">\n @for (diag of catalogDiagnostics(); track diag.code + (diag.resourcePath ?? '')) {\n <div>{{ diag.message }} (<code>{{ diag.code }}</code>)</div>\n }\n </div>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-catalog-retry-btn\"\n (click)=\"reloadCatalog()\"\n >\n {{ t('praxis.charts.kpiEditor.catalog.retry', 'Retry catalog load') }}\n </button>\n </div>\n }\n\n @if (!validation.valid) {\n <ul class=\"prx-kpi-editor__errors\" role=\"alert\" data-testid=\"kpi-card-validation-errors\">\n @for (code of validation.errorCodes; track code) {\n <li>{{ validationMessage(code) }}</li>\n }\n </ul>\n }\n\n <div\n class=\"prx-kpi-editor__tabs\"\n role=\"tablist\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.cardSettingsTitle', 'Executive KPI Card \u2014 Settings')\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n class=\"prx-kpi-editor__tab\"\n [class.prx-kpi-editor__tab--active]=\"activeTab() === 'analyst'\"\n [attr.aria-selected]=\"activeTab() === 'analyst'\"\n data-testid=\"kpi-tab-analyst\"\n (click)=\"setTab('analyst')\"\n >\n {{ t('praxis.charts.kpiEditor.tabs.analyst', 'Presentation & Targets') }}\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"prx-kpi-editor__tab\"\n [class.prx-kpi-editor__tab--active]=\"activeTab() === 'curator'\"\n [attr.aria-selected]=\"activeTab() === 'curator'\"\n data-testid=\"kpi-tab-curator\"\n (click)=\"setTab('curator')\"\n >\n {{ t('praxis.charts.kpiEditor.tabs.curator', 'Source & Derivation (BI)') }}\n </button>\n </div>\n\n @if (activeTab() === 'analyst') {\n <div role=\"tabpanel\" class=\"prx-kpi-editor__panel\" data-testid=\"kpi-panel-analyst\">\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.presentation.section', 'Identity & formatting') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.label', 'Indicator label') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-label\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentLabelText()\"\n (ngModelChange)=\"updateLabel($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.icon', 'Material icon (snake_case)') }}</mat-label>\n <mat-icon matPrefix class=\"prx-kpi-editor__icon-preview\" aria-hidden=\"true\">\n {{ card.presentation.icon || 'insights' }}\n </mat-icon>\n <input\n matInput\n data-testid=\"kpi-field-icon\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.icon ?? ''\"\n (ngModelChange)=\"updateIcon($event)\"\n />\n <div matSuffix class=\"prx-kpi-editor__icon-actions\">\n @if (card.presentation.icon && !isFullLocked()) {\n <button\n mat-icon-button\n type=\"button\"\n data-testid=\"kpi-field-icon-clear\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.presentation.clearIcon', 'Clear icon')\"\n (click)=\"updateIcon('')\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n type=\"button\"\n data-testid=\"kpi-field-icon-picker\"\n [disabled]=\"isFullLocked()\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.presentation.openIconPicker', 'Open visual icon picker')\"\n (click)=\"openIconPicker()\"\n >\n <mat-icon aria-hidden=\"true\">apps</mat-icon>\n </button>\n </div>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.tone', 'Semantic tone') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-tone\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.tone ?? 'neutral'\"\n (ngModelChange)=\"updateTone($event)\"\n >\n <mat-select-trigger>\n <span class=\"prx-kpi-editor__tone-option\">\n <span\n class=\"prx-kpi-editor__tone-swatch\"\n [attr.data-tone]=\"card.presentation.tone ?? 'neutral'\"\n ></span>\n <span>{{ toneLabel(card.presentation.tone ?? 'neutral') }}</span>\n </span>\n </mat-select-trigger>\n @for (tone of presentationTones; track tone) {\n <mat-option [value]=\"tone\">\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"tone\"></span>\n <span>{{ toneLabel(tone) }}</span>\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.format', 'Value format') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-format\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.format\"\n (ngModelChange)=\"updateFormat($event)\"\n >\n @for (fmt of formatOptions; track fmt) {\n <mat-option [value]=\"fmt\">{{ formatLabel(fmt) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (\n card.presentation.format === 'currency' ||\n card.presentation.format === 'compact-currency'\n ) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.currencyCode', 'Currency (ISO 4217)') }}</mat-label>\n <input\n matInput\n maxlength=\"3\"\n data-testid=\"kpi-field-currency\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.currencyCode ?? 'BRL'\"\n (ngModelChange)=\"updateCurrencyCode($event)\"\n />\n </mat-form-field>\n }\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.decimals', 'Decimal places') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"0\"\n max=\"4\"\n data-testid=\"kpi-field-decimals\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.decimals ?? 1\"\n (ngModelChange)=\"updateDecimals($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.polarity', 'Executive polarity') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-polarity\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.polarity ?? 'higher-is-better'\"\n (ngModelChange)=\"updatePolarity($event)\"\n >\n @for (pol of polarityOptions; track pol) {\n <mat-option [value]=\"pol\">{{ polarityLabel(pol) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.unitSingular', 'Unit label (singular)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-unit-singular\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentUnitSingular()\"\n (ngModelChange)=\"updateUnitLabel($event, currentUnitPlural())\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.unitPlural', 'Unit label (plural)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-unit-plural\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentUnitPlural()\"\n (ngModelChange)=\"updateUnitLabel(currentUnitSingular(), $event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.badgeTemplate', 'Badge template') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-badge-template\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.badgeTemplate ?? 'auto'\"\n (ngModelChange)=\"updateBadgeTemplate($event)\"\n >\n @for (tpl of badgeTemplateOptions; track tpl) {\n <mat-option [value]=\"tpl\">{{ badgeTemplateLabel(tpl) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.badgeContextLabel', 'Badge context text') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-badge-context\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentBadgeContext()\"\n (ngModelChange)=\"updateBadgeContextLabel($event)\"\n />\n </mat-form-field>\n </div>\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.visualization.section', 'Micro-visualization, target & thresholds') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.kind', 'Micro-visualization type') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-viz-kind\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.kind ?? compatibleVisualizations()[0]\"\n (ngModelChange)=\"updateVisualizationKind($event)\"\n >\n @for (kind of compatibleVisualizations(); track kind) {\n <mat-option [value]=\"kind\">{{ visualizationLabel(kind) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (\n card.visualization?.kind === 'bullet' ||\n card.visualization?.kind === 'radial' ||\n card.visualization?.kind === 'harveyBall'\n ) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.target', 'Target / reference value') }}</mat-label>\n <input\n matInput\n type=\"number\"\n data-testid=\"kpi-field-viz-target\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.target ?? null\"\n (ngModelChange)=\"updateTarget($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.targetLabel', 'Target label') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-viz-target-label\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentTargetLabel()\"\n (ngModelChange)=\"updateTargetLabel($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.scaleMode', 'Scale mode') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-viz-scale-mode\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.scaleMode ?? 'fixed-100'\"\n (ngModelChange)=\"updateScaleMode($event)\"\n >\n <mat-option value=\"fixed-100\">\n {{ t('praxis.charts.kpiEditor.visualization.scaleFixed100', 'Fixed (0\u2013100%)') }}\n </mat-option>\n <mat-option value=\"auto-max\">\n {{ t('praxis.charts.kpiEditor.visualization.scaleAutoMax', 'Dynamic (auto-max)') }}\n </mat-option>\n <mat-option value=\"population-total\">\n {{\n t(\n 'praxis.charts.kpiEditor.visualization.scalePopulationTotal',\n 'Population total share'\n )\n }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n }\n\n @if (card.visualization?.kind === 'stackedBar') {\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-field-viz-legend\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.showLegend ?? true\"\n (ngModelChange)=\"updateShowLegend($event)\"\n >\n {{ t('praxis.charts.kpiEditor.visualization.showLegend', 'Show segment legend') }}\n </mat-slide-toggle>\n </div>\n }\n </div>\n\n <div class=\"prx-kpi-editor__sublist\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <span>{{ t('praxis.charts.kpiEditor.visualization.thresholds', 'Alert bands (thresholds)') }}</span>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-add-threshold-btn\"\n [disabled]=\"isFullLocked() || (card.visualization?.thresholds?.length ?? 0) >= 6\"\n (click)=\"addThreshold()\"\n >\n {{ t('praxis.charts.kpiEditor.visualization.addThreshold', 'Add threshold') }}\n </button>\n </div>\n\n @for (band of card.visualization?.thresholds ?? []; track $index) {\n <div class=\"prx-kpi-editor__row\" data-testid=\"kpi-threshold-row\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdMin', 'Min') }}</mat-label>\n <input\n matInput\n type=\"number\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.min ?? null\"\n (ngModelChange)=\"updateThreshold($index, { min: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdMax', 'Max') }}</mat-label>\n <input\n matInput\n type=\"number\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.max\"\n (ngModelChange)=\"updateThreshold($index, { max: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdTone', 'Tone') }}</mat-label>\n <mat-select\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.tone\"\n (ngModelChange)=\"updateThreshold($index, { tone: $event })\"\n >\n <mat-select-trigger>\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"band.tone\"></span>\n <span>{{ toneLabel(band.tone) }}</span>\n </span>\n </mat-select-trigger>\n @for (tone of thresholdTones; track tone) {\n <mat-option [value]=\"tone\">\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"tone\"></span>\n <span>{{ toneLabel(tone) }}</span>\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.visualization.removeThreshold', 'Remove threshold')\"\n [disabled]=\"isFullLocked()\"\n (click)=\"removeThreshold($index)\"\n >\n <mat-icon aria-hidden=\"true\">delete_outline</mat-icon>\n </button>\n </div>\n }\n </div>\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.interaction.section', 'Interactions & cross-filtering') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-toggle-cross-filter\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"!!card.interaction?.crossFilter\"\n (ngModelChange)=\"toggleCrossFilter($event)\"\n >\n {{ t('praxis.charts.kpiEditor.interaction.enableCrossFilter', 'Apply cross-filter on card click') }}\n </mat-slide-toggle>\n </div>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.filterReactionMode', 'Reaction to external cross-filters') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-filter-reaction\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.interaction?.filterReaction?.mode ?? 'all-except-own-dimension'\"\n (ngModelChange)=\"updateFilterReactionMode($event)\"\n >\n <mat-option value=\"all-except-own-dimension\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionAllExceptOwn', 'All except own dimension (anti-feedback-loop)') }}\n </mat-option>\n <mat-option value=\"page-scope-only\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionPageScopeOnly', 'Page scope filters only') }}\n </mat-option>\n <mat-option value=\"all-cross-filters\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionAll', 'All cross-filters') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.interaction?.crossFilter; as cf) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.crossFilterField', 'Filter field (FilterDTO)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-cf-field\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"cf.field\"\n (ngModelChange)=\"updateCrossFilterField($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.crossFilterValues', 'Filter values') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-cf-values\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"formatScalarList(cf.values)\"\n (ngModelChange)=\"updateCrossFilterValues($event)\"\n />\n </mat-form-field>\n }\n\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-toggle-drill-down\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"!!card.interaction?.drillDown\"\n (ngModelChange)=\"toggleDrillDown($event)\"\n >\n {{ t('praxis.charts.kpiEditor.interaction.enableDrillDown', 'Enable drill-down action') }}\n </mat-slide-toggle>\n </div>\n\n @if (card.interaction?.drillDown; as dd) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.drillDownResource', 'Target resource') }}</mat-label>\n <input\n matInput\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"dd.resourcePath ?? card.source.resourcePath\"\n (ngModelChange)=\"updateDrillDown({ resourcePath: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.drillDownSurface', 'Target surface id') }}</mat-label>\n <input\n matInput\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"dd.surfaceId ?? ''\"\n (ngModelChange)=\"updateDrillDown({ surfaceId: $event || undefined })\"\n />\n </mat-form-field>\n }\n </div>\n </section>\n </div>\n } @else {\n <div role=\"tabpanel\" class=\"prx-kpi-editor__panel\" data-testid=\"kpi-panel-curator\">\n <section class=\"prx-kpi-editor__section\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.source.section', 'Governed data source') }}\n </h3>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-reload-resource-btn\"\n [disabled]=\"!card.source.resourcePath\"\n (click)=\"reloadResourceDetails()\"\n >\n {{ t('praxis.charts.kpiEditor.catalog.retryResource', 'Reload resource metadata') }}\n </button>\n </div>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.resourcePath', 'Governed resource') }}</mat-label>\n @if (resources().length > 0) {\n <mat-select\n data-testid=\"kpi-field-resource-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.resourcePath\"\n (ngModelChange)=\"onResourcePathChange($event)\"\n >\n @for (res of resources(); track res.id) {\n <mat-option [value]=\"res.path\">{{ res.label }} ({{ res.path }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-resource-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.resourcePath\"\n (ngModelChange)=\"onResourcePathChange($event)\"\n />\n }\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.kind', 'Source mode') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-source-kind\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.kind\"\n (ngModelChange)=\"onSourceKindChange($event)\"\n >\n <mat-option value=\"verified-recipe\">\n {{ t('praxis.charts.kpiEditor.source.verifiedRecipe', 'Verified analytical recipe (Recommended)') }}\n </mat-option>\n <mat-option value=\"analytics-projection\">\n {{ t('praxis.charts.kpiEditor.source.analyticsProjection', 'x-ui.analytics projection') }}\n </mat-option>\n <mat-option value=\"stats-query\">\n {{ t('praxis.charts.kpiEditor.source.statsQuery', 'Guided /stats/* query (StatsFieldRegistry)') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n @if (card.source.kind === 'verified-recipe') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.recipeId', 'Verified recipe') }}</mat-label>\n @if (availableRecipes().length > 0) {\n <mat-select\n data-testid=\"kpi-field-recipe-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.recipeId\"\n (ngModelChange)=\"selectVerifiedRecipe($event)\"\n >\n @for (recipe of availableRecipes(); track recipe.id) {\n <mat-option [value]=\"recipe.id\">\n {{ recipe.title }} ({{ recipe.operation }})\n </mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-recipe-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.recipeId\"\n (ngModelChange)=\"selectVerifiedRecipe($event)\"\n />\n }\n </mat-form-field>\n\n @if (selectedRecipe(); as recipe) {\n @if (recipe.kpiHint) {\n <div class=\"prx-kpi-editor__hint-action\">\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-apply-recipe-hint-btn\"\n [disabled]=\"isFullLocked()\"\n (click)=\"applySelectedRecipeHint()\"\n >\n {{ t('praxis.charts.kpiEditor.source.applyRecipeHint', 'Apply semantic hints (kpiHint)') }}\n </button>\n </div>\n }\n }\n </div>\n\n @if (selectedRecipe(); as recipe) {\n @if (lockedFilterEntries(recipe).length > 0) {\n <div class=\"prx-kpi-editor__readonly-meta\">\n <strong>{{ t('praxis.charts.kpiEditor.source.lockedFilters', 'Server-locked filters') }}:</strong>\n @for (lf of lockedFilterEntries(recipe); track lf.key) {\n <span class=\"prx-kpi-editor__chip\">{{ lf.key }} = {{ lf.value }}</span>\n }\n </div>\n }\n\n @if (recipe.adjustableParams?.length) {\n <div class=\"prx-kpi-editor__grid\">\n @for (param of recipe.adjustableParams; track param.name) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ param.name }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"getRecipeParamValue(param.name)\"\n (ngModelChange)=\"updateRecipeParameter(param.name, $event)\"\n />\n </mat-form-field>\n }\n </div>\n }\n }\n } @else if (card.source.kind === 'analytics-projection') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.projectionId', 'Published projection') }}</mat-label>\n @if (availableProjections().length > 0) {\n <mat-select\n data-testid=\"kpi-field-projection-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.projectionId\"\n (ngModelChange)=\"updateProjectionId($event)\"\n >\n @for (proj of availableProjections(); track proj.id) {\n <mat-option [value]=\"proj.id\">{{ proj.id }} ({{ proj.intent }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-projection-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.projectionId\"\n (ngModelChange)=\"updateProjectionId($event)\"\n />\n }\n </mat-form-field>\n </div>\n } @else if (card.source.kind === 'stats-query') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.operation', 'Analytical operation') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-stats-op\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.operation\"\n (ngModelChange)=\"onStatsOperationChange($event)\"\n >\n <mat-option value=\"group-by\">{{ statsOperationLabel('group-by') }}</mat-option>\n <mat-option value=\"timeseries\">{{ statsOperationLabel('timeseries') }}</mat-option>\n <mat-option value=\"comparison\">{{ statsOperationLabel('comparison') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.field', 'Dimension / date field') }}</mat-label>\n @if (availableStatsFields().length > 0) {\n <mat-select\n data-testid=\"kpi-field-stats-dim-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.field\"\n (ngModelChange)=\"updateStatsRequestField($event)\"\n >\n @for (f of availableStatsFields(); track f.field + (f.roles?.join(',') ?? '')) {\n <mat-option [value]=\"f.field\">{{ f.label || f.field }} ({{ f.field }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-stats-dim-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.field\"\n (ngModelChange)=\"updateStatsRequestField($event)\"\n />\n }\n </mat-form-field>\n\n @if (card.source.operation !== 'comparison') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricOperation', 'Metric operation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.operation ?? 'COUNT'\"\n (ngModelChange)=\"updateStatsMetric({ operation: $event })\"\n >\n @for (op of metricOperations; track op) {\n <mat-option [value]=\"op\">{{ metricOperationLabel(op) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricField', 'Metric field') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.field ?? ''\"\n (ngModelChange)=\"updateStatsMetric({ field: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricAlias', 'Metric alias') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.alias ?? 'total'\"\n (ngModelChange)=\"updateStatsMetric({ alias: $event })\"\n />\n </mat-form-field>\n }\n\n @if (card.source.operation === 'timeseries') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.granularity', 'Time granularity') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.granularity\"\n (ngModelChange)=\"updateTimeSeriesOptions({ granularity: $event })\"\n >\n <mat-option value=\"DAY\">{{ granularityLabel('DAY') }}</mat-option>\n <mat-option value=\"WEEK\">{{ granularityLabel('WEEK') }}</mat-option>\n <mat-option value=\"MONTH\">{{ granularityLabel('MONTH') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.rollingCount', 'Rolling window count') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"1\"\n max=\"120\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.rollingWindow.count\"\n (ngModelChange)=\"updateTimeSeriesOptions({ count: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.rollingUnit', 'Rolling window unit') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.rollingWindow.unit\"\n (ngModelChange)=\"updateTimeSeriesOptions({ unit: $event })\"\n >\n <mat-option value=\"DAYS\">{{ rollingUnitLabel('DAYS') }}</mat-option>\n <mat-option value=\"WEEKS\">{{ rollingUnitLabel('WEEKS') }}</mat-option>\n <mat-option value=\"MONTHS\">{{ rollingUnitLabel('MONTHS') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.fillGaps ?? true\"\n (ngModelChange)=\"updateTimeSeriesOptions({ fillGaps: $event })\"\n >\n {{ t('praxis.charts.kpiEditor.source.fillGaps', 'Fill empty periods (fillGaps)') }}\n </mat-slide-toggle>\n </div>\n }\n\n @if (card.source.operation === 'comparison') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodField', 'Reference date field') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodField\"\n (ngModelChange)=\"updateComparisonOptions({ periodField: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodPreset', 'Period window preset') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodPreset\"\n (ngModelChange)=\"updateComparisonOptions({ periodPreset: $event })\"\n >\n @for (preset of comparisonPresets; track preset) {\n <mat-option [value]=\"preset\">{{ comparisonPresetLabel(preset) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodMode', 'Comparison period mode') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodMode\"\n (ngModelChange)=\"updateComparisonOptions({ periodMode: $event })\"\n >\n <mat-option value=\"PREVIOUS_ALIGNED\">\n {{ comparisonPeriodModeLabel('PREVIOUS_ALIGNED') }}\n </mat-option>\n <mat-option value=\"PREVIOUS_CALENDAR_PERIOD\">\n {{ comparisonPeriodModeLabel('PREVIOUS_CALENDAR_PERIOD') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n }\n </div>\n }\n\n @if (card.source.kind === 'stats-query' || card.source.kind === 'analytics-projection') {\n <div class=\"prx-kpi-editor__sublist\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <span>{{ t('praxis.charts.kpiEditor.source.baseFilter', 'Conjunctive base filters (AND)') }}</span>\n <button\n mat-stroked-button\n type=\"button\"\n [disabled]=\"isMetricLocked()\"\n (click)=\"addBaseFilterRow()\"\n >\n {{ t('praxis.charts.kpiEditor.source.addBaseFilter', 'Add base filter') }}\n </button>\n </div>\n\n @for (row of baseFilterEntries(); track $index) {\n <div class=\"prx-kpi-editor__row\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.filterKey', 'Field (FilterDTO)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"row.key\"\n (ngModelChange)=\"updateBaseFilterRow($index, $event, row.rawValue)\"\n />\n </mat-form-field>\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.filterValue', 'Value(s)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"row.rawValue\"\n (ngModelChange)=\"updateBaseFilterRow($index, row.key, $event)\"\n />\n </mat-form-field>\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.source.removeBaseFilter', 'Remove filter')\"\n [disabled]=\"isMetricLocked()\"\n (click)=\"removeBaseFilterRow($index)\"\n >\n <mat-icon aria-hidden=\"true\">delete_outline</mat-icon>\n </button>\n </div>\n }\n </div>\n }\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.derivation.section', 'Mathematical derivation') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.kind', 'Derivation kind') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-derivation-kind\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.kind\"\n (ngModelChange)=\"onDerivationKindChange($event)\"\n >\n @for (kind of derivationKindOptions; track kind) {\n <mat-option [value]=\"kind\">{{ derivationKindLabel(kind) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.metricAlias', 'Response metric alias') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.metricAlias ?? ''\"\n (ngModelChange)=\"patchDerivation({ metricAlias: $event.trim() || undefined })\"\n />\n </mat-form-field>\n\n @if (card.derivation.kind === 'ratio') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.numeratorKeys', 'Numerator keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.numeratorKeys)\"\n (ngModelChange)=\"patchDerivation({ numeratorKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.denominatorMode', 'Denominator basis') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.denominatorMode\"\n (ngModelChange)=\"patchDerivation({ denominatorMode: $event })\"\n >\n <mat-option value=\"population-total\">{{ denominatorModeLabel('population-total') }}</mat-option>\n <mat-option value=\"explicit-keys\">{{ denominatorModeLabel('explicit-keys') }}</mat-option>\n <mat-option value=\"exclude-keys\">{{ denominatorModeLabel('exclude-keys') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.denominatorMode !== 'population-total') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.denominatorKeys', 'Denominator keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.denominatorKeys)\"\n (ngModelChange)=\"patchDerivation({ denominatorKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n }\n } @else if (card.derivation.kind === 'composition') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.unmatchedPolicy', 'Unmapped segment buckets') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.unmatchedPolicy ?? 'group-as-other'\"\n (ngModelChange)=\"patchDerivation({ unmatchedPolicy: $event })\"\n >\n <mat-option value=\"group-as-other\">{{ unmatchedPolicyLabel('group-as-other') }}</mat-option>\n <mat-option value=\"include-dynamically\">{{ unmatchedPolicyLabel('include-dynamically') }}</mat-option>\n <mat-option value=\"exclude-from-total\">{{ unmatchedPolicyLabel('exclude-from-total') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.headlineMode', 'Headline value') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.headlineMode ?? 'total'\"\n (ngModelChange)=\"patchDerivation({ headlineMode: $event })\"\n >\n <mat-option value=\"total\">{{ headlineModeLabel('total') }}</mat-option>\n <mat-option value=\"key-share\">{{ headlineModeLabel('key-share') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.headlineMode === 'key-share') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.headlineKey', 'Key-share bucket key') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-headline-key\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.headlineKey ?? ''\"\n (ngModelChange)=\"patchDerivation({ headlineKey: $event.trim() || undefined })\"\n />\n </mat-form-field>\n }\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.maxVisible', 'Max visible segments') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"2\"\n max=\"12\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.maxVisible ?? 5\"\n (ngModelChange)=\"patchDerivation({ maxVisible: $event })\"\n />\n </mat-form-field>\n } @else if (card.derivation.kind === 'timeseries-summary') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.seriesAggregation', 'Series aggregation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.seriesAggregation\"\n (ngModelChange)=\"patchDerivation({ seriesAggregation: $event })\"\n >\n <mat-option value=\"sum\">{{ seriesAggregationLabel('sum') }}</mat-option>\n <mat-option value=\"latest\">{{ seriesAggregationLabel('latest') }}</mat-option>\n <mat-option value=\"avg\">{{ seriesAggregationLabel('avg') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.deltaMode', 'Displayed variation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.deltaMode ?? 'last-vs-previous'\"\n (ngModelChange)=\"patchDerivation({ deltaMode: $event })\"\n >\n <mat-option value=\"last-vs-previous\">{{ timeseriesDeltaModeLabel('last-vs-previous') }}</mat-option>\n <mat-option value=\"last-vs-first\">{{ timeseriesDeltaModeLabel('last-vs-first') }}</mat-option>\n <mat-option value=\"none\">{{ timeseriesDeltaModeLabel('none') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.baselineZeroPolicy', 'When previous period is zero') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.baselineZeroPolicy ?? 'show-absolute'\"\n (ngModelChange)=\"patchDerivation({ baselineZeroPolicy: $event })\"\n >\n <mat-option value=\"show-absolute\">{{ baselineZeroPolicyLabel('show-absolute') }}</mat-option>\n <mat-option value=\"label-no-baseline\">{{ baselineZeroPolicyLabel('label-no-baseline') }}</mat-option>\n <mat-option value=\"hide-pct\">{{ baselineZeroPolicyLabel('hide-pct') }}</mat-option>\n </mat-select>\n </mat-form-field>\n } @else if (card.derivation.kind === 'comparison-delta') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.deltaMode', 'Displayed variation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.deltaMode ?? 'percent'\"\n (ngModelChange)=\"patchDerivation({ deltaMode: $event })\"\n >\n <mat-option value=\"percent\">{{ comparisonDeltaModeLabel('percent') }}</mat-option>\n <mat-option value=\"absolute\">{{ comparisonDeltaModeLabel('absolute') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.bucketKeys', 'Included bucket keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.bucketKeys)\"\n (ngModelChange)=\"patchDerivation({ bucketKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n } @else if (card.derivation.kind === 'scalar') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.scalarAggregation', 'Scalar aggregation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.aggregation\"\n (ngModelChange)=\"patchDerivation({ aggregation: $event })\"\n >\n <mat-option value=\"total\">{{ scalarAggregationLabel('total') }}</mat-option>\n <mat-option value=\"sum-keys\">{{ scalarAggregationLabel('sum-keys') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.aggregation === 'sum-keys') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.scalarKeys', 'Included keys (sum-keys)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.keys)\"\n (ngModelChange)=\"patchDerivation({ keys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n }\n }\n </div>\n </section>\n\n @if (effectiveAllowGovernanceEditing()) {\n <section class=\"prx-kpi-editor__section\" data-testid=\"kpi-governance-section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.governance.section', 'Corporate governance') }}\n </h3>\n\n <p class=\"prx-kpi-editor__hint-text\">\n {{\n t(\n 'praxis.charts.kpiEditor.governance.hint',\n 'Controls which adjustments end users can save over this published indicator.'\n )\n }}\n </p>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.governance.lockLevel', 'Lock level') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-lock-level\"\n [ngModel]=\"lockLevel()\"\n (ngModelChange)=\"updateLockLevel($event)\"\n >\n <mat-option value=\"none\">{{ lockLevelLabel('none') }}</mat-option>\n <mat-option value=\"metric-locked\">{{ lockLevelLabel('metric-locked') }}</mat-option>\n <mat-option value=\"full\">{{ lockLevelLabel('full') }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </section>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block}.prx-kpi-editor{display:grid;gap:16px}.prx-kpi-editor__preview-panel{display:grid;gap:12px;padding:14px;border-radius:14px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 70%,transparent);background:var(--md-sys-color-surface-container-low, rgba(15, 23, 42, .02))}.prx-kpi-editor__preview-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.prx-kpi-editor__preview-heading{display:grid;gap:2px}.prx-kpi-editor__preview-hint{font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b)}.prx-kpi-editor__sim-select{min-width:240px}.prx-kpi-editor__preview-stage{max-width:360px}.prx-kpi-editor__banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-radius:10px;font-size:13px}.prx-kpi-editor__banner--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container, #fef3c7) 65%,transparent);color:var(--md-sys-color-on-tertiary-container, #451a03)}.prx-kpi-editor__banner--locked{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #e2e8f0) 70%,transparent);color:var(--md-sys-color-on-secondary-container, #1e293b)}.prx-kpi-editor__banner--error{background:color-mix(in srgb,var(--md-sys-color-error-container, #fee2e2) 70%,transparent);color:var(--md-sys-color-on-error-container, #7f1d1d)}.prx-kpi-editor__banner-content{display:grid;gap:4px}.prx-kpi-editor__errors{margin:0;padding:10px 16px 10px 28px;border-radius:10px;background:color-mix(in srgb,var(--md-sys-color-error-container, #fee2e2) 60%,transparent);color:var(--md-sys-color-on-error-container, #7f1d1d);font-size:13px}.prx-kpi-editor__tabs{display:flex;gap:8px;border-bottom:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 70%,transparent);padding-bottom:8px}.prx-kpi-editor__tab{appearance:none;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, #475569);padding:8px 14px;border-radius:999px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}.prx-kpi-editor__tab--active{background:var(--md-sys-color-secondary-container, rgba(37, 99, 235, .12));color:var(--md-sys-color-on-secondary-container, #1e3a8a);border-color:color-mix(in srgb,var(--md-sys-color-primary, #2563eb) 35%,transparent)}.prx-kpi-editor__panel,.prx-kpi-editor__section,.prx-kpi-editor__sublist{display:grid;gap:12px}.prx-kpi-editor__section{padding:14px;border-radius:12px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 60%,transparent);background:var(--md-sys-color-surface-container-lowest, transparent)}.prx-kpi-editor__section-title{margin:0;font-size:14px;font-weight:600;color:var(--md-sys-color-on-surface, #0f172a)}.prx-kpi-editor__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:center}.prx-kpi-editor__sublist-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.prx-kpi-editor__row{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr)) auto;gap:8px;align-items:center}.prx-kpi-editor__toggle{display:flex;align-items:center;min-height:44px}.prx-kpi-editor__readonly-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:12px}.prx-kpi-editor__chip{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:var(--md-sys-color-surface-container, rgba(15, 23, 42, .06));font-family:monospace}.prx-kpi-editor__icon-preview{color:var(--md-sys-color-primary, #0f766e);margin-right:4px}.prx-kpi-editor__icon-actions{display:inline-flex;align-items:center;gap:2px}.prx-kpi-editor__tone-option{display:inline-flex;align-items:center;gap:8px}.prx-kpi-editor__tone-swatch{display:inline-block;width:10px;height:10px;border-radius:999px;flex:0 0 auto;background:var(--prx-micro-tone-neutral, var(--md-sys-color-outline, #64748b))}.prx-kpi-editor__tone-swatch[data-tone=primary],.prx-kpi-editor__tone-swatch[data-tone=info]{background:var(--prx-micro-tone-info, var(--md-sys-color-primary, #0369a1))}.prx-kpi-editor__tone-swatch[data-tone=success]{background:var(--prx-micro-tone-success, var(--praxis-success, #166534))}.prx-kpi-editor__tone-swatch[data-tone=warning]{background:var(--prx-micro-tone-warning, var(--praxis-warning, #b45309))}.prx-kpi-editor__tone-swatch[data-tone=danger],.prx-kpi-editor__tone-swatch[data-tone=critical]{background:var(--prx-micro-tone-danger, var(--md-sys-color-error, #ba1a1a))}.prx-kpi-editor__hint-text{margin:0;font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$5.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$5.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i6$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: PraxisKpiCardViewComponent, selector: "praxis-kpi-card-view", inputs: ["viewModel", "density", "allowRetry", "allowDrillDown", "showProvenance", "provenanceExpanded", "governed"], outputs: ["activate", "retry", "openProvenance", "drillDown"] }, { kind: "component", type: PraxisKpiCardComponent, selector: "praxis-kpi-card", inputs: ["card", "config", "queryContext", "density", "scopeKey", "showProvenance", "analytics"], outputs: ["crossFilter", "drillDown", "cardAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51002
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisKpiCardConfigEditorComponent, isStandalone: true, selector: "praxis-kpi-card-config-editor", inputs: { spec: "spec", embeddedInStrip: "embeddedInStrip", queryContext: "queryContext", allowGovernanceEditing: "allowGovernanceEditing" }, outputs: { specChange: "specChange", validationChange: "validationChange" }, providers: [providePraxisChartsI18n()], usesOnChanges: true, ngImport: i0, template: "@let card = draftSpec();\n@let simVm = simulatedViewModel();\n@let validation = validationResult();\n@let resDetails = resourceDetails();\n\n<section class=\"prx-kpi-editor\" data-testid=\"kpi-card-config-editor\">\n <div class=\"prx-kpi-editor__preview-panel\">\n <div class=\"prx-kpi-editor__preview-header\">\n <div class=\"prx-kpi-editor__preview-heading\">\n <strong>{{ t('praxis.charts.kpiEditor.preview.title', 'Live preview') }}</strong>\n <span class=\"prx-kpi-editor__preview-hint\">\n {{\n t(\n 'praxis.charts.kpiEditor.preview.simulatorHint',\n 'Editor preview only; no simulated payload is ever persisted.'\n )\n }}\n </span>\n </div>\n\n <mat-form-field\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n class=\"prx-kpi-editor__sim-select\"\n >\n <mat-label>\n {{ t('praxis.charts.kpiEditor.preview.simulatorLabel', 'Epistemic / k-anonymity simulator') }}\n </mat-label>\n <mat-select\n data-testid=\"kpi-simulator-mode\"\n [ngModel]=\"simulationMode()\"\n (ngModelChange)=\"simulationMode.set($event)\"\n >\n @for (mode of simulationModes; track mode) {\n <mat-option [value]=\"mode\">{{ simulationModeLabel(mode) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n\n <div class=\"prx-kpi-editor__preview-stage\" data-testid=\"kpi-editor-preview-stage\">\n @if (simulationMode() === 'live') {\n <praxis-kpi-card\n [card]=\"card\"\n [queryContext]=\"queryContext\"\n density=\"compact\"\n [showProvenance]=\"false\"\n />\n } @else if (simVm) {\n <praxis-kpi-card-view\n [viewModel]=\"simVm\"\n density=\"compact\"\n [allowRetry]=\"false\"\n [allowDrillDown]=\"false\"\n [showProvenance]=\"false\"\n />\n }\n </div>\n </div>\n\n @if (isFullLocked()) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--locked\" role=\"status\" data-testid=\"kpi-lock-banner\">\n <mat-icon aria-hidden=\"true\">lock</mat-icon>\n <span>\n {{\n t(\n 'praxis.charts.kpiEditor.lock.full',\n 'Indicator locked by corporate governance (read-only).'\n )\n }}\n </span>\n </div>\n } @else if (isMetricLocked()) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--warn\" role=\"status\" data-testid=\"kpi-lock-banner\">\n <mat-icon aria-hidden=\"true\">verified_user</mat-icon>\n <span>\n {{\n t(\n 'praxis.charts.kpiEditor.lock.metricLocked',\n 'Metric locked by corporate governance: edit presentation, targets, thresholds, and interactions only.'\n )\n }}\n </span>\n </div>\n }\n\n @if (catalogDiagnostics().length > 0) {\n <div class=\"prx-kpi-editor__banner prx-kpi-editor__banner--error\" role=\"status\" data-testid=\"kpi-catalog-diagnostics\">\n <div class=\"prx-kpi-editor__banner-content\">\n @for (diag of catalogDiagnostics(); track diag.code + (diag.resourcePath ?? '')) {\n <div>{{ diag.message }} (<code>{{ diag.code }}</code>)</div>\n }\n </div>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-catalog-retry-btn\"\n (click)=\"reloadCatalog()\"\n >\n {{ t('praxis.charts.kpiEditor.catalog.retry', 'Retry catalog load') }}\n </button>\n </div>\n }\n\n @if (!validation.valid) {\n <ul class=\"prx-kpi-editor__errors\" role=\"alert\" data-testid=\"kpi-card-validation-errors\">\n @for (code of validation.errorCodes; track code) {\n <li>{{ validationMessage(code) }}</li>\n }\n </ul>\n }\n\n <div\n class=\"prx-kpi-editor__tabs\"\n role=\"tablist\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.cardSettingsTitle', 'Executive KPI Card \u2014 Settings')\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n class=\"prx-kpi-editor__tab\"\n [class.prx-kpi-editor__tab--active]=\"activeTab() === 'analyst'\"\n [attr.aria-selected]=\"activeTab() === 'analyst'\"\n data-testid=\"kpi-tab-analyst\"\n (click)=\"setTab('analyst')\"\n >\n {{ t('praxis.charts.kpiEditor.tabs.analyst', 'Presentation & Targets') }}\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"prx-kpi-editor__tab\"\n [class.prx-kpi-editor__tab--active]=\"activeTab() === 'curator'\"\n [attr.aria-selected]=\"activeTab() === 'curator'\"\n data-testid=\"kpi-tab-curator\"\n (click)=\"setTab('curator')\"\n >\n {{ t('praxis.charts.kpiEditor.tabs.curator', 'Source & Derivation (BI)') }}\n </button>\n </div>\n\n @if (activeTab() === 'analyst') {\n <div role=\"tabpanel\" class=\"prx-kpi-editor__panel\" data-testid=\"kpi-panel-analyst\">\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.presentation.section', 'Identity & formatting') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.label', 'Indicator label') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-label\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentLabelText()\"\n (ngModelChange)=\"updateLabel($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.icon', 'Material icon (snake_case)') }}</mat-label>\n <mat-icon matPrefix class=\"prx-kpi-editor__icon-preview\" aria-hidden=\"true\">\n {{ card.presentation.icon || 'insights' }}\n </mat-icon>\n <input\n matInput\n data-testid=\"kpi-field-icon\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.icon ?? ''\"\n (ngModelChange)=\"updateIcon($event)\"\n />\n <div matSuffix class=\"prx-kpi-editor__icon-actions\">\n @if (card.presentation.icon && !isFullLocked()) {\n <button\n mat-icon-button\n type=\"button\"\n data-testid=\"kpi-field-icon-clear\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.presentation.clearIcon', 'Clear icon')\"\n (click)=\"updateIcon('')\"\n >\n <mat-icon aria-hidden=\"true\">close</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n type=\"button\"\n data-testid=\"kpi-field-icon-picker\"\n [disabled]=\"isFullLocked()\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.presentation.openIconPicker', 'Open visual icon picker')\"\n (click)=\"openIconPicker()\"\n >\n <mat-icon aria-hidden=\"true\">apps</mat-icon>\n </button>\n </div>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.tone', 'Semantic tone') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-tone\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.tone ?? 'neutral'\"\n (ngModelChange)=\"updateTone($event)\"\n >\n <mat-select-trigger>\n <span class=\"prx-kpi-editor__tone-option\">\n <span\n class=\"prx-kpi-editor__tone-swatch\"\n [attr.data-tone]=\"card.presentation.tone ?? 'neutral'\"\n ></span>\n <span>{{ toneLabel(card.presentation.tone ?? 'neutral') }}</span>\n </span>\n </mat-select-trigger>\n @for (tone of presentationTones; track tone) {\n <mat-option [value]=\"tone\">\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"tone\"></span>\n <span>{{ toneLabel(tone) }}</span>\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.format', 'Value format') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-format\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.format\"\n (ngModelChange)=\"updateFormat($event)\"\n >\n @for (fmt of formatOptions; track fmt) {\n <mat-option [value]=\"fmt\">{{ formatLabel(fmt) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (\n card.presentation.format === 'currency' ||\n card.presentation.format === 'compact-currency'\n ) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.currencyCode', 'Currency (ISO 4217)') }}</mat-label>\n <input\n matInput\n maxlength=\"3\"\n data-testid=\"kpi-field-currency\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.currencyCode ?? 'BRL'\"\n (ngModelChange)=\"updateCurrencyCode($event)\"\n />\n </mat-form-field>\n }\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.decimals', 'Decimal places') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"0\"\n max=\"4\"\n data-testid=\"kpi-field-decimals\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.decimals ?? 1\"\n (ngModelChange)=\"updateDecimals($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.polarity', 'Executive polarity') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-polarity\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.polarity ?? 'higher-is-better'\"\n (ngModelChange)=\"updatePolarity($event)\"\n >\n @for (pol of polarityOptions; track pol) {\n <mat-option [value]=\"pol\">{{ polarityLabel(pol) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.unitSingular', 'Unit label (singular)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-unit-singular\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentUnitSingular()\"\n (ngModelChange)=\"updateUnitLabel($event, currentUnitPlural())\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.unitPlural', 'Unit label (plural)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-unit-plural\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentUnitPlural()\"\n (ngModelChange)=\"updateUnitLabel(currentUnitSingular(), $event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.badgeTemplate', 'Badge template') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-badge-template\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.presentation.badgeTemplate ?? 'auto'\"\n (ngModelChange)=\"updateBadgeTemplate($event)\"\n >\n @for (tpl of badgeTemplateOptions; track tpl) {\n <mat-option [value]=\"tpl\">{{ badgeTemplateLabel(tpl) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.presentation.badgeContextLabel', 'Badge context text') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-badge-context\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentBadgeContext()\"\n (ngModelChange)=\"updateBadgeContextLabel($event)\"\n />\n </mat-form-field>\n </div>\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.visualization.section', 'Micro-visualization, target & thresholds') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.kind', 'Micro-visualization type') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-viz-kind\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.kind ?? compatibleVisualizations()[0]\"\n (ngModelChange)=\"updateVisualizationKind($event)\"\n >\n @for (kind of compatibleVisualizations(); track kind) {\n <mat-option [value]=\"kind\">{{ visualizationLabel(kind) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n @if (\n card.visualization?.kind === 'bullet' ||\n card.visualization?.kind === 'radial' ||\n card.visualization?.kind === 'harveyBall'\n ) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.target', 'Target / reference value') }}</mat-label>\n <input\n matInput\n type=\"number\"\n data-testid=\"kpi-field-viz-target\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.target ?? null\"\n (ngModelChange)=\"updateTarget($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.targetLabel', 'Target label') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-viz-target-label\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"currentTargetLabel()\"\n (ngModelChange)=\"updateTargetLabel($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.scaleMode', 'Scale mode') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-viz-scale-mode\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.scaleMode ?? 'fixed-100'\"\n (ngModelChange)=\"updateScaleMode($event)\"\n >\n <mat-option value=\"fixed-100\">\n {{ t('praxis.charts.kpiEditor.visualization.scaleFixed100', 'Fixed (0\u2013100%)') }}\n </mat-option>\n <mat-option value=\"auto-max\">\n {{ t('praxis.charts.kpiEditor.visualization.scaleAutoMax', 'Dynamic (auto-max)') }}\n </mat-option>\n <mat-option value=\"population-total\">\n {{\n t(\n 'praxis.charts.kpiEditor.visualization.scalePopulationTotal',\n 'Population total share'\n )\n }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n }\n\n @if (card.visualization?.kind === 'stackedBar') {\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-field-viz-legend\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.visualization?.showLegend ?? true\"\n (ngModelChange)=\"updateShowLegend($event)\"\n >\n {{ t('praxis.charts.kpiEditor.visualization.showLegend', 'Show segment legend') }}\n </mat-slide-toggle>\n </div>\n }\n </div>\n\n <div class=\"prx-kpi-editor__sublist\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <span>{{ t('praxis.charts.kpiEditor.visualization.thresholds', 'Alert bands (thresholds)') }}</span>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-add-threshold-btn\"\n [disabled]=\"isFullLocked() || (card.visualization?.thresholds?.length ?? 0) >= 6\"\n (click)=\"addThreshold()\"\n >\n {{ t('praxis.charts.kpiEditor.visualization.addThreshold', 'Add threshold') }}\n </button>\n </div>\n\n @for (band of card.visualization?.thresholds ?? []; track $index) {\n <div class=\"prx-kpi-editor__row\" data-testid=\"kpi-threshold-row\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdMin', 'Min') }}</mat-label>\n <input\n matInput\n type=\"number\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.min ?? null\"\n (ngModelChange)=\"updateThreshold($index, { min: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdMax', 'Max') }}</mat-label>\n <input\n matInput\n type=\"number\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.max\"\n (ngModelChange)=\"updateThreshold($index, { max: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.visualization.thresholdTone', 'Tone') }}</mat-label>\n <mat-select\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"band.tone\"\n (ngModelChange)=\"updateThreshold($index, { tone: $event })\"\n >\n <mat-select-trigger>\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"band.tone\"></span>\n <span>{{ toneLabel(band.tone) }}</span>\n </span>\n </mat-select-trigger>\n @for (tone of thresholdTones; track tone) {\n <mat-option [value]=\"tone\">\n <span class=\"prx-kpi-editor__tone-option\">\n <span class=\"prx-kpi-editor__tone-swatch\" [attr.data-tone]=\"tone\"></span>\n <span>{{ toneLabel(tone) }}</span>\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.visualization.removeThreshold', 'Remove threshold')\"\n [disabled]=\"isFullLocked()\"\n (click)=\"removeThreshold($index)\"\n >\n <mat-icon aria-hidden=\"true\">delete_outline</mat-icon>\n </button>\n </div>\n }\n </div>\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.interaction.section', 'Interactions & cross-filtering') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-toggle-cross-filter\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"!!card.interaction?.crossFilter\"\n (ngModelChange)=\"toggleCrossFilter($event)\"\n >\n {{ t('praxis.charts.kpiEditor.interaction.enableCrossFilter', 'Apply cross-filter on card click') }}\n </mat-slide-toggle>\n </div>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.filterReactionMode', 'Reaction to external cross-filters') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-filter-reaction\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"card.interaction?.filterReaction?.mode ?? 'all-except-own-dimension'\"\n (ngModelChange)=\"updateFilterReactionMode($event)\"\n >\n <mat-option value=\"all-except-own-dimension\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionAllExceptOwn', 'All except own dimension (anti-feedback-loop)') }}\n </mat-option>\n <mat-option value=\"page-scope-only\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionPageScopeOnly', 'Page scope filters only') }}\n </mat-option>\n <mat-option value=\"all-cross-filters\">\n {{ t('praxis.charts.kpiEditor.interaction.reactionAll', 'All cross-filters') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.interaction?.crossFilter; as cf) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.crossFilterField', 'Filter field (FilterDTO)') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-cf-field\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"cf.field\"\n (ngModelChange)=\"updateCrossFilterField($event)\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.crossFilterValues', 'Filter values') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-cf-values\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"formatScalarList(cf.values)\"\n (ngModelChange)=\"updateCrossFilterValues($event)\"\n />\n </mat-form-field>\n }\n\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n data-testid=\"kpi-toggle-drill-down\"\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"!!card.interaction?.drillDown\"\n (ngModelChange)=\"toggleDrillDown($event)\"\n >\n {{ t('praxis.charts.kpiEditor.interaction.enableDrillDown', 'Enable drill-down action') }}\n </mat-slide-toggle>\n </div>\n\n @if (card.interaction?.drillDown; as dd) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.drillDownResource', 'Target resource') }}</mat-label>\n <input\n matInput\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"dd.resourcePath ?? card.source.resourcePath\"\n (ngModelChange)=\"updateDrillDown({ resourcePath: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.interaction.drillDownSurface', 'Target surface id') }}</mat-label>\n <input\n matInput\n [disabled]=\"isFullLocked()\"\n [ngModel]=\"dd.surfaceId ?? ''\"\n (ngModelChange)=\"updateDrillDown({ surfaceId: $event || undefined })\"\n />\n </mat-form-field>\n }\n </div>\n </section>\n </div>\n } @else {\n <div role=\"tabpanel\" class=\"prx-kpi-editor__panel\" data-testid=\"kpi-panel-curator\">\n <section class=\"prx-kpi-editor__section\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.source.section', 'Governed data source') }}\n </h3>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-reload-resource-btn\"\n [disabled]=\"!card.source.resourcePath\"\n (click)=\"reloadResourceDetails()\"\n >\n {{ t('praxis.charts.kpiEditor.catalog.retryResource', 'Reload resource metadata') }}\n </button>\n </div>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.resourcePath', 'Governed resource') }}</mat-label>\n @if (resources().length > 0) {\n <mat-select\n data-testid=\"kpi-field-resource-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.resourcePath\"\n (ngModelChange)=\"onResourcePathChange($event)\"\n >\n @for (res of resources(); track res.id) {\n <mat-option [value]=\"res.path\">{{ res.label }} ({{ res.path }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-resource-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.resourcePath\"\n (ngModelChange)=\"onResourcePathChange($event)\"\n />\n }\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.kind', 'Source mode') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-source-kind\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.kind\"\n (ngModelChange)=\"onSourceKindChange($event)\"\n >\n <mat-option value=\"verified-recipe\">\n {{ t('praxis.charts.kpiEditor.source.verifiedRecipe', 'Verified analytical recipe (Recommended)') }}\n </mat-option>\n <mat-option value=\"analytics-projection\">\n {{ t('praxis.charts.kpiEditor.source.analyticsProjection', 'x-ui.analytics projection') }}\n </mat-option>\n <mat-option value=\"stats-query\">\n {{ t('praxis.charts.kpiEditor.source.statsQuery', 'Guided /stats/* query (StatsFieldRegistry)') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n\n @if (card.source.kind === 'verified-recipe') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.recipeId', 'Verified recipe') }}</mat-label>\n @if (availableRecipes().length > 0) {\n <mat-select\n data-testid=\"kpi-field-recipe-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.recipeId\"\n (ngModelChange)=\"selectVerifiedRecipe($event)\"\n >\n @for (recipe of availableRecipes(); track recipe.id) {\n <mat-option [value]=\"recipe.id\">\n {{ recipe.title }} ({{ recipe.operation }})\n </mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-recipe-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.recipeId\"\n (ngModelChange)=\"selectVerifiedRecipe($event)\"\n />\n }\n </mat-form-field>\n\n @if (selectedRecipe(); as recipe) {\n @if (recipe.kpiHint) {\n <div class=\"prx-kpi-editor__hint-action\">\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"kpi-apply-recipe-hint-btn\"\n [disabled]=\"isFullLocked()\"\n (click)=\"applySelectedRecipeHint()\"\n >\n {{ t('praxis.charts.kpiEditor.source.applyRecipeHint', 'Apply semantic hints (kpiHint)') }}\n </button>\n </div>\n }\n }\n </div>\n\n @if (selectedRecipe(); as recipe) {\n @if (lockedFilterEntries(recipe).length > 0) {\n <div class=\"prx-kpi-editor__readonly-meta\">\n <strong>{{ t('praxis.charts.kpiEditor.source.lockedFilters', 'Server-locked filters') }}:</strong>\n @for (lf of lockedFilterEntries(recipe); track lf.key) {\n <span class=\"prx-kpi-editor__chip\">{{ lf.key }} = {{ lf.value }}</span>\n }\n </div>\n }\n\n @if (recipe.adjustableParams?.length) {\n <div class=\"prx-kpi-editor__grid\">\n @for (param of recipe.adjustableParams; track param.name) {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ param.name }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"getRecipeParamValue(param.name)\"\n (ngModelChange)=\"updateRecipeParameter(param.name, $event)\"\n />\n </mat-form-field>\n }\n </div>\n }\n }\n } @else if (card.source.kind === 'analytics-projection') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.projectionId', 'Published projection') }}</mat-label>\n @if (availableProjections().length > 0) {\n <mat-select\n data-testid=\"kpi-field-projection-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.projectionId\"\n (ngModelChange)=\"updateProjectionId($event)\"\n >\n @for (proj of availableProjections(); track proj.id) {\n <mat-option [value]=\"proj.id\">{{ proj.id }} ({{ proj.intent }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-projection-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.projectionId\"\n (ngModelChange)=\"updateProjectionId($event)\"\n />\n }\n </mat-form-field>\n </div>\n } @else if (card.source.kind === 'stats-query') {\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.operation', 'Analytical operation') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-stats-op\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.operation\"\n (ngModelChange)=\"onStatsOperationChange($event)\"\n >\n <mat-option value=\"group-by\">{{ statsOperationLabel('group-by') }}</mat-option>\n <mat-option value=\"timeseries\">{{ statsOperationLabel('timeseries') }}</mat-option>\n <mat-option value=\"comparison\">{{ statsOperationLabel('comparison') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.field', 'Dimension / date field') }}</mat-label>\n @if (availableStatsFields().length > 0) {\n <mat-select\n data-testid=\"kpi-field-stats-dim-select\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.field\"\n (ngModelChange)=\"updateStatsRequestField($event)\"\n >\n @for (f of availableStatsFields(); track f.field + (f.roles?.join(',') ?? '')) {\n <mat-option [value]=\"f.field\">{{ f.label || f.field }} ({{ f.field }})</mat-option>\n }\n </mat-select>\n } @else {\n <input\n matInput\n data-testid=\"kpi-field-stats-dim-input\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.field\"\n (ngModelChange)=\"updateStatsRequestField($event)\"\n />\n }\n </mat-form-field>\n\n @if (card.source.operation !== 'comparison') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricOperation', 'Metric operation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.operation ?? 'COUNT'\"\n (ngModelChange)=\"updateStatsMetric({ operation: $event })\"\n >\n @for (op of metricOperations; track op) {\n <mat-option [value]=\"op\">{{ metricOperationLabel(op) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricField', 'Metric field') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.field ?? ''\"\n (ngModelChange)=\"updateStatsMetric({ field: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.metricAlias', 'Metric alias') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.metric?.alias ?? 'total'\"\n (ngModelChange)=\"updateStatsMetric({ alias: $event })\"\n />\n </mat-form-field>\n }\n\n @if (card.source.operation === 'timeseries') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.granularity', 'Time granularity') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.granularity\"\n (ngModelChange)=\"updateTimeSeriesOptions({ granularity: $event })\"\n >\n <mat-option value=\"DAY\">{{ granularityLabel('DAY') }}</mat-option>\n <mat-option value=\"WEEK\">{{ granularityLabel('WEEK') }}</mat-option>\n <mat-option value=\"MONTH\">{{ granularityLabel('MONTH') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.rollingCount', 'Rolling window count') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"1\"\n max=\"120\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.rollingWindow.count\"\n (ngModelChange)=\"updateTimeSeriesOptions({ count: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.rollingUnit', 'Rolling window unit') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.rollingWindow.unit\"\n (ngModelChange)=\"updateTimeSeriesOptions({ unit: $event })\"\n >\n <mat-option value=\"DAYS\">{{ rollingUnitLabel('DAYS') }}</mat-option>\n <mat-option value=\"WEEKS\">{{ rollingUnitLabel('WEEKS') }}</mat-option>\n <mat-option value=\"MONTHS\">{{ rollingUnitLabel('MONTHS') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <div class=\"prx-kpi-editor__toggle\">\n <mat-slide-toggle\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.fillGaps ?? true\"\n (ngModelChange)=\"updateTimeSeriesOptions({ fillGaps: $event })\"\n >\n {{ t('praxis.charts.kpiEditor.source.fillGaps', 'Fill empty periods (fillGaps)') }}\n </mat-slide-toggle>\n </div>\n }\n\n @if (card.source.operation === 'comparison') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodField', 'Reference date field') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodField\"\n (ngModelChange)=\"updateComparisonOptions({ periodField: $event })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodPreset', 'Period window preset') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodPreset\"\n (ngModelChange)=\"updateComparisonOptions({ periodPreset: $event })\"\n >\n @for (preset of comparisonPresets; track preset) {\n <mat-option [value]=\"preset\">{{ comparisonPresetLabel(preset) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.periodMode', 'Comparison period mode') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.source.request.periodMode\"\n (ngModelChange)=\"updateComparisonOptions({ periodMode: $event })\"\n >\n <mat-option value=\"PREVIOUS_ALIGNED\">\n {{ comparisonPeriodModeLabel('PREVIOUS_ALIGNED') }}\n </mat-option>\n <mat-option value=\"PREVIOUS_CALENDAR_PERIOD\">\n {{ comparisonPeriodModeLabel('PREVIOUS_CALENDAR_PERIOD') }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n }\n </div>\n }\n\n @if (card.source.kind === 'stats-query' || card.source.kind === 'analytics-projection') {\n <div class=\"prx-kpi-editor__sublist\">\n <div class=\"prx-kpi-editor__sublist-header\">\n <span>{{ t('praxis.charts.kpiEditor.source.baseFilter', 'Conjunctive base filters (AND)') }}</span>\n <button\n mat-stroked-button\n type=\"button\"\n [disabled]=\"isMetricLocked()\"\n (click)=\"addBaseFilterRow()\"\n >\n {{ t('praxis.charts.kpiEditor.source.addBaseFilter', 'Add base filter') }}\n </button>\n </div>\n\n @for (row of baseFilterEntries(); track $index) {\n <div class=\"prx-kpi-editor__row\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.filterKey', 'Field (FilterDTO)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"row.key\"\n (ngModelChange)=\"updateBaseFilterRow($index, $event, row.rawValue)\"\n />\n </mat-form-field>\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.source.filterValue', 'Value(s)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"row.rawValue\"\n (ngModelChange)=\"updateBaseFilterRow($index, row.key, $event)\"\n />\n </mat-form-field>\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"t('praxis.charts.kpiEditor.source.removeBaseFilter', 'Remove filter')\"\n [disabled]=\"isMetricLocked()\"\n (click)=\"removeBaseFilterRow($index)\"\n >\n <mat-icon aria-hidden=\"true\">delete_outline</mat-icon>\n </button>\n </div>\n }\n </div>\n }\n </section>\n\n <section class=\"prx-kpi-editor__section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.derivation.section', 'Mathematical derivation') }}\n </h3>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.kind', 'Derivation kind') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-derivation-kind\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.kind\"\n (ngModelChange)=\"onDerivationKindChange($event)\"\n >\n @for (kind of derivationKindOptions; track kind) {\n <mat-option [value]=\"kind\">{{ derivationKindLabel(kind) }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.metricAlias', 'Response metric alias') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.metricAlias ?? ''\"\n (ngModelChange)=\"patchDerivation({ metricAlias: $event.trim() || undefined })\"\n />\n </mat-form-field>\n\n @if (card.derivation.kind === 'ratio') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.numeratorKeys', 'Numerator keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.numeratorKeys)\"\n (ngModelChange)=\"patchDerivation({ numeratorKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.denominatorMode', 'Denominator basis') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.denominatorMode\"\n (ngModelChange)=\"patchDerivation({ denominatorMode: $event })\"\n >\n <mat-option value=\"population-total\">{{ denominatorModeLabel('population-total') }}</mat-option>\n <mat-option value=\"explicit-keys\">{{ denominatorModeLabel('explicit-keys') }}</mat-option>\n <mat-option value=\"exclude-keys\">{{ denominatorModeLabel('exclude-keys') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.denominatorMode !== 'population-total') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.denominatorKeys', 'Denominator keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.denominatorKeys)\"\n (ngModelChange)=\"patchDerivation({ denominatorKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n }\n } @else if (card.derivation.kind === 'composition') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.unmatchedPolicy', 'Unmapped segment buckets') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.unmatchedPolicy ?? 'group-as-other'\"\n (ngModelChange)=\"patchDerivation({ unmatchedPolicy: $event })\"\n >\n <mat-option value=\"group-as-other\">{{ unmatchedPolicyLabel('group-as-other') }}</mat-option>\n <mat-option value=\"include-dynamically\">{{ unmatchedPolicyLabel('include-dynamically') }}</mat-option>\n <mat-option value=\"exclude-from-total\">{{ unmatchedPolicyLabel('exclude-from-total') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.headlineMode', 'Headline value') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.headlineMode ?? 'total'\"\n (ngModelChange)=\"patchDerivation({ headlineMode: $event })\"\n >\n <mat-option value=\"total\">{{ headlineModeLabel('total') }}</mat-option>\n <mat-option value=\"key-share\">{{ headlineModeLabel('key-share') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.headlineMode === 'key-share') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.headlineKey', 'Key-share bucket key') }}</mat-label>\n <input\n matInput\n data-testid=\"kpi-field-headline-key\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.headlineKey ?? ''\"\n (ngModelChange)=\"patchDerivation({ headlineKey: $event.trim() || undefined })\"\n />\n </mat-form-field>\n }\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.maxVisible', 'Max visible segments') }}</mat-label>\n <input\n matInput\n type=\"number\"\n min=\"2\"\n max=\"12\"\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.maxVisible ?? 5\"\n (ngModelChange)=\"patchDerivation({ maxVisible: $event })\"\n />\n </mat-form-field>\n } @else if (card.derivation.kind === 'timeseries-summary') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.seriesAggregation', 'Series aggregation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.seriesAggregation\"\n (ngModelChange)=\"patchDerivation({ seriesAggregation: $event })\"\n >\n <mat-option value=\"sum\">{{ seriesAggregationLabel('sum') }}</mat-option>\n <mat-option value=\"latest\">{{ seriesAggregationLabel('latest') }}</mat-option>\n <mat-option value=\"avg\">{{ seriesAggregationLabel('avg') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.deltaMode', 'Displayed variation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.deltaMode ?? 'last-vs-previous'\"\n (ngModelChange)=\"patchDerivation({ deltaMode: $event })\"\n >\n <mat-option value=\"last-vs-previous\">{{ timeseriesDeltaModeLabel('last-vs-previous') }}</mat-option>\n <mat-option value=\"last-vs-first\">{{ timeseriesDeltaModeLabel('last-vs-first') }}</mat-option>\n <mat-option value=\"none\">{{ timeseriesDeltaModeLabel('none') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.baselineZeroPolicy', 'When previous period is zero') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.baselineZeroPolicy ?? 'show-absolute'\"\n (ngModelChange)=\"patchDerivation({ baselineZeroPolicy: $event })\"\n >\n <mat-option value=\"show-absolute\">{{ baselineZeroPolicyLabel('show-absolute') }}</mat-option>\n <mat-option value=\"label-no-baseline\">{{ baselineZeroPolicyLabel('label-no-baseline') }}</mat-option>\n <mat-option value=\"hide-pct\">{{ baselineZeroPolicyLabel('hide-pct') }}</mat-option>\n </mat-select>\n </mat-form-field>\n } @else if (card.derivation.kind === 'comparison-delta') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.deltaMode', 'Displayed variation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.deltaMode ?? 'percent'\"\n (ngModelChange)=\"patchDerivation({ deltaMode: $event })\"\n >\n <mat-option value=\"percent\">{{ comparisonDeltaModeLabel('percent') }}</mat-option>\n <mat-option value=\"absolute\">{{ comparisonDeltaModeLabel('absolute') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.bucketKeys', 'Included bucket keys') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.bucketKeys)\"\n (ngModelChange)=\"patchDerivation({ bucketKeys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n } @else if (card.derivation.kind === 'scalar') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.scalarAggregation', 'Scalar aggregation') }}</mat-label>\n <mat-select\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"card.derivation.aggregation\"\n (ngModelChange)=\"patchDerivation({ aggregation: $event })\"\n >\n <mat-option value=\"total\">{{ scalarAggregationLabel('total') }}</mat-option>\n <mat-option value=\"sum-keys\">{{ scalarAggregationLabel('sum-keys') }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n @if (card.derivation.aggregation === 'sum-keys') {\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.derivation.scalarKeys', 'Included keys (sum-keys)') }}</mat-label>\n <input\n matInput\n [disabled]=\"isMetricLocked()\"\n [ngModel]=\"formatKeyList(card.derivation.keys)\"\n (ngModelChange)=\"patchDerivation({ keys: parseStringListCsv($event) })\"\n />\n </mat-form-field>\n }\n }\n </div>\n </section>\n\n @if (effectiveAllowGovernanceEditing()) {\n <section class=\"prx-kpi-editor__section\" data-testid=\"kpi-governance-section\">\n <h3 class=\"prx-kpi-editor__section-title\">\n {{ t('praxis.charts.kpiEditor.governance.section', 'Corporate governance') }}\n </h3>\n\n <p class=\"prx-kpi-editor__hint-text\">\n {{\n t(\n 'praxis.charts.kpiEditor.governance.hint',\n 'Controls which adjustments end users can save over this published indicator.'\n )\n }}\n </p>\n\n <div class=\"prx-kpi-editor__grid\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <mat-label>{{ t('praxis.charts.kpiEditor.governance.lockLevel', 'Lock level') }}</mat-label>\n <mat-select\n data-testid=\"kpi-field-lock-level\"\n [ngModel]=\"lockLevel()\"\n (ngModelChange)=\"updateLockLevel($event)\"\n >\n <mat-option value=\"none\">{{ lockLevelLabel('none') }}</mat-option>\n <mat-option value=\"metric-locked\">{{ lockLevelLabel('metric-locked') }}</mat-option>\n <mat-option value=\"full\">{{ lockLevelLabel('full') }}</mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n </section>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block}.prx-kpi-editor{display:grid;gap:16px}.prx-kpi-editor__preview-panel{display:grid;gap:12px;padding:14px;border-radius:14px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 70%,transparent);background:var(--md-sys-color-surface-container-low, rgba(15, 23, 42, .02))}.prx-kpi-editor__preview-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}.prx-kpi-editor__preview-heading{display:grid;gap:2px}.prx-kpi-editor__preview-hint{font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b)}.prx-kpi-editor__sim-select{min-width:240px}.prx-kpi-editor__preview-stage{max-width:360px}.prx-kpi-editor__banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-radius:10px;font-size:13px}.prx-kpi-editor__banner--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container, #fef3c7) 65%,transparent);color:var(--md-sys-color-on-tertiary-container, #451a03)}.prx-kpi-editor__banner--locked{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #e2e8f0) 70%,transparent);color:var(--md-sys-color-on-secondary-container, #1e293b)}.prx-kpi-editor__banner--error{background:color-mix(in srgb,var(--md-sys-color-error-container, #fee2e2) 70%,transparent);color:var(--md-sys-color-on-error-container, #7f1d1d)}.prx-kpi-editor__banner-content{display:grid;gap:4px}.prx-kpi-editor__errors{margin:0;padding:10px 16px 10px 28px;border-radius:10px;background:color-mix(in srgb,var(--md-sys-color-error-container, #fee2e2) 60%,transparent);color:var(--md-sys-color-on-error-container, #7f1d1d);font-size:13px}.prx-kpi-editor__tabs{display:flex;gap:8px;border-bottom:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 70%,transparent);padding-bottom:8px}.prx-kpi-editor__tab{appearance:none;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, #475569);padding:8px 14px;border-radius:999px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}.prx-kpi-editor__tab--active{background:var(--md-sys-color-secondary-container, rgba(37, 99, 235, .12));color:var(--md-sys-color-on-secondary-container, #1e3a8a);border-color:color-mix(in srgb,var(--md-sys-color-primary, #2563eb) 35%,transparent)}.prx-kpi-editor__panel,.prx-kpi-editor__section,.prx-kpi-editor__sublist{display:grid;gap:12px}.prx-kpi-editor__section{padding:14px;border-radius:12px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #cbd5e1) 60%,transparent);background:var(--md-sys-color-surface-container-lowest, transparent)}.prx-kpi-editor__section-title{margin:0;font-size:14px;font-weight:600;color:var(--md-sys-color-on-surface, #0f172a)}.prx-kpi-editor__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:center}.prx-kpi-editor__sublist-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.prx-kpi-editor__row{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr)) auto;gap:8px;align-items:center}.prx-kpi-editor__toggle{display:flex;align-items:center;min-height:44px}.prx-kpi-editor__readonly-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:12px}.prx-kpi-editor__chip{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:var(--md-sys-color-surface-container, rgba(15, 23, 42, .06));font-family:monospace}.prx-kpi-editor__icon-preview{color:var(--md-sys-color-primary, #0f766e);margin-right:4px}.prx-kpi-editor__icon-actions{display:inline-flex;align-items:center;gap:2px}.prx-kpi-editor__tone-option{display:inline-flex;align-items:center;gap:8px}.prx-kpi-editor__tone-swatch{display:inline-block;width:10px;height:10px;border-radius:999px;flex:0 0 auto;background:var(--prx-micro-tone-neutral, var(--md-sys-color-outline, #64748b))}.prx-kpi-editor__tone-swatch[data-tone=primary],.prx-kpi-editor__tone-swatch[data-tone=info]{background:var(--prx-micro-tone-info, var(--md-sys-color-primary, #0369a1))}.prx-kpi-editor__tone-swatch[data-tone=success]{background:var(--prx-micro-tone-success, var(--praxis-success, #166534))}.prx-kpi-editor__tone-swatch[data-tone=warning]{background:var(--prx-micro-tone-warning, var(--praxis-warning, #b45309))}.prx-kpi-editor__tone-swatch[data-tone=danger],.prx-kpi-editor__tone-swatch[data-tone=critical]{background:var(--prx-micro-tone-danger, var(--md-sys-color-error, #ba1a1a))}.prx-kpi-editor__hint-text{margin:0;font-size:12px;color:var(--md-sys-color-on-surface-variant, #64748b)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$5.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$5.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i6$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "component", type: PraxisKpiCardViewComponent, selector: "praxis-kpi-card-view", inputs: ["viewModel", "density", "allowRetry", "allowDrillDown", "showProvenance", "provenanceExpanded", "governed"], outputs: ["activate", "segmentActivate", "retry", "openProvenance", "drillDown"] }, { kind: "component", type: PraxisKpiCardComponent, selector: "praxis-kpi-card", inputs: ["card", "config", "queryContext", "density", "scopeKey", "showProvenance", "analytics"], outputs: ["crossFilter", "drillDown", "cardAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
50341
51003
|
}
|
|
50342
51004
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisKpiCardConfigEditorComponent, decorators: [{
|
|
50343
51005
|
type: Component,
|
|
@@ -54972,4 +55634,4 @@ function createResourceStatsDataSource(config) {
|
|
|
54972
55634
|
* Generated bundle index. Do not edit.
|
|
54973
55635
|
*/
|
|
54974
55636
|
|
|
54975
|
-
export { AnalyticsChartConfigAdapterService, AnalyticsChartContractService, ChartContractNormalizerService, ChartContractValidationService, ChartEditorDefaultsService, ChartEditorPreviewMapperService, ChartResourceCapabilityCatalogAdapter, EChartsMicroOptionBuilderService, EChartsMicroSvgEngineService, KPI_CURATED_ICONS, KPI_MAX_QUERIES_PER_PAGE_BUDGET, KPI_SIMULATION_MODES, KPI_VISUALIZATION_BY_DERIVATION, MS_PER_DAY, PRAXIS_ANALYTICS_COCKPIT_COMPONENT_METADATA, PRAXIS_ANALYTICS_PRESENTATION_AUTHORING_MANIFEST, PRAXIS_ANALYTICS_PRESENTATION_COMPONENT_METADATA, PRAXIS_CALCULATION_WATERFALL_COMPONENT_METADATA, PRAXIS_CHARTS_AUTHORING_MANIFEST, PRAXIS_CHARTS_I18N, PRAXIS_CHART_AUTHORING_COVERAGE, PRAXIS_CHART_BACKEND_MOCK_BAR, PRAXIS_CHART_BACKEND_MOCK_COMBO, PRAXIS_CHART_BACKEND_MOCK_DONUT, PRAXIS_CHART_BACKEND_MOCK_HEATMAP_MATRIX, PRAXIS_CHART_BACKEND_MOCK_HORIZONTAL_BAR, PRAXIS_CHART_BACKEND_MOCK_MULTI_METRIC_BAR, PRAXIS_CHART_BACKEND_MOCK_SCATTER, PRAXIS_CHART_BACKEND_MOCK_STACKED_AREA, PRAXIS_CHART_BACKEND_MOCK_TIMESERIES, PRAXIS_CHART_COMPONENT_METADATA, PRAXIS_CHART_DRILLDOWN_DATA_BY_MONTH, PRAXIS_CHART_DRILLDOWN_PANEL_COMPONENT_METADATA, PRAXIS_CHART_DRILLDOWN_PANEL_PORTS, PRAXIS_CHART_ENGINE, PRAXIS_CHART_ENGINE_FACTORY, PRAXIS_CHART_PALETTE_TOKENS, PRAXIS_CHART_STATE_PROBE_COMPONENT_METADATA, PRAXIS_CHART_THEME_VARIANTS, PRAXIS_KPI_CARD_AUTHORING_MANIFEST, PRAXIS_KPI_CARD_COMPONENT_METADATA, PRAXIS_KPI_STRIP_AUTHORING_MANIFEST, PRAXIS_KPI_STRIP_COMPONENT_METADATA, PRAXIS_MICRO_KPI_STRIP_COMPONENT_METADATA, PRAXIS_MICRO_VISUALIZATION_COMPONENT_METADATA, PRAXIS_PROGRESSION_LADDER_AUTHORING_MANIFEST, PRAXIS_PROGRESSION_LADDER_COMPONENT_METADATA, PRAXIS_PROGRESSION_LADDER_DEFAULT_DOCUMENT, PRAXIS_PROGRESSION_LADDER_PORTS, PRAXIS_PROGRESSION_LADDER_VERSION, PRAXIS_QUOTA_GAUGE_COMPONENT_METADATA, PRAXIS_RELATIONSHIP_GRAPH_SELECTOR, PRAXIS_TIMELINE_LANES_AUTHORING_MANIFEST, PRAXIS_TIMELINE_LANES_COMPONENT_METADATA, PRAXIS_TIMELINE_LANES_DEFAULT_CONFIG, PRAXIS_TIMELINE_LANES_PORTS, PRAXIS_TIMELINE_LANES_VERSION, PRAXIS_X_UI_CHART_AUTHORABLE_VERSION, PraxisAnalyticsCockpitComponent, PraxisAnalyticsPresentationComponent, PraxisAnalyticsPresentationWidgetConfigEditorComponent, PraxisCalculationWaterfallComponent, PraxisChartBackendPayloadAdapterService, PraxisChartCanonicalContractMapperService, PraxisChartComponent, PraxisChartCompositionShowcaseComponent, PraxisChartConfigEditor, PraxisChartDataTransformerService, PraxisChartDrilldownPanelComponent, PraxisChartSchemaMapperService, PraxisChartStateProbeComponent, PraxisChartStatsApiService, PraxisChartWidgetConfigEditor, PraxisKpiAnalyticsHydratorService, PraxisKpiCardComponent, PraxisKpiCardConfigEditorComponent, PraxisKpiCardWidgetConfigEditorComponent, PraxisKpiEditorCatalogService, PraxisKpiStripComponent, PraxisKpiStripConfigEditorComponent, PraxisKpiStripWidgetConfigEditorComponent, PraxisMicroKpiStripComponent, PraxisProgressionLadderComponent, PraxisProgressionLadderConfigEditorComponent, PraxisQuotaGaugeComponent, PraxisTimelineLanesComponent, PraxisTimelineLanesConfigEditorComponent, TIMELINE_LANES_AI_CAPABILITIES, TIMELINE_LANES_COMPONENT_CONTEXT_PACK, applyRecipeHintToCard, buildBoxplotEChartsOption, buildBoxplotTransformedData, buildCalendarEChartsOption, buildCalendarTransformedData, buildCardSpecFromVerifiedRecipe, buildHierarchicalTree, buildKpiCrossFilterToggleEvent, buildKpiStatsExecutionRequest, buildPraxisChartInteractiveCanvasPage, buildPraxisChartInteractiveWidgetPage, buildPraxisChartMockCanvasPage, buildPraxisChartMockWidgetPage, buildProgressionCoordinateMatrix, buildSimulatedKpiEnvelope, buildTimelineNormalizedDataset, buildWaterfallEChartsOption, buildWaterfallTransformedData, cloneKpiCardWithNewUuid, coerceCrossFilterPayload, coerceCrossFilterValue, coerceVisualizationForDerivation, collectLaneDefinitions, computeAlignedDomainBounds, computeLinearQuantile, computeMadBoxplotStats, computeTukeyBoxplotStats, computeUtcDaysInclusive, createDefaultKpiCardSpec, createPraxisChartsI18nConfig, createResourceStatsDataSource, detectSankeyCycles, detectTimelineConflicts, escapeTimelineCssAttr, expandMonthlyRangeToIsoDates, extractPraxisAnalyticsFromSchemaPayload, extractProgressionTierKeys, formatSankeyCycleDiagnosticMessage, formatSignedWaterfallValue, formatTimelineUtcDate, formatUtcIsoDate, generateKpiUuid, generateTimeTicks, getCompatibleVisualizationKinds, groupProgressionStepsForMatrix, humanizeProgressionEnumCode, inspectKpiStripQueries, isAnalyticsRowPrivacySuppressed, isKpiCrossFilterActive, isMonthlyFilterKey, isNullFilterCriterion, isPraxisChartPaletteToken, isValidKpiCanonicalResourcePath, isValidKpiSnakeCaseIcon, matchesDimensionFieldKey, mergeCrossFiltersIntoQueryContext, normalizeCalculationWaterfallTrails, normalizeMonthlyFilterValues, normalizeProgressionLadderDocument, normalizeTimelineItems, normalizeTimelineTone, normalizeYearMonthToken, packLaneTracks, parseIsoUtcDateMs, parseYearMonthParts, providePraxisAnalyticsCockpitMetadata, providePraxisAnalyticsPresentationMetadata, providePraxisCalculationWaterfallMetadata, providePraxisChartDrilldownPanelMetadata, providePraxisChartStateProbeMetadata, providePraxisCharts, providePraxisChartsI18n, providePraxisChartsMetadata, providePraxisChartsWidgets, providePraxisKpiCardMetadata, providePraxisKpiStripMetadata, providePraxisMicroKpiStripMetadata, providePraxisMicroVisualizationMetadata, providePraxisProgressionLadderMetadata, providePraxisQuotaGaugeMetadata, providePraxisTimelineLanesMetadata, readKpiEditableText, resolveCalendarRangeBounds, resolveEffectiveTimelineMapping, resolveHierarchyDimensions, resolveHierarchyViewAtPath, resolveKpiContextFilters, resolveKpiDimensionField, resolveKpiEffectiveFilters, resolvePraxisChartPaletteToken, resolvePraxisChartsText, resolveSankeyConfigLinks, sanitizeChartDocumentOverride, sanitizeChartDocumentOverridesMap, shouldUseHierarchicalTree, toIsoCalendarDate, transformRadarDataset, transformSankeyDataset, validateD1ChartContract, validateKpiCardSpec, validateKpiStripConfig };
|
|
55637
|
+
export { AnalyticsChartConfigAdapterService, AnalyticsChartContractService, ChartContractNormalizerService, ChartContractValidationService, ChartEditorDefaultsService, ChartEditorPreviewMapperService, ChartResourceCapabilityCatalogAdapter, EChartsMicroOptionBuilderService, EChartsMicroSvgEngineService, KPI_CURATED_ICONS, KPI_MAX_QUERIES_PER_PAGE_BUDGET, KPI_SIMULATION_MODES, KPI_VISUALIZATION_BY_DERIVATION, MS_PER_DAY, PRAXIS_ANALYTICS_COCKPIT_COMPONENT_METADATA, PRAXIS_ANALYTICS_PRESENTATION_AUTHORING_MANIFEST, PRAXIS_ANALYTICS_PRESENTATION_COMPONENT_METADATA, PRAXIS_CALCULATION_WATERFALL_COMPONENT_METADATA, PRAXIS_CHARTS_AUTHORING_MANIFEST, PRAXIS_CHARTS_I18N, PRAXIS_CHART_AUTHORING_COVERAGE, PRAXIS_CHART_BACKEND_MOCK_BAR, PRAXIS_CHART_BACKEND_MOCK_COMBO, PRAXIS_CHART_BACKEND_MOCK_DONUT, PRAXIS_CHART_BACKEND_MOCK_HEATMAP_MATRIX, PRAXIS_CHART_BACKEND_MOCK_HORIZONTAL_BAR, PRAXIS_CHART_BACKEND_MOCK_MULTI_METRIC_BAR, PRAXIS_CHART_BACKEND_MOCK_SCATTER, PRAXIS_CHART_BACKEND_MOCK_STACKED_AREA, PRAXIS_CHART_BACKEND_MOCK_TIMESERIES, PRAXIS_CHART_COMPONENT_METADATA, PRAXIS_CHART_DRILLDOWN_DATA_BY_MONTH, PRAXIS_CHART_DRILLDOWN_PANEL_COMPONENT_METADATA, PRAXIS_CHART_DRILLDOWN_PANEL_PORTS, PRAXIS_CHART_ENGINE, PRAXIS_CHART_ENGINE_FACTORY, PRAXIS_CHART_PALETTE_TOKENS, PRAXIS_CHART_STATE_PROBE_COMPONENT_METADATA, PRAXIS_CHART_THEME_VARIANTS, PRAXIS_KPI_CARD_AUTHORING_MANIFEST, PRAXIS_KPI_CARD_COMPONENT_METADATA, PRAXIS_KPI_STRIP_AUTHORING_MANIFEST, PRAXIS_KPI_STRIP_COMPONENT_METADATA, PRAXIS_MICRO_KPI_STRIP_COMPONENT_METADATA, PRAXIS_MICRO_VISUALIZATION_COMPONENT_METADATA, PRAXIS_PROGRESSION_LADDER_AUTHORING_MANIFEST, PRAXIS_PROGRESSION_LADDER_COMPONENT_METADATA, PRAXIS_PROGRESSION_LADDER_DEFAULT_DOCUMENT, PRAXIS_PROGRESSION_LADDER_PORTS, PRAXIS_PROGRESSION_LADDER_VERSION, PRAXIS_QUOTA_GAUGE_COMPONENT_METADATA, PRAXIS_RELATIONSHIP_GRAPH_SELECTOR, PRAXIS_TIMELINE_LANES_AUTHORING_MANIFEST, PRAXIS_TIMELINE_LANES_COMPONENT_METADATA, PRAXIS_TIMELINE_LANES_DEFAULT_CONFIG, PRAXIS_TIMELINE_LANES_PORTS, PRAXIS_TIMELINE_LANES_VERSION, PRAXIS_X_UI_CHART_AUTHORABLE_VERSION, PraxisAnalyticsCockpitComponent, PraxisAnalyticsPresentationComponent, PraxisAnalyticsPresentationWidgetConfigEditorComponent, PraxisCalculationWaterfallComponent, PraxisChartBackendPayloadAdapterService, PraxisChartCanonicalContractMapperService, PraxisChartComponent, PraxisChartCompositionShowcaseComponent, PraxisChartConfigEditor, PraxisChartDataTransformerService, PraxisChartDrilldownPanelComponent, PraxisChartSchemaMapperService, PraxisChartStateProbeComponent, PraxisChartStatsApiService, PraxisChartWidgetConfigEditor, PraxisKpiAnalyticsHydratorService, PraxisKpiCardComponent, PraxisKpiCardConfigEditorComponent, PraxisKpiCardWidgetConfigEditorComponent, PraxisKpiEditorCatalogService, PraxisKpiStripComponent, PraxisKpiStripConfigEditorComponent, PraxisKpiStripWidgetConfigEditorComponent, PraxisMicroKpiStripComponent, PraxisProgressionLadderComponent, PraxisProgressionLadderConfigEditorComponent, PraxisQuotaGaugeComponent, PraxisTimelineLanesComponent, PraxisTimelineLanesConfigEditorComponent, TIMELINE_LANES_AI_CAPABILITIES, TIMELINE_LANES_COMPONENT_CONTEXT_PACK, applyRecipeHintToCard, buildBoxplotEChartsOption, buildBoxplotTransformedData, buildCalendarEChartsOption, buildCalendarTransformedData, buildCardSpecFromVerifiedRecipe, buildHierarchicalTree, buildKpiCrossFilterToggleEvent, buildKpiSegmentCrossFilterToggleEvent, buildKpiStatsExecutionRequest, buildPraxisChartInteractiveCanvasPage, buildPraxisChartInteractiveWidgetPage, buildPraxisChartMockCanvasPage, buildPraxisChartMockWidgetPage, buildProgressionCoordinateMatrix, buildSimulatedKpiEnvelope, buildTimelineNormalizedDataset, buildWaterfallEChartsOption, buildWaterfallTransformedData, cloneKpiCardWithNewUuid, coerceCrossFilterPayload, coerceCrossFilterValue, coerceVisualizationForDerivation, collectLaneDefinitions, computeAlignedDomainBounds, computeLinearQuantile, computeMadBoxplotStats, computeTukeyBoxplotStats, computeUtcDaysInclusive, createDefaultKpiCardSpec, createPraxisChartsI18nConfig, createResourceStatsDataSource, detectSankeyCycles, detectTimelineConflicts, escapeTimelineCssAttr, expandMonthlyRangeToIsoDates, extractPraxisAnalyticsFromSchemaPayload, extractProgressionTierKeys, formatSankeyCycleDiagnosticMessage, formatSignedWaterfallValue, formatTimelineUtcDate, formatUtcIsoDate, generateKpiUuid, generateTimeTicks, getCompatibleVisualizationKinds, groupProgressionStepsForMatrix, humanizeProgressionEnumCode, inspectKpiStripQueries, isAnalyticsRowPrivacySuppressed, isKpiCardFilterOwnedActive, isKpiCrossFilterActive, isMonthlyFilterKey, isNullFilterCriterion, isPraxisChartPaletteToken, isValidKpiCanonicalResourcePath, isValidKpiSnakeCaseIcon, matchesDimensionFieldKey, mergeCrossFiltersIntoQueryContext, normalizeCalculationWaterfallTrails, normalizeMonthlyFilterValues, normalizeProgressionLadderDocument, normalizeTimelineItems, normalizeTimelineTone, normalizeYearMonthToken, packLaneTracks, parseIsoUtcDateMs, parseYearMonthParts, providePraxisAnalyticsCockpitMetadata, providePraxisAnalyticsPresentationMetadata, providePraxisCalculationWaterfallMetadata, providePraxisChartDrilldownPanelMetadata, providePraxisChartStateProbeMetadata, providePraxisCharts, providePraxisChartsI18n, providePraxisChartsMetadata, providePraxisChartsWidgets, providePraxisKpiCardMetadata, providePraxisKpiStripMetadata, providePraxisMicroKpiStripMetadata, providePraxisMicroVisualizationMetadata, providePraxisProgressionLadderMetadata, providePraxisQuotaGaugeMetadata, providePraxisTimelineLanesMetadata, readKpiEditableText, resolveActiveKpiDimensionValues, resolveCalendarRangeBounds, resolveEffectiveTimelineMapping, resolveHierarchyDimensions, resolveHierarchyViewAtPath, resolveKpiContextFilters, resolveKpiDimensionField, resolveKpiEffectiveFilters, resolvePraxisChartPaletteToken, resolvePraxisChartsText, resolveSankeyConfigLinks, sanitizeChartDocumentOverride, sanitizeChartDocumentOverridesMap, shouldUseHierarchicalTree, toIsoCalendarDate, transformRadarDataset, transformSankeyDataset, validateD1ChartContract, validateKpiCardSpec, validateKpiStripConfig };
|