@praxisui/crud 10.0.0-rc.72 → 10.0.0-rc.74

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.
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, DestroyRef, signal, HostListener, ViewChild, Inject, ViewEncapsulation, Component, Injectable, ElementRef, computed, ChangeDetectionStrategy, EventEmitter, ChangeDetectorRef, LOCALE_ID, Output, Input, Injector, InjectionToken, input, linkedSignal, effect, output, booleanAttribute, Optional, ENVIRONMENT_INITIALIZER, untracked } from '@angular/core';
4
+ import { inject, DestroyRef, signal, HostListener, ViewChild, Inject, ViewEncapsulation, Component, Injectable, ElementRef, computed, ChangeDetectionStrategy, EventEmitter, ChangeDetectorRef, LOCALE_ID, Output, Input, Injector, InjectionToken, input, linkedSignal, effect, output, viewChild, booleanAttribute, Optional, ENVIRONMENT_INITIALIZER, untracked } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { HttpClient, HttpHeaders } from '@angular/common/http';
7
7
  import { Router, GuardsCheckEnd, ActivatedRoute, RouterLink } from '@angular/router';
@@ -11,7 +11,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
11
11
  import { firstValueFrom, of, switchMap, Subscription, filter, startWith, takeUntil, fromEvent, BehaviorSubject, isObservable, forkJoin, catchError as catchError$1 } from 'rxjs';
12
12
  import { catchError, switchMap as switchMap$1, take, filter as filter$1, finalize } from 'rxjs/operators';
13
13
  import * as i2$1 from '@praxisui/core';
14
- import { PraxisBulkClientService, PraxisI18nService, isBulkExecutionTerminal, resolveBulkWireIdKindFromSchema, coerceBulkWireId, coerceBulkTargetsWireIds, generateBulkIdempotencyKey, FieldControlType, API_URL, DynamicFormService, PraxisCacheInvalidatorService, EnterpriseRuntimeContextService, readStrongResourceEtag, mapFieldDefinitionToMetadata, buildApiUrl, composeHeadersWithVersion, providePraxisI18nConfig, PraxisStatsExecutionService, SafeExpressionEvaluator, extractPraxisApiPathPrefix, normalizePraxisResourcePath, resolvePraxisSchemasFilteredUrl, normalizeQuickFilterCriteria, isUnresolvedTemplateToken, applyDeclarativeValuePipe, ASYNC_CONFIG_STORAGE, GlobalConfigService, CrudOperationResolutionService, ComponentKeyService, LoggerService, normalizeConfigPersistenceStrategy, SurfaceNavigationError, normalizeResourceScopeId, fillUndefined, GenericCrudService, ResourceDiscoveryService, SETTINGS_PANEL_DATA, mapCatalogFieldsToMetadata, humanizeCatalogFieldName, inferDomainSemanticTone, buildBaseColumnFromDef, mapFieldDefinitionsToMetadata, PraxisIconDirective, ResourceQuickConnectComponent, SchemaNormalizerService, normalizeQuickFilterTone, synthesizeScopeBarQuickFilterItems, PraxisWidgetEventBus, PraxisWorkspaceQueryContextService, PraxisContextFilterProjectorService, GLOBAL_SURFACE_SERVICE, SurfaceOutletRegistryService, ResourceActionOpenAdapterService, ResourceSurfaceOpenAdapterService, normalizeSurfaceOperationContext, createDefaultTableConfig, SURFACE_DRAWER_REF, translateUnavailableWorkflowMessage, isSurfaceNavigationError, translateSurfaceNavigationRejected, normalizeUnknownError, parseConfigPersistenceError, EmptyStateCardComponent, RESOURCE_DISCOVERY_I18N_CONFIG, PraxisCustomizationModeService, SURFACE_DRAWER_CONTENT_DATA, PraxisIconButtonComponent, PraxisResourceIdentityComponent, ComponentMetadataRegistry, materializeResourceIdentity, resolveResourceIdentityContract, evaluateFieldAccess, PraxisDecisionInspectorService, translateDecisionInspector, PraxisOperationalAssistantLaunchService, PRAXIS_BULK_PROPOSAL_BRIDGE } from '@praxisui/core';
14
+ import { PraxisBulkClientService, PraxisI18nService, isBulkExecutionTerminal, resolveBulkWireIdKindFromSchema, coerceBulkWireId, coerceBulkTargetsWireIds, generateBulkIdempotencyKey, FieldControlType, API_URL, DynamicFormService, PraxisCacheInvalidatorService, EnterpriseRuntimeContextService, readStrongResourceEtag, mapFieldDefinitionToMetadata, buildApiUrl, composeHeadersWithVersion, providePraxisI18nConfig, extractPraxisApiPathPrefix, PraxisStatsExecutionService, SafeExpressionEvaluator, normalizePraxisResourcePath, resolvePraxisFilterCriteria, resolvePraxisSchemasFilteredUrl, normalizeQuickFilterCriteria, isUnresolvedTemplateToken, applyDeclarativeValuePipe, ASYNC_CONFIG_STORAGE, GlobalConfigService, CrudOperationResolutionService, ComponentKeyService, LoggerService, normalizeConfigPersistenceStrategy, SurfaceNavigationError, normalizeResourceScopeId, fillUndefined, GenericCrudService, ResourceDiscoveryService, SETTINGS_PANEL_DATA, mapCatalogFieldsToMetadata, humanizeCatalogFieldName, inferDomainSemanticTone, buildBaseColumnFromDef, mapFieldDefinitionsToMetadata, PraxisIconDirective, ResourceQuickConnectComponent, SchemaNormalizerService, normalizeQuickFilterTone, synthesizeScopeBarQuickFilterItems, PraxisWidgetEventBus, PraxisWorkspaceQueryContextService, PraxisContextFilterProjectorService, GLOBAL_SURFACE_SERVICE, SurfaceOutletRegistryService, ResourceActionOpenAdapterService, ResourceSurfaceOpenAdapterService, normalizeSurfaceOperationContext, createDefaultTableConfig, SURFACE_DRAWER_REF, translateUnavailableWorkflowMessage, isSurfaceNavigationError, translateSurfaceNavigationRejected, normalizeUnknownError, parseConfigPersistenceError, EmptyStateCardComponent, RESOURCE_DISCOVERY_I18N_CONFIG, PraxisCustomizationModeService, SURFACE_DRAWER_CONTENT_DATA, PraxisIconButtonComponent, PraxisResourceIdentityComponent, ComponentMetadataRegistry, materializeResourceIdentity, isMaskedPresentationToken, resolveResourceIdentityContract, evaluateFieldAccess, PraxisDecisionInspectorService, translateDecisionInspector, PraxisOperationalAssistantLaunchService, PRAXIS_BULK_PROPOSAL_BRIDGE } from '@praxisui/core';
15
15
  import * as i3 from '@angular/material/button';
16
16
  import { MatButtonModule } from '@angular/material/button';
17
17
  import * as i4 from '@angular/material/icon';
@@ -100,6 +100,9 @@ const PRAXIS_CRUD_RUNTIME_I18N_CONFIG = {
100
100
  'crud.delete.confirmMessage': 'Esta ação não pode ser desfeita. Deseja continuar?',
101
101
  'crud.delete.cancel': 'Cancelar',
102
102
  'crud.kpi.refreshTooltip': 'Atualizar indicadores',
103
+ 'crud.kpi.scopeEmpty': 'Nenhum grupo publicado para este recorte.',
104
+ 'crud.kpi.scopeUnavailable': 'Indicadores indisponíveis para este recorte.',
105
+ 'crud.kpi.scopePartial': 'Os dados publicados são parciais para este recorte.',
103
106
  'crud.kpi.schemaTotalLabel': 'Total de registros',
104
107
  'crud.kpi.schemaQuickFilterCaption': 'Filtro rápido do recurso',
105
108
  'crud.dossier.eyebrow': 'Dossiê 360° do Registro',
@@ -178,6 +181,9 @@ const PRAXIS_CRUD_RUNTIME_I18N_CONFIG = {
178
181
  'crud.delete.confirmMessage': 'This action cannot be undone. Do you want to continue?',
179
182
  'crud.delete.cancel': 'Cancel',
180
183
  'crud.kpi.refreshTooltip': 'Refresh indicators',
184
+ 'crud.kpi.scopeEmpty': 'No groups published for this selection.',
185
+ 'crud.kpi.scopeUnavailable': 'Indicators are unavailable for this selection.',
186
+ 'crud.kpi.scopePartial': 'Published data is partial for this selection.',
181
187
  'crud.kpi.schemaTotalLabel': 'Total Records',
182
188
  'crud.kpi.schemaQuickFilterCaption': 'Resource quick filter',
183
189
  'crud.dossier.eyebrow': '360° Record Dossier',
@@ -9477,6 +9483,70 @@ function extractHttpErrorMessage(error, fallback) {
9477
9483
  return errObj.message || fallback;
9478
9484
  }
9479
9485
 
9486
+ function resolveConfiguredKpiBand(metadata) {
9487
+ return metadata.kpiBand ?? (metadata.table?.kpiBand ?? metadata.table?.behavior?.kpiBand);
9488
+ }
9489
+ function equalFilterValues(left, right) {
9490
+ if (left === right)
9491
+ return true;
9492
+ if (left === null || right === null || typeof left !== 'object' || typeof right !== 'object')
9493
+ return false;
9494
+ if (Array.isArray(left) || Array.isArray(right)) {
9495
+ return Array.isArray(left) && Array.isArray(right) && left.length === right.length &&
9496
+ left.every((value, index) => equalFilterValues(value, right[index]));
9497
+ }
9498
+ if (left instanceof Date || right instanceof Date) {
9499
+ return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
9500
+ }
9501
+ return Object.keys(left).length === Object.keys(right).length &&
9502
+ includesKpiCriteria(left, right);
9503
+ }
9504
+ /** A queue selection may coexist with unrelated search and workspace fields. */
9505
+ function includesKpiCriteria(current, criteria) {
9506
+ return Object.entries(criteria).every(([key, value]) => Object.prototype.hasOwnProperty.call(current, key) && equalFilterValues(current[key], value));
9507
+ }
9508
+ function toggleKpiCriteria(current, criteria, lockedFields) {
9509
+ const editable = { ...criteria };
9510
+ for (const field of lockedFields) {
9511
+ if (!Object.prototype.hasOwnProperty.call(criteria, field))
9512
+ continue;
9513
+ if (!includesKpiCriteria(current, { [field]: criteria[field] }))
9514
+ return current;
9515
+ delete editable[field];
9516
+ }
9517
+ if (!includesKpiCriteria(current, editable))
9518
+ return { ...current, ...editable };
9519
+ return Object.fromEntries(Object.entries(current).filter(([key]) => !Object.prototype.hasOwnProperty.call(editable, key)));
9520
+ }
9521
+
9522
+ const KPI_GROUP_BY_SUFFIX = '/stats/group-by';
9523
+ function resolveKpiBandMethod(method) {
9524
+ return typeof method === 'string' && method.toUpperCase() === 'POST' ? 'POST' : 'GET';
9525
+ }
9526
+ function resolveKpiBandApiBase(apiUrls, endpointKey, apiUrlEntry) {
9527
+ const key = String(endpointKey ?? '').trim();
9528
+ const entry = apiUrlEntry ||
9529
+ (key && apiUrls ? apiUrls[key] : undefined) ||
9530
+ apiUrls?.['default'] ||
9531
+ (apiUrls ? Object.values(apiUrls)[0] : undefined);
9532
+ return entry ? buildApiUrl(entry).replace(/\/+$/, '') : '';
9533
+ }
9534
+ function resolveKpiBandSourceUrl(rawSource, base) {
9535
+ const source = rawSource.trim();
9536
+ if (!base || !source || source.startsWith('http://') || source.startsWith('https://')) {
9537
+ return source;
9538
+ }
9539
+ const path = source.startsWith('/') ? source : `/${source}`;
9540
+ const prefix = extractPraxisApiPathPrefix(base);
9541
+ if (prefix && (path === prefix || path.startsWith(`${prefix}/`))) {
9542
+ return `${base.slice(0, -prefix.length)}${path}`;
9543
+ }
9544
+ if (path.startsWith('/api/') && /\/api$/i.test(base)) {
9545
+ return `${base.slice(0, -4)}${path}`;
9546
+ }
9547
+ return `${base}${path}`;
9548
+ }
9549
+
9480
9550
  function resolveCurrencyCodeForLocale(locale) {
9481
9551
  const normalized = locale.trim().toLowerCase();
9482
9552
  if (normalized.startsWith('pt-br'))
@@ -9624,6 +9694,9 @@ class PraxisKpiBandComponent {
9624
9694
  capabilities;
9625
9695
  /** Schema bruto opcional já resolvido pelo host (`/schemas/filtered`). */
9626
9696
  schemaMetadata;
9697
+ queryContext;
9698
+ /** The live table passes null until its canonical collection request is available. */
9699
+ tableFilterRequest;
9627
9700
  /** Filtro base herdado do host/contexto para consultas `/stats/group-by`. */
9628
9701
  baseFilter;
9629
9702
  cardClick = new EventEmitter();
@@ -9642,6 +9715,18 @@ class PraxisKpiBandComponent {
9642
9715
  maxTokens: 150,
9643
9716
  });
9644
9717
  isLoading = false;
9718
+ scopeStatus = null;
9719
+ get scopeStatusLabel() {
9720
+ if (!this.scopeStatus)
9721
+ return null;
9722
+ const messages = {
9723
+ partial: ['crud.kpi.scopePartial', 'Os dados publicados são parciais para este recorte.'],
9724
+ empty: ['crud.kpi.scopeEmpty', 'Nenhum grupo publicado para este recorte.'],
9725
+ unavailable: ['crud.kpi.scopeUnavailable', 'Indicadores indisponíveis para este recorte.'],
9726
+ };
9727
+ const [key, label] = messages[this.scopeStatus];
9728
+ return this.i18n ? translateCrudRuntimeText(this.i18n, key, label) : label;
9729
+ }
9645
9730
  evaluatedCards = [];
9646
9731
  fetchedData = {};
9647
9732
  skeletonPlaceholders = [1, 2, 3, 4];
@@ -9701,7 +9786,7 @@ class PraxisKpiBandComponent {
9701
9786
  changes['quickFilters'] ||
9702
9787
  changes['capabilities'] ||
9703
9788
  changes['schemaMetadata'] ||
9704
- changes['baseFilter']) {
9789
+ changes['baseFilter'] || changes['queryContext'] || changes['tableFilterRequest']) {
9705
9790
  const prevConfig = changes['config']?.previousValue;
9706
9791
  const nextConfig = this.config;
9707
9792
  const endpointKeyChanged = !!changes['endpointKey'] &&
@@ -9716,17 +9801,22 @@ class PraxisKpiBandComponent {
9716
9801
  const baseFilterChanged = !!changes['baseFilter'] &&
9717
9802
  JSON.stringify(changes['baseFilter'].previousValue ?? null) !==
9718
9803
  JSON.stringify(changes['baseFilter'].currentValue ?? null);
9804
+ const queryChanged = !!changes['queryContext'] &&
9805
+ JSON.stringify(changes['queryContext'].previousValue) !== JSON.stringify(this.queryContext);
9719
9806
  if (resourcePathChanged) {
9720
9807
  this.fetchedSchemaMetadata = null;
9721
9808
  this.schemaGroupByField = null;
9722
9809
  this.evaluatedCards = [];
9723
9810
  this.fetchedData = {};
9724
9811
  }
9725
- const shouldRefetch = endpointKeyChanged ||
9812
+ const shouldRefetch = (nextConfig?.filterScope === 'table' && (queryChanged || (!!changes['tableFilterRequest'] &&
9813
+ JSON.stringify(changes['tableFilterRequest'].previousValue) !== JSON.stringify(this.tableFilterRequest)))) ||
9814
+ endpointKeyChanged ||
9726
9815
  apiUrlEntryChanged ||
9727
- (this.isSchemaSource && (resourcePathChanged || baseFilterChanged)) ||
9816
+ ((this.isSchemaSource || nextConfig?.filterScope === 'table') && (resourcePathChanged || baseFilterChanged)) ||
9728
9817
  (!!changes['config'] &&
9729
9818
  (nextConfig?.source !== prevConfig?.source ||
9819
+ nextConfig?.filterScope !== prevConfig?.filterScope ||
9730
9820
  nextConfig?.method !== prevConfig?.method ||
9731
9821
  JSON.stringify(nextConfig?.payload ?? null) !== JSON.stringify(prevConfig?.payload ?? null)));
9732
9822
  if (shouldRefetch) {
@@ -9745,37 +9835,31 @@ class PraxisKpiBandComponent {
9745
9835
  this.refresh(true);
9746
9836
  }
9747
9837
  refresh(bypassCache = false) {
9838
+ this.scopeStatus = null;
9839
+ if (this.config?.filterScope === 'table' && (!this.config.source || this.isSchemaSource)) {
9840
+ this.fetchSub?.unsubscribe();
9841
+ this.fetchedData = {};
9842
+ this.evaluatedCards = [];
9843
+ this.isLoading = false;
9844
+ this.scopeStatus = 'unavailable';
9845
+ this.cdr.markForCheck();
9846
+ return;
9847
+ }
9748
9848
  if (this.config?.source) {
9749
9849
  this.fetchFromSource(bypassCache);
9750
9850
  }
9751
9851
  else {
9852
+ this.fetchSub?.unsubscribe();
9853
+ this.isLoading = false;
9854
+ this.fetchedData = {};
9752
9855
  this.recomputeCards();
9753
9856
  }
9754
9857
  }
9755
9858
  resolveSourceUrl(rawSource) {
9756
- const trimmed = rawSource.trim();
9757
- if (!trimmed || trimmed.startsWith('http://') || trimmed.startsWith('https://')) {
9758
- return trimmed;
9759
- }
9760
- const key = String(this.endpointKey ?? '').trim();
9761
- const resolvedEntry = this.apiUrlEntry ||
9762
- (key && this.apiUrl ? this.apiUrl[key] : undefined) ||
9763
- this.apiUrl?.['default'] ||
9764
- (this.apiUrl ? Object.values(this.apiUrl)[0] : undefined);
9765
- const base = resolvedEntry ? buildApiUrl(resolvedEntry).replace(/\/+$/, '') : '';
9766
- if (!base) {
9767
- return trimmed;
9768
- }
9769
- const cleanPath = trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
9770
- const entryPrefix = extractPraxisApiPathPrefix(base);
9771
- if (entryPrefix &&
9772
- (cleanPath === entryPrefix || cleanPath.startsWith(`${entryPrefix}/`))) {
9773
- return `${base.slice(0, -entryPrefix.length)}${cleanPath}`;
9774
- }
9775
- if (cleanPath.startsWith('/api/') && /\/api$/i.test(base)) {
9776
- return `${base.slice(0, -4)}${cleanPath}`;
9777
- }
9778
- return `${base}${cleanPath}`;
9859
+ return resolveKpiBandSourceUrl(rawSource, this.resolveApiBaseUrl());
9860
+ }
9861
+ resolveApiBaseUrl() {
9862
+ return resolveKpiBandApiBase(this.apiUrl, this.endpointKey, this.apiUrlEntry);
9779
9863
  }
9780
9864
  isStatsPostUrl(url) {
9781
9865
  return /\/stats\/[^/?#]+(?:$|\?|\/)/i.test(url);
@@ -9796,10 +9880,43 @@ class PraxisKpiBandComponent {
9796
9880
  this.isLoading = true;
9797
9881
  this.cdr.markForCheck();
9798
9882
  const effectiveUrl = this.resolveSourceUrl(source);
9799
- const method = (this.config?.method || 'GET').toUpperCase();
9883
+ const method = resolveKpiBandMethod(this.config?.method);
9800
9884
  const normalizedPayload = method === 'POST'
9801
9885
  ? this.normalizeSourceRequestPayload(effectiveUrl, this.config?.payload)
9802
9886
  : undefined;
9887
+ const scoped = this.config?.filterScope === 'table';
9888
+ this.scopeStatus = null;
9889
+ if (scoped) {
9890
+ this.evaluatedCards = [];
9891
+ this.fetchedData = {};
9892
+ const resource = this.resourcePath?.trim().replace(/\/+$/, '');
9893
+ const fixed = normalizedPayload?.['filter'] ?? {};
9894
+ const active = resolvePraxisFilterCriteria(this.baseFilter, this.queryContext);
9895
+ const request = this.tableFilterRequest;
9896
+ const wireCriteria = request ? request.criteria : active;
9897
+ const actualFilterUrl = resource ? this.resolveSourceUrl(`${resource}/filter`) : '';
9898
+ const matchesTable = request === undefined || (request !== null && request.url === actualFilterUrl &&
9899
+ Object.keys(active).length === Object.keys(request.sourceCriteria).length &&
9900
+ includesKpiCriteria(active, request.sourceCriteria));
9901
+ const incompatible = Object.keys(fixed).some(key => {
9902
+ if (Object.prototype.hasOwnProperty.call(active, key)) {
9903
+ return !includesKpiCriteria(active, { [key]: fixed[key] }) &&
9904
+ !includesKpiCriteria(wireCriteria, { [key]: fixed[key] });
9905
+ }
9906
+ // A fixed structured value needs the table's schema-aware wire form.
9907
+ // Scalar and scalar-list predicates already have their declared wire form.
9908
+ const value = fixed[key];
9909
+ return !!request && value !== null && typeof value === 'object' &&
9910
+ !(Array.isArray(value) && value.every(item => item === null || typeof item !== 'object'));
9911
+ });
9912
+ if (!resource || !normalizedPayload || this.queryContext?.filterExpression || !matchesTable ||
9913
+ effectiveUrl !== this.resolveSourceUrl(`${resource}${KPI_GROUP_BY_SUFFIX}`) || incompatible) {
9914
+ this.isLoading = false;
9915
+ this.scopeStatus = 'unavailable';
9916
+ return;
9917
+ }
9918
+ normalizedPayload['filter'] = { ...fixed, ...wireCriteria };
9919
+ }
9803
9920
  const request$ = method === 'POST'
9804
9921
  ? this.statsBus && this.isStatsPostUrl(effectiveUrl)
9805
9922
  ? this.statsBus.executeRaw({
@@ -9815,6 +9932,13 @@ class PraxisKpiBandComponent {
9815
9932
  this.fetchSub = request$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
9816
9933
  next: (res) => {
9817
9934
  const payload = res?.data ?? res ?? {};
9935
+ if (scoped)
9936
+ this.scopeStatus = this.scopedResultStatus(payload);
9937
+ if (this.scopeStatus) {
9938
+ this.isLoading = false;
9939
+ this.cdr.markForCheck();
9940
+ return;
9941
+ }
9818
9942
  this.fetchedData = this.normalizeSourcePayload(typeof payload === 'object' && payload !== null ? payload : { value: payload });
9819
9943
  this.isLoading = false;
9820
9944
  this.statsLoaded.emit(this.fetchedData);
@@ -9823,6 +9947,8 @@ class PraxisKpiBandComponent {
9823
9947
  },
9824
9948
  error: (err) => {
9825
9949
  this.isLoading = false;
9950
+ if (scoped)
9951
+ this.scopeStatus = 'unavailable';
9826
9952
  this.statsError.emit(err);
9827
9953
  this.recomputeCards();
9828
9954
  this.cdr.markForCheck();
@@ -9830,13 +9956,7 @@ class PraxisKpiBandComponent {
9830
9956
  });
9831
9957
  }
9832
9958
  resolveSchemasFilteredRequestUrl(resourcePath) {
9833
- const key = String(this.endpointKey ?? '').trim();
9834
- const entry = this.apiUrlEntry ||
9835
- (key && this.apiUrl ? this.apiUrl[key] : undefined) ||
9836
- this.apiUrl?.['default'] ||
9837
- (this.apiUrl ? Object.values(this.apiUrl)[0] : undefined);
9838
- const entryBase = entry ? buildApiUrl(entry).replace(/\/+$/, '') : '';
9839
- return resolvePraxisSchemasFilteredUrl(entryBase, resourcePath, {
9959
+ return resolvePraxisSchemasFilteredUrl(this.resolveApiBaseUrl(), resourcePath, {
9840
9960
  operation: 'post',
9841
9961
  schemaType: 'response',
9842
9962
  suffix: 'filter',
@@ -10191,6 +10311,7 @@ class PraxisKpiBandComponent {
10191
10311
  ...(payload['metric'] && typeof payload['metric'] === 'object' ? [payload['metric']] : []),
10192
10312
  ];
10193
10313
  const operationByAlias = new Map();
10314
+ const publishedMetricOperations = new Map();
10194
10315
  let primaryMetricKey = null;
10195
10316
  for (const m of declaredMetrics) {
10196
10317
  if (!m || typeof m !== 'object')
@@ -10203,6 +10324,8 @@ class PraxisKpiBandComponent {
10203
10324
  const op = String(m.operation ?? '').trim().toUpperCase();
10204
10325
  if (!op)
10205
10326
  continue;
10327
+ if (aliasKey || fieldKey)
10328
+ publishedMetricOperations.set(aliasKey || fieldKey, op);
10206
10329
  if (aliasKey && !operationByAlias.has(aliasKey)) {
10207
10330
  operationByAlias.set(aliasKey, op);
10208
10331
  }
@@ -10210,7 +10333,7 @@ class PraxisKpiBandComponent {
10210
10333
  operationByAlias.set(fieldKey, op);
10211
10334
  }
10212
10335
  }
10213
- return { operationByAlias, primaryMetricKey };
10336
+ return { operationByAlias, publishedMetricOperations, primaryMetricKey };
10214
10337
  }
10215
10338
  isAnalyticsEnvelopeItemSuppressed(item, minBucketCount) {
10216
10339
  if (item['suppressed'] === true || item['privacySuppressed'] === true) {
@@ -10293,7 +10416,8 @@ class PraxisKpiBandComponent {
10293
10416
  const itemCount = typeof item['count'] === 'number' && Number.isFinite(item['count'])
10294
10417
  ? item['count']
10295
10418
  : undefined;
10296
- const count = Number(valuesObj?.['total'] ??
10419
+ const count = Number((this.config?.filterScope === 'table' ? itemCount : undefined) ??
10420
+ valuesObj?.['total'] ??
10297
10421
  valuesObj?.['count'] ??
10298
10422
  itemCount ??
10299
10423
  firstValuesMetric ??
@@ -10340,6 +10464,35 @@ class PraxisKpiBandComponent {
10340
10464
  visibleCountsByKey,
10341
10465
  };
10342
10466
  }
10467
+ scopedResultStatus(payload) {
10468
+ const buckets = payload['buckets'];
10469
+ if (!Array.isArray(buckets))
10470
+ return 'unavailable';
10471
+ if (payload['truncated'] || payload['suppressed'] || payload['suppressedBucketCount'] > 0)
10472
+ return 'partial';
10473
+ if (!buckets.length)
10474
+ return 'empty';
10475
+ const { publishedMetricOperations, primaryMetricKey } = this.resolveDeclaredMetricOperations(payload);
10476
+ const minBucketCount = Number(payload['minBucketCount']) || 0;
10477
+ const countOnly = [...publishedMetricOperations.values()].every(op => op === 'COUNT');
10478
+ for (const bucket of buckets) {
10479
+ if (!bucket || typeof bucket !== 'object')
10480
+ return 'unavailable';
10481
+ if (this.isAnalyticsEnvelopeItemSuppressed(bucket, minBucketCount))
10482
+ return 'partial';
10483
+ const count = bucket.count ?? (countOnly ? bucket.values?.total ?? bucket.values?.count ?? bucket.value : undefined);
10484
+ if (!Number.isInteger(count) || count < 0)
10485
+ return 'unavailable';
10486
+ if (count > 0 && count < minBucketCount)
10487
+ return 'partial';
10488
+ for (const [alias, op] of publishedMetricOperations) {
10489
+ const metric = bucket.values ? bucket.values[alias] : (alias === primaryMetricKey ? bucket.value : undefined);
10490
+ if (op !== 'COUNT' && !Number.isFinite(metric))
10491
+ return 'unavailable';
10492
+ }
10493
+ }
10494
+ return null;
10495
+ }
10343
10496
  normalizeSourcePayload(payload) {
10344
10497
  if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
10345
10498
  return payload;
@@ -10406,13 +10559,19 @@ class PraxisKpiBandComponent {
10406
10559
  return normalized;
10407
10560
  }
10408
10561
  recomputeCards() {
10562
+ if (this.config?.filterScope === 'table' && (this.scopeStatus || this.isLoading)) {
10563
+ this.evaluatedCards = [];
10564
+ this.cdr.markForCheck();
10565
+ return;
10566
+ }
10409
10567
  const cards = this.resolveEffectiveCards();
10410
10568
  if (!cards || !Array.isArray(cards) || cards.length === 0) {
10411
10569
  this.evaluatedCards = [];
10412
10570
  this.cdr.markForCheck();
10413
10571
  return;
10414
10572
  }
10415
- const normalizedDataContext = this.dataContext && typeof this.dataContext === 'object'
10573
+ const tableScoped = this.config?.filterScope === 'table';
10574
+ const normalizedDataContext = !tableScoped && this.dataContext && typeof this.dataContext === 'object'
10416
10575
  ? this.normalizeSourcePayload(this.dataContext)
10417
10576
  : {};
10418
10577
  const normalizedFetchedData = this.fetchedData && typeof this.fetchedData === 'object'
@@ -10443,7 +10602,7 @@ class PraxisKpiBandComponent {
10443
10602
  let rawValue = card.value;
10444
10603
  if (card.valueExpr) {
10445
10604
  const evaluated = this.evaluateKpiExpression(card.valueExpr, context);
10446
- if (evaluated !== undefined && evaluated !== null) {
10605
+ if (tableScoped || (evaluated !== undefined && evaluated !== null)) {
10447
10606
  rawValue = evaluated;
10448
10607
  }
10449
10608
  }
@@ -10703,6 +10862,9 @@ class PraxisKpiBandComponent {
10703
10862
  const cardRecord = cardFilter;
10704
10863
  const cardKeys = Object.keys(cardRecord).sort();
10705
10864
  const activeKeys = Object.keys(activeFilter).sort();
10865
+ if (this.config?.filterScope === 'table' && cardKeys.length > 0) {
10866
+ return includesKpiCriteria(resolvePraxisFilterCriteria(activeFilter, this.queryContext), cardRecord);
10867
+ }
10706
10868
  if (cardKeys.length !== activeKeys.length) {
10707
10869
  return false;
10708
10870
  }
@@ -10722,7 +10884,7 @@ class PraxisKpiBandComponent {
10722
10884
  });
10723
10885
  }
10724
10886
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisKpiBandComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
10725
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: PraxisKpiBandComponent, isStandalone: true, selector: "praxis-kpi-band", inputs: { config: "config", dataContext: "dataContext", isInteractiveHost: "isInteractiveHost", activeFilter: "activeFilter", endpointKey: "endpointKey", apiUrlEntry: "apiUrlEntry", resourcePath: "resourcePath", resourceFacts: "resourceFacts", quickFilters: "quickFilters", capabilities: "capabilities", schemaMetadata: "schemaMetadata", baseFilter: "baseFilter" }, outputs: { cardClick: "cardClick", statsLoaded: "statsLoaded", statsError: "statsError", refreshClick: "refreshClick" }, usesOnChanges: true, ngImport: i0, template: `
10887
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.14", type: PraxisKpiBandComponent, isStandalone: true, selector: "praxis-kpi-band", inputs: { config: "config", dataContext: "dataContext", isInteractiveHost: "isInteractiveHost", activeFilter: "activeFilter", endpointKey: "endpointKey", apiUrlEntry: "apiUrlEntry", resourcePath: "resourcePath", resourceFacts: "resourceFacts", quickFilters: "quickFilters", capabilities: "capabilities", schemaMetadata: "schemaMetadata", queryContext: "queryContext", tableFilterRequest: "tableFilterRequest", baseFilter: "baseFilter" }, outputs: { cardClick: "cardClick", statsLoaded: "statsLoaded", statsError: "statsError", refreshClick: "refreshClick" }, usesOnChanges: true, ngImport: i0, template: `
10726
10888
  <div
10727
10889
  *ngIf="isVisible"
10728
10890
  class="praxis-kpi-band"
@@ -10748,6 +10910,7 @@ class PraxisKpiBandComponent {
10748
10910
  </div>
10749
10911
  </div>
10750
10912
 
10913
+ <p *ngIf="scopeStatusLabel" role="status">{{ scopeStatusLabel }}</p>
10751
10914
  <div
10752
10915
  class="praxis-kpi-band-grid"
10753
10916
  [class.is-refreshing]="isLoading && evaluatedCards.length > 0"
@@ -10817,6 +10980,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
10817
10980
  </div>
10818
10981
  </div>
10819
10982
 
10983
+ <p *ngIf="scopeStatusLabel" role="status">{{ scopeStatusLabel }}</p>
10820
10984
  <div
10821
10985
  class="praxis-kpi-band-grid"
10822
10986
  [class.is-refreshing]="isLoading && evaluatedCards.length > 0"
@@ -10879,6 +11043,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
10879
11043
  type: Input
10880
11044
  }], schemaMetadata: [{
10881
11045
  type: Input
11046
+ }], queryContext: [{
11047
+ type: Input
11048
+ }], tableFilterRequest: [{
11049
+ type: Input
10882
11050
  }], baseFilter: [{
10883
11051
  type: Input
10884
11052
  }], cardClick: [{
@@ -12035,6 +12203,52 @@ function assertCrudMetadata(meta, options = {}) {
12035
12203
  });
12036
12204
  }
12037
12205
 
12206
+ function resolveCrudCollectionPath(metadata) {
12207
+ const rawResourcePath = metadata.resource?.path || (metadata.table && 'resourcePath' in metadata.table ? metadata.table.resourcePath : undefined);
12208
+ return typeof rawResourcePath === 'string' ? rawResourcePath.trim().replace(/\/+$/, '') : '';
12209
+ }
12210
+ const CRUD_KPI_SCOPE_DIAGNOSTIC_CODE = 'crud.metadata.kpiBand.filterScope.invalid';
12211
+ function validateCrudKpiScope(metadata, apiUrls) {
12212
+ const band = resolveConfiguredKpiBand(metadata);
12213
+ if (!band || band.enabled === false || band.filterScope === undefined) {
12214
+ return;
12215
+ }
12216
+ const source = typeof band.source === 'string' ? band.source.trim() : '';
12217
+ const sourcePath = normalizePraxisResourcePath(source, 'relative');
12218
+ if (band.filterScope !== 'table' || resolveKpiBandMethod(band.method) !== 'POST' ||
12219
+ !source.endsWith(KPI_GROUP_BY_SUFFIX) || !sourcePath.endsWith(KPI_GROUP_BY_SUFFIX) || /[?#]/.test(source)) {
12220
+ return kpiScopeDiagnostic('error');
12221
+ }
12222
+ const resourcePath = resolveCrudCollectionPath(metadata);
12223
+ if (!resourcePath) {
12224
+ // A resource page can provide the collection when it materializes the document.
12225
+ return kpiScopeDiagnostic('warning');
12226
+ }
12227
+ const groupBy = `${resourcePath}${KPI_GROUP_BY_SUFFIX}`;
12228
+ const base = resolveKpiBandApiBase(apiUrls, metadata.resource?.endpointKey, metadata.resource?.apiUrlEntry);
12229
+ if (resolveKpiBandSourceUrl(source, base) === resolveKpiBandSourceUrl(groupBy, base)) {
12230
+ return;
12231
+ }
12232
+ // A pure document validation call may lack the host API registry. Mark potential
12233
+ // prefix/absolute URL equivalence as unverified until the editor resolves that registry.
12234
+ if (apiUrls === undefined && !metadata.resource?.apiUrlEntry &&
12235
+ !(/^https?:\/\//.test(source) && /^https?:\/\//.test(groupBy))) {
12236
+ const expectedPath = normalizePraxisResourcePath(groupBy, 'relative');
12237
+ if (sourcePath === expectedPath || sourcePath.endsWith(`/${expectedPath}`) || expectedPath.endsWith(`/${sourcePath}`)) {
12238
+ return kpiScopeDiagnostic('warning');
12239
+ }
12240
+ }
12241
+ return kpiScopeDiagnostic('error');
12242
+ }
12243
+ function kpiScopeDiagnostic(level) {
12244
+ return {
12245
+ level,
12246
+ code: CRUD_KPI_SCOPE_DIAGNOSTIC_CODE,
12247
+ message: 'Table-scoped indicators require an explicit POST group-by on the same collection.',
12248
+ path: 'metadata.kpiBand.filterScope',
12249
+ };
12250
+ }
12251
+
12038
12252
  const DOCUMENT_KIND = 'praxis.crud.editor';
12039
12253
  const DOCUMENT_VERSION = 1;
12040
12254
  const CANONICAL_ACTIONS = ['create', 'view', 'edit', 'delete'];
@@ -12119,6 +12333,9 @@ function validateCrudAuthoringDocument(doc, context) {
12119
12333
  for (const action of metadata.actions || []) {
12120
12334
  validateCrudAction(action, metadata, diagnostics);
12121
12335
  }
12336
+ const kpiScopeDiagnostic = validateCrudKpiScope(metadata);
12337
+ if (kpiScopeDiagnostic)
12338
+ diagnostics.push(kpiScopeDiagnostic);
12122
12339
  validateCrudKpiBand(metadata, diagnostics);
12123
12340
  validateCrudFilterBar(metadata, diagnostics);
12124
12341
  return diagnostics;
@@ -12883,6 +13100,7 @@ const PRAXIS_CRUD_AUTHORING_I18N_CONFIG = {
12883
13100
  'crud.authoring.kpis.telemetryGroup': 'Fonte de Telemetria da Faixa (Opcional)',
12884
13101
  'crud.authoring.kpis.source': 'Endpoint de Telemetria (source)',
12885
13102
  'crud.authoring.kpis.sourcePlaceholder': 'ex.: /recurso/stats/group-by',
13103
+ 'crud.authoring.kpis.tableScope': 'Aplicar os filtros da tabela a este agrupamento',
12886
13104
  'crud.authoring.kpis.method': 'Método HTTP',
12887
13105
  'crud.authoring.kpis.groupByField': 'Campo de Agrupamento (payload.field)',
12888
13106
  'crud.authoring.kpis.groupByFieldPlaceholder': 'ex.: status',
@@ -12914,6 +13132,7 @@ const PRAXIS_CRUD_AUTHORING_I18N_CONFIG = {
12914
13132
  'crud.authoring.kpis.quickChipsLabel': 'Inserir token ou pipe declarativo:',
12915
13133
  'crud.authoring.kpis.livePreviewLabel': 'Prévia simulada (CSP-safe):',
12916
13134
  'crud.authoring.kpis.previewTitle': 'Prévia da faixa de KPIs',
13135
+ 'crud.authoring.validation.kpiScopeInvalid': 'O agrupamento deve usar POST no recurso da tabela.',
12917
13136
  'crud.authoring.validation.kpiLabelRequired': 'Informe o rótulo do card de KPI #{index}.',
12918
13137
  'crud.authoring.validation.kpiValueRequired': 'Informe o valor exibido ou valueExpr no card de KPI #{index}.',
12919
13138
  'crud.authoring.validation.kpiFilterInvalid': 'Informe um critério de filtro válido no card de KPI #{index}.',
@@ -13251,6 +13470,7 @@ const PRAXIS_CRUD_AUTHORING_I18N_CONFIG = {
13251
13470
  'crud.authoring.kpis.telemetryGroup': 'Band Telemetry Source (Optional)',
13252
13471
  'crud.authoring.kpis.source': 'Telemetry Endpoint (source)',
13253
13472
  'crud.authoring.kpis.sourcePlaceholder': 'e.g. /resource/stats/group-by',
13473
+ 'crud.authoring.kpis.tableScope': 'Use table filters for this group-by',
13254
13474
  'crud.authoring.kpis.method': 'HTTP Method',
13255
13475
  'crud.authoring.kpis.groupByField': 'Group-By Field (payload.field)',
13256
13476
  'crud.authoring.kpis.groupByFieldPlaceholder': 'e.g. status',
@@ -13282,6 +13502,7 @@ const PRAXIS_CRUD_AUTHORING_I18N_CONFIG = {
13282
13502
  'crud.authoring.kpis.quickChipsLabel': 'Insert token or declarative pipe:',
13283
13503
  'crud.authoring.kpis.livePreviewLabel': 'Simulated preview (CSP-safe):',
13284
13504
  'crud.authoring.kpis.previewTitle': 'KPI band preview',
13505
+ 'crud.authoring.validation.kpiScopeInvalid': 'Use a POST group-by on the table resource.',
13285
13506
  'crud.authoring.validation.kpiLabelRequired': 'Provide a label for KPI card #{index}.',
13286
13507
  'crud.authoring.validation.kpiValueRequired': 'Provide a displayed value or valueExpr for KPI card #{index}.',
13287
13508
  'crud.authoring.validation.kpiFilterInvalid': 'Provide valid filter criteria for KPI card #{index}.',
@@ -13488,9 +13709,13 @@ class CrudMetadataEditorComponent {
13488
13709
  return this.actionKeys;
13489
13710
  }, ...(ngDevMode ? [{ debugName: "effectiveActionKeys" }] : /* istanbul ignore next */ []));
13490
13711
  diagnostics = computed(() => {
13491
- const raw = validateCrudAuthoringDocument(this.currentDocument(), {
13712
+ const document = this.currentDocument();
13713
+ const raw = validateCrudAuthoringDocument(document, {
13492
13714
  requireCanonicalActions: true,
13493
- });
13715
+ }).filter((issue) => issue.code !== CRUD_KPI_SCOPE_DIAGNOSTIC_CODE);
13716
+ const scopeDiagnostic = validateCrudKpiScope(document.metadata, this.apiUrlsConfig);
13717
+ if (scopeDiagnostic)
13718
+ raw.push(scopeDiagnostic);
13494
13719
  if (this.currentCatalogResource()?.readOnly !== true) {
13495
13720
  return raw;
13496
13721
  }
@@ -13518,6 +13743,7 @@ class CrudMetadataEditorComponent {
13518
13743
  };
13519
13744
  }, ...(ngDevMode ? [{ debugName: "tableConfig" }] : /* istanbul ignore next */ []));
13520
13745
  resourcePath = computed(() => this.currentDocument().metadata.resource?.path || '', ...(ngDevMode ? [{ debugName: "resourcePath" }] : /* istanbul ignore next */ []));
13746
+ kpiPreviewResourcePath = computed(() => resolveCrudCollectionPath(this.currentDocument().metadata), ...(ngDevMode ? [{ debugName: "kpiPreviewResourcePath" }] : /* istanbul ignore next */ []));
13521
13747
  resourceIdField = computed(() => String(this.currentDocument().metadata.resource?.idField ?? ''), ...(ngDevMode ? [{ debugName: "resourceIdField" }] : /* istanbul ignore next */ []));
13522
13748
  resourceEndpointKey = computed(() => String(this.currentDocument().metadata.resource?.endpointKey ?? ''), ...(ngDevMode ? [{ debugName: "resourceEndpointKey" }] : /* istanbul ignore next */ []));
13523
13749
  resourceEndpointKeyValue = computed(() => this.currentDocument().metadata.resource?.endpointKey || undefined, ...(ngDevMode ? [{ debugName: "resourceEndpointKeyValue" }] : /* istanbul ignore next */ []));
@@ -13983,14 +14209,8 @@ class CrudMetadataEditorComponent {
13983
14209
  (ep.summary ?? '').toLowerCase().includes(query));
13984
14210
  }, ...(ngDevMode ? [{ debugName: "filteredTelemetryEndpoints" }] : /* istanbul ignore next */ []));
13985
14211
  effectiveKpiBand = computed(() => {
13986
- const meta = this.currentDocument().metadata;
13987
- if (meta.kpiBand === false) {
13988
- return { enabled: false, cards: [] };
13989
- }
13990
- return (meta.kpiBand ||
13991
- meta.table?.kpiBand ||
13992
- meta.table?.behavior?.kpiBand ||
13993
- null);
14212
+ const band = resolveConfiguredKpiBand(this.currentDocument().metadata);
14213
+ return band === false ? { enabled: false, cards: [] } : band ?? null;
13994
14214
  }, ...(ngDevMode ? [{ debugName: "effectiveKpiBand" }] : /* istanbul ignore next */ []));
13995
14215
  kpiBandEnabled = computed(() => {
13996
14216
  const band = this.effectiveKpiBand();
@@ -15062,7 +15282,7 @@ class CrudMetadataEditorComponent {
15062
15282
  return String(this.effectiveKpiBand()?.source || '');
15063
15283
  }
15064
15284
  kpiBandMethod() {
15065
- return this.effectiveKpiBand()?.method === 'GET' ? 'GET' : 'POST';
15285
+ return resolveKpiBandMethod(this.effectiveKpiBand()?.method);
15066
15286
  }
15067
15287
  kpiBandGroupByField() {
15068
15288
  const payload = this.effectiveKpiBand()?.payload;
@@ -15078,6 +15298,9 @@ class CrudMetadataEditorComponent {
15078
15298
  source: source || undefined,
15079
15299
  }));
15080
15300
  }
15301
+ setKpiTableScope(enabled) {
15302
+ this.updateKpiBand(({ filterScope, ...band }) => enabled ? { ...band, filterScope: 'table' } : band);
15303
+ }
15081
15304
  setKpiBandMethod(method) {
15082
15305
  this.updateKpiBand((current) => ({
15083
15306
  ...current,
@@ -16802,6 +17025,7 @@ class CrudMetadataEditorComponent {
16802
17025
  'crud.metadata.actions.route.required': 'crud.authoring.validation.routeRequired',
16803
17026
  'crud.metadata.actions.formId.required': 'crud.authoring.validation.formIdRequired',
16804
17027
  'crud.metadata.actions.form.submit-contract.invalid': 'crud.authoring.validation.submitContract',
17028
+ 'crud.metadata.kpiBand.filterScope.invalid': 'crud.authoring.validation.kpiScopeInvalid',
16805
17029
  'crud.metadata.kpiBand.cards.label.required': 'crud.authoring.validation.kpiLabelRequired',
16806
17030
  'crud.metadata.kpiBand.cards.value.required': 'crud.authoring.validation.kpiValueRequired',
16807
17031
  'crud.metadata.kpiBand.cards.filter.invalid': 'crud.authoring.validation.kpiFilterInvalid',
@@ -18480,6 +18704,12 @@ class CrudMetadataEditorComponent {
18480
18704
  </mat-select>
18481
18705
  </mat-form-field>
18482
18706
 
18707
+ <mat-slide-toggle
18708
+ [checked]="effectiveKpiBand()?.filterScope === 'table'"
18709
+ [disabled]="isReadonly()"
18710
+ (change)="setKpiTableScope($event.checked)"
18711
+ >{{ tx('crud.authoring.kpis.tableScope', 'Use table filters for this group-by') }}</mat-slide-toggle>
18712
+
18483
18713
  <mat-form-field appearance="outline">
18484
18714
  <mat-label>{{ tx('crud.authoring.kpis.groupByField', 'Group-By Field (payload.field)') }}</mat-label>
18485
18715
  <input
@@ -18733,6 +18963,9 @@ class CrudMetadataEditorComponent {
18733
18963
  <praxis-kpi-band
18734
18964
  data-testid="crud-kpi-band-preview"
18735
18965
  [config]="kpiBandPreviewConfig()"
18966
+ [resourcePath]="kpiPreviewResourcePath()"
18967
+ [baseFilter]="currentDocument().metadata.filterCriteria"
18968
+ [queryContext]="currentDocument().metadata.queryContext"
18736
18969
  [endpointKey]="resourceEndpointKeyValue()"
18737
18970
  [apiUrlEntry]="resourceApiUrlEntry() ?? null"
18738
18971
  [isInteractiveHost]="false"
@@ -19250,7 +19483,7 @@ class CrudMetadataEditorComponent {
19250
19483
  </mat-tab>
19251
19484
  </mat-tab-group>
19252
19485
  </section>
19253
- `, isInline: true, styles: [":host{display:block;container-type:inline-size;min-width:0;color:var(--pfx-settings-panel-fg, var(--md-sys-color-on-surface,#1a1b20))}.editor-shell{display:grid;gap:10px}.editor-header{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.editor-header__titles{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}:host-context(.settings-panel) .editor-header h2{display:none}.editor-diagnostics-disclosure{border:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 60%, transparent));border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 92%,transparent);padding:8px 12px}.editor-diagnostics-summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--pfx-settings-panel-fg, var(--md-sys-color-on-surface,#1a1b20))}.editor-diagnostics-summary::-webkit-details-marker{display:none}.editor-diagnostics-summary__hint{color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67));margin-left:auto}.editor-diagnostics-summary:after{content:\"\\25b8\";font-size:13px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67));transition:transform .14s ease;flex:0 0 auto}.editor-diagnostics-disclosure[open] .editor-diagnostics-summary:after{transform:rotate(90deg)}.editor-diagnostics-disclosure__body{display:grid;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 50%, transparent))}.editor-overview{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.editor-health-map{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}.editor-health-card{display:grid;gap:4px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-health-card--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-health-card--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-focus{display:flex;gap:10px;align-items:center;padding:8px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-focus--success{background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.editor-focus-chip{padding:4px 10px;border-radius:999px;font-size:12px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38);white-space:nowrap}.editor-focus-chip--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-focus-chip--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-focus-copy{display:grid;gap:2px;font-size:13px}.editor-focus-copy p{margin:0;font-size:12px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-tabs{display:flex;flex-direction:column;min-width:0}.editor-tabs .mat-mdc-tab{min-width:104px}.editor-tabs ::ng-deep .mdc-tab__content{gap:8px}.editor-tabs ::ng-deep .mdc-tab__text-label{display:inline-flex;align-items:center;gap:8px}.editor-tabs ::ng-deep .mat-mdc-tab-body-wrapper,.editor-tabs ::ng-deep .mat-mdc-tab-group-container{flex:1 1 auto;min-height:0}.editor-tabs ::ng-deep .mat-mdc-tab-body-content{overflow:hidden}.tab-status-dot{width:8px;height:8px;border-radius:999px;background:var(--md-sys-color-primary,#1263b4);flex:0 0 auto}.tab-status-dot--warn{background:var(--md-sys-color-tertiary,#7d5700)}.tab-status-dot--error{background:var(--md-sys-color-error,#b3261e)}.tab-content{display:grid;gap:14px;min-width:0;padding:12px 2px 4px;box-sizing:border-box}.editor-overview-card{display:grid;gap:3px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-overview-card--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-overview-card--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-overview-label{font-size:11px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-overview-value{font-size:13px;line-height:1.25;overflow-wrap:anywhere}.editor-overview-note{margin:0;font-size:11px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-header h2,.editor-card h3{margin:0;font-size:1.05rem}.editor-header p{margin:0;font-size:12px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-chip{padding:4px 10px;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 12%,transparent);font-size:12px}.editor-card{display:grid;gap:14px;padding:16px;border-radius:16px;border:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 70%, transparent));background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface))}.editor-section-header{display:flex;justify-content:space-between;gap:12px;align-items:start;flex-wrap:wrap}.editor-toolbar-row{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.editor-inline-grow{flex:1 1 240px}.inline-actions-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.inline-chip{display:inline-flex;align-items:center;gap:6px}.chip-remove-btn{border:0;background:transparent;cursor:pointer;font-size:14px;line-height:1;padding:0 2px;color:inherit}.kpi-cards-list{display:grid;gap:12px}.field-suggestions-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-top:2px}.field-suggestion-chip{appearance:none;display:inline-flex;align-items:center;min-height:26px;padding:3px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant,#c5c7ce) 80%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 88%,transparent);color:var(--md-sys-color-on-surface,#1a1b20);font-family:var(--md-sys-typescale-code-font, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);font-size:11.5px;line-height:1.2;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.field-suggestion-chip:hover:not(:disabled){border-color:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 52%,transparent);background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 12%,var(--md-sys-color-surface-container-low,#fafbfd));color:var(--md-sys-color-primary,#1263b4)}.field-suggestion-chip:disabled{opacity:.5;cursor:not-allowed}.inherited-columns-banner{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 14px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 55%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.inherited-columns-banner__copy{display:grid;gap:4px}.inherited-columns-banner__title-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.editor-grid{display:grid;gap:12px;align-items:start;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}.editor-grid--compact{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.editor-grid--2col{grid-template-columns:repeat(2,minmax(240px,1fr))}.editor-grid--3col{grid-template-columns:repeat(3,minmax(200px,1fr))}.editor-grid--4col{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.editor-grid--1-2{grid-template-columns:minmax(180px,1fr) minmax(320px,2fr)}.editor-field--full{grid-column:1 / -1}.editor-toggles{display:grid;gap:10px;align-items:start;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}@container (max-width: 720px){.editor-focus{flex-direction:column;align-items:flex-start}.editor-grid,.editor-grid--compact,.editor-grid--2col,.editor-grid--3col,.editor-grid--4col,.editor-grid--1-2,.editor-toggles{grid-template-columns:1fr}}.editor-actions,.action-grid{display:grid;gap:14px}.action-summary-strip{display:flex;flex-wrap:wrap;gap:8px}.action-summary-chip{padding:6px 10px;border-radius:999px;font-size:12px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.action-summary-chip--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.action-summary-chip--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.action-group{display:grid;gap:10px;padding:12px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 88%,transparent)}.action-group--advanced{background:color-mix(in srgb,var(--md-sys-color-surface-container,#f5f7fb) 90%,transparent)}.action-group__header{display:grid;gap:4px}.action-subgroup{display:grid;gap:10px;padding:10px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 92%,transparent)}.action-subgroup__header{display:grid;gap:4px}.action-param-list{display:grid;gap:12px}.action-param-row{display:grid;gap:8px}.action-advanced-panel{border:1px solid color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 65%,transparent);border-radius:16px}.editor-section-note{margin:0;color:var(--md-sys-color-on-surface-variant,#5a5d67)}.diagnostics-groups{display:grid;gap:12px}.diagnostics-group{display:grid;gap:10px;padding:12px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.diagnostics{display:grid;gap:8px;margin:0;padding-left:18px}.diagnostics .error{color:var(--md-sys-color-error,#b3261e)}.endpoint-option-row{display:flex;align-items:center;gap:10px;padding:2px 0;line-height:1.25}.endpoint-option-method{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:2px 6px;border-radius:6px;background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 14%,transparent);color:var(--md-sys-color-primary,#1263b4);flex-shrink:0}.endpoint-option-copy{display:flex;flex-direction:column;min-width:0;flex:1}.endpoint-option-path{font-size:12.5px;font-weight:600;font-family:var(--praxis-font-mono, monospace);color:var(--md-sys-color-on-surface,#1a1c1e);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.endpoint-option-meta{font-size:11px;color:var(--md-sys-color-on-surface-variant,#5a5d67);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.endpoint-option-badge{font-size:10px;font-weight:600;padding:2px 6px;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 75%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38);flex-shrink:0}pre{margin:0;overflow:auto;max-height:320px;padding:12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.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: "ngmodule", type: MatCardModule }, { kind: "component", type: i5.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i6.MatExpansionPanelDescription, selector: "mat-panel-description" }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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: i3$1.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: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i9.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: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i10.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i10.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i10.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }, { kind: "component", type: PraxisKpiBandComponent, selector: "praxis-kpi-band", inputs: ["config", "dataContext", "isInteractiveHost", "activeFilter", "endpointKey", "apiUrlEntry", "resourcePath", "resourceFacts", "quickFilters", "capabilities", "schemaMetadata", "baseFilter"], outputs: ["cardClick", "statsLoaded", "statsError", "refreshClick"] }, { kind: "component", type: PraxisTableInlineAuthoringEditorComponent, selector: "praxis-table-inline-authoring-editor", inputs: ["config", "fieldMetadata", "readonly"], outputs: ["configChange"] }, { kind: "component", type: ResourceQuickConnectComponent, selector: "praxis-resource-quick-connect", inputs: ["resourcePath", "endpointKey", "apiUrlEntry", "intent", "resources", "label", "placeholder", "hint", "disabled"], outputs: ["resourcePathChange", "resourceSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
19486
+ `, isInline: true, styles: [":host{display:block;container-type:inline-size;min-width:0;color:var(--pfx-settings-panel-fg, var(--md-sys-color-on-surface,#1a1b20))}.editor-shell{display:grid;gap:10px}.editor-header{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.editor-header__titles{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}:host-context(.settings-panel) .editor-header h2{display:none}.editor-diagnostics-disclosure{border:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 60%, transparent));border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 92%,transparent);padding:8px 12px}.editor-diagnostics-summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--pfx-settings-panel-fg, var(--md-sys-color-on-surface,#1a1b20))}.editor-diagnostics-summary::-webkit-details-marker{display:none}.editor-diagnostics-summary__hint{color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67));margin-left:auto}.editor-diagnostics-summary:after{content:\"\\25b8\";font-size:13px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67));transition:transform .14s ease;flex:0 0 auto}.editor-diagnostics-disclosure[open] .editor-diagnostics-summary:after{transform:rotate(90deg)}.editor-diagnostics-disclosure__body{display:grid;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 50%, transparent))}.editor-overview{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.editor-health-map{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}.editor-health-card{display:grid;gap:4px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-health-card--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-health-card--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-focus{display:flex;gap:10px;align-items:center;padding:8px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-focus--success{background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.editor-focus-chip{padding:4px 10px;border-radius:999px;font-size:12px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38);white-space:nowrap}.editor-focus-chip--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-focus-chip--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-focus-copy{display:grid;gap:2px;font-size:13px}.editor-focus-copy p{margin:0;font-size:12px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-tabs{display:flex;flex-direction:column;min-width:0}.editor-tabs .mat-mdc-tab{min-width:104px}.editor-tabs ::ng-deep .mdc-tab__content{gap:8px}.editor-tabs ::ng-deep .mdc-tab__text-label{display:inline-flex;align-items:center;gap:8px}.editor-tabs ::ng-deep .mat-mdc-tab-body-wrapper,.editor-tabs ::ng-deep .mat-mdc-tab-group-container{flex:1 1 auto;min-height:0}.editor-tabs ::ng-deep .mat-mdc-tab-body-content{overflow:hidden}.tab-status-dot{width:8px;height:8px;border-radius:999px;background:var(--md-sys-color-primary,#1263b4);flex:0 0 auto}.tab-status-dot--warn{background:var(--md-sys-color-tertiary,#7d5700)}.tab-status-dot--error{background:var(--md-sys-color-error,#b3261e)}.tab-content{display:grid;gap:14px;min-width:0;padding:12px 2px 4px;box-sizing:border-box}.editor-overview-card{display:grid;gap:3px;padding:10px 12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.editor-overview-card--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.editor-overview-card--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.editor-overview-label{font-size:11px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-overview-value{font-size:13px;line-height:1.25;overflow-wrap:anywhere}.editor-overview-note{margin:0;font-size:11px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-header h2,.editor-card h3{margin:0;font-size:1.05rem}.editor-header p{margin:0;font-size:12px;color:var(--pfx-settings-panel-muted, var(--md-sys-color-on-surface-variant,#5a5d67))}.editor-chip{padding:4px 10px;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 12%,transparent);font-size:12px}.editor-card{display:grid;gap:14px;padding:16px;border-radius:16px;border:1px solid var(--pfx-settings-panel-border, color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 70%, transparent));background:var(--pfx-settings-panel-surface, var(--md-sys-color-surface))}.editor-section-header{display:flex;justify-content:space-between;gap:12px;align-items:start;flex-wrap:wrap}.editor-toolbar-row{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.editor-inline-grow{flex:1 1 240px}.inline-actions-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.inline-chip{display:inline-flex;align-items:center;gap:6px}.chip-remove-btn{border:0;background:transparent;cursor:pointer;font-size:14px;line-height:1;padding:0 2px;color:inherit}.kpi-cards-list{display:grid;gap:12px}.field-suggestions-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-top:2px}.field-suggestion-chip{appearance:none;display:inline-flex;align-items:center;min-height:26px;padding:3px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant,#c5c7ce) 80%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 88%,transparent);color:var(--md-sys-color-on-surface,#1a1b20);font-family:var(--md-sys-typescale-code-font, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);font-size:11.5px;line-height:1.2;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.field-suggestion-chip:hover:not(:disabled){border-color:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 52%,transparent);background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 12%,var(--md-sys-color-surface-container-low,#fafbfd));color:var(--md-sys-color-primary,#1263b4)}.field-suggestion-chip:disabled{opacity:.5;cursor:not-allowed}.inherited-columns-banner{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 14px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 55%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.inherited-columns-banner__copy{display:grid;gap:4px}.inherited-columns-banner__title-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.editor-grid{display:grid;gap:12px;align-items:start;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}.editor-grid--compact{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.editor-grid--2col{grid-template-columns:repeat(2,minmax(240px,1fr))}.editor-grid--3col{grid-template-columns:repeat(3,minmax(200px,1fr))}.editor-grid--4col{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}.editor-grid--1-2{grid-template-columns:minmax(180px,1fr) minmax(320px,2fr)}.editor-field--full{grid-column:1 / -1}.editor-toggles{display:grid;gap:10px;align-items:start;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}@container (max-width: 720px){.editor-focus{flex-direction:column;align-items:flex-start}.editor-grid,.editor-grid--compact,.editor-grid--2col,.editor-grid--3col,.editor-grid--4col,.editor-grid--1-2,.editor-toggles{grid-template-columns:1fr}}.editor-actions,.action-grid{display:grid;gap:14px}.action-summary-strip{display:flex;flex-wrap:wrap;gap:8px}.action-summary-chip{padding:6px 10px;border-radius:999px;font-size:12px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 70%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38)}.action-summary-chip--warn{background:color-mix(in srgb,var(--md-sys-color-tertiary-container,#f8e08e) 78%,transparent);color:var(--md-sys-color-on-tertiary-container,#261900)}.action-summary-chip--error{background:color-mix(in srgb,var(--md-sys-color-error-container,#f9dedc) 82%,transparent);color:var(--md-sys-color-on-error-container,#410e0b)}.action-group{display:grid;gap:10px;padding:12px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 88%,transparent)}.action-group--advanced{background:color-mix(in srgb,var(--md-sys-color-surface-container,#f5f7fb) 90%,transparent)}.action-group__header{display:grid;gap:4px}.action-subgroup{display:grid;gap:10px;padding:10px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-low,#fafbfd) 92%,transparent)}.action-subgroup__header{display:grid;gap:4px}.action-param-list{display:grid;gap:12px}.action-param-row{display:grid;gap:8px}.action-advanced-panel{border:1px solid color-mix(in srgb,var(--md-sys-color-outline,#c5c7ce) 65%,transparent);border-radius:16px}.editor-section-note{margin:0;color:var(--md-sys-color-on-surface-variant,#5a5d67)}.diagnostics-groups{display:grid;gap:12px}.diagnostics-group{display:grid;gap:10px;padding:12px;border-radius:16px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}.diagnostics{display:grid;gap:8px;margin:0;padding-left:18px}.diagnostics .error{color:var(--md-sys-color-error,#b3261e)}.endpoint-option-row{display:flex;align-items:center;gap:10px;padding:2px 0;line-height:1.25}.endpoint-option-method{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:2px 6px;border-radius:6px;background:color-mix(in srgb,var(--md-sys-color-primary,#1263b4) 14%,transparent);color:var(--md-sys-color-primary,#1263b4);flex-shrink:0}.endpoint-option-copy{display:flex;flex-direction:column;min-width:0;flex:1}.endpoint-option-path{font-size:12.5px;font-weight:600;font-family:var(--praxis-font-mono, monospace);color:var(--md-sys-color-on-surface,#1a1c1e);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.endpoint-option-meta{font-size:11px;color:var(--md-sys-color-on-surface-variant,#5a5d67);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.endpoint-option-badge{font-size:10px;font-weight:600;padding:2px 6px;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-secondary-container,#d7e3ff) 75%,transparent);color:var(--md-sys-color-on-secondary-container,#001c38);flex-shrink:0}pre{margin:0;overflow:auto;max-height:320px;padding:12px;border-radius:14px;background:color-mix(in srgb,var(--md-sys-color-surface-container-high,#eef1f6) 92%,transparent)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i3$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.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: "ngmodule", type: MatCardModule }, { kind: "component", type: i5.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i6.MatExpansionPanelDescription, selector: "mat-panel-description" }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.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: i3$1.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: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i9.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: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i10.MatTabLabel, selector: "[mat-tab-label], [matTabLabel]" }, { kind: "component", type: i10.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i10.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }, { kind: "component", type: PraxisKpiBandComponent, selector: "praxis-kpi-band", inputs: ["config", "dataContext", "isInteractiveHost", "activeFilter", "endpointKey", "apiUrlEntry", "resourcePath", "resourceFacts", "quickFilters", "capabilities", "schemaMetadata", "queryContext", "tableFilterRequest", "baseFilter"], outputs: ["cardClick", "statsLoaded", "statsError", "refreshClick"] }, { kind: "component", type: PraxisTableInlineAuthoringEditorComponent, selector: "praxis-table-inline-authoring-editor", inputs: ["config", "fieldMetadata", "readonly"], outputs: ["configChange"] }, { kind: "component", type: ResourceQuickConnectComponent, selector: "praxis-resource-quick-connect", inputs: ["resourcePath", "endpointKey", "apiUrlEntry", "intent", "resources", "label", "placeholder", "hint", "disabled"], outputs: ["resourcePathChange", "resourceSelected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
19254
19487
  }
19255
19488
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: CrudMetadataEditorComponent, decorators: [{
19256
19489
  type: Component,
@@ -20087,6 +20320,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
20087
20320
  </mat-select>
20088
20321
  </mat-form-field>
20089
20322
 
20323
+ <mat-slide-toggle
20324
+ [checked]="effectiveKpiBand()?.filterScope === 'table'"
20325
+ [disabled]="isReadonly()"
20326
+ (change)="setKpiTableScope($event.checked)"
20327
+ >{{ tx('crud.authoring.kpis.tableScope', 'Use table filters for this group-by') }}</mat-slide-toggle>
20328
+
20090
20329
  <mat-form-field appearance="outline">
20091
20330
  <mat-label>{{ tx('crud.authoring.kpis.groupByField', 'Group-By Field (payload.field)') }}</mat-label>
20092
20331
  <input
@@ -20340,6 +20579,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
20340
20579
  <praxis-kpi-band
20341
20580
  data-testid="crud-kpi-band-preview"
20342
20581
  [config]="kpiBandPreviewConfig()"
20582
+ [resourcePath]="kpiPreviewResourcePath()"
20583
+ [baseFilter]="currentDocument().metadata.filterCriteria"
20584
+ [queryContext]="currentDocument().metadata.queryContext"
20343
20585
  [endpointKey]="resourceEndpointKeyValue()"
20344
20586
  [apiUrlEntry]="resourceApiUrlEntry() ?? null"
20345
20587
  [isInteractiveHost]="false"
@@ -21364,11 +21606,11 @@ class PraxisCrudComponent {
21364
21606
  };
21365
21607
  get resolvedKpiBandConfig() {
21366
21608
  const meta = this.resolvedMetadata;
21367
- const rawBand = meta?.kpiBand ?? meta?.table?.kpiBand ?? meta?.table?.behavior?.kpiBand;
21609
+ const rawBand = resolveConfiguredKpiBand(meta);
21368
21610
  if (rawBand === false || (rawBand && rawBand.enabled === false)) {
21369
21611
  return null;
21370
21612
  }
21371
- if (rawBand && rawBand.enabled !== false && (rawBand.cards?.length || rawBand.source || rawBand.document)) {
21613
+ if (rawBand && (rawBand.cards?.length || rawBand.source || rawBand.document)) {
21372
21614
  return rawBand;
21373
21615
  }
21374
21616
  if (rawBand === undefined &&
@@ -21396,12 +21638,12 @@ class PraxisCrudComponent {
21396
21638
  this.clearFilterCriteria();
21397
21639
  return;
21398
21640
  }
21399
- const nextCriteria = {
21400
- ...this.resolveFilterCriteria(this.resolvedMetadata),
21401
- ...cardFilter,
21402
- };
21641
+ const nextCriteria = this.resolvedKpiBandConfig?.filterScope === 'table'
21642
+ ? toggleKpiCriteria(this.tableFilterCriteria, cardFilter, this.effectiveLockedFilterFields)
21643
+ : { ...this.resolveFilterCriteria(this.resolvedMetadata), ...cardFilter };
21403
21644
  if (this.areFilterCriteriaEquivalent(this.tableFilterCriteria, nextCriteria)) {
21404
- this.clearFilterCriteria();
21645
+ if (this.resolvedKpiBandConfig?.filterScope !== 'table')
21646
+ this.clearFilterCriteria();
21405
21647
  return;
21406
21648
  }
21407
21649
  this.tableFilterCriteria = nextCriteria;
@@ -21426,6 +21668,7 @@ class PraxisCrudComponent {
21426
21668
  cdr = inject(ChangeDetectorRef);
21427
21669
  widgetEventBus = inject(PraxisWidgetEventBus, { optional: true });
21428
21670
  kpiBand;
21671
+ tableFilterService = viewChild(PraxisTable, { ...(ngDevMode ? { debugName: "tableFilterService" } : /* istanbul ignore next */ {}), read: GenericCrudService });
21429
21672
  _table;
21430
21673
  set table(value) {
21431
21674
  this._table = value;
@@ -23012,13 +23255,22 @@ class PraxisCrudComponent {
23012
23255
  catch { }
23013
23256
  }
23014
23257
  }
23015
- resolveQueryContext(meta) {
23258
+ resolveQueryContext(meta, current) {
23016
23259
  if (Array.isArray(meta?.data) && this.resolveResourcePath(meta).length === 0) {
23017
23260
  return null;
23018
23261
  }
23019
- const baseQueryContext = this.isRecord(meta?.queryContext)
23262
+ let baseQueryContext = this.isRecord(meta?.queryContext)
23020
23263
  ? meta.queryContext
23021
23264
  : null;
23265
+ if (baseQueryContext && current) {
23266
+ // Project new workspace values onto the declared context after editable chips were cleared.
23267
+ baseQueryContext = {
23268
+ ...baseQueryContext,
23269
+ filters: Object.fromEntries(Object.entries(baseQueryContext.filters ?? {})
23270
+ .filter(([key]) => Object.prototype.hasOwnProperty.call(current.filters ?? {}, key))),
23271
+ filterExpression: current.filterExpression,
23272
+ };
23273
+ }
23022
23274
  const fields = this.getEffectiveBindableFields();
23023
23275
  const projected = this.contextFilterProjector
23024
23276
  ? this.contextFilterProjector.projectQueryContext(fields, baseQueryContext, {
@@ -23077,7 +23329,7 @@ class PraxisCrudComponent {
23077
23329
  return keysA.every((k, idx) => k === keysB[idx] && JSON.stringify(normA[k]) === JSON.stringify(normB[k]));
23078
23330
  }
23079
23331
  onTableFilterCriteriaChange(criteria) {
23080
- const next = this.isRecord(criteria) ? { ...criteria } : {};
23332
+ const next = { ...(this.isRecord(criteria) ? criteria : {}), ...this.currentLockedCriteria() };
23081
23333
  if (this.areFilterCriteriaEquivalent(this.tableFilterCriteria, next)) {
23082
23334
  return;
23083
23335
  }
@@ -23168,13 +23420,7 @@ class PraxisCrudComponent {
23168
23420
  }
23169
23421
  this.isClearingFilterCriteria = true;
23170
23422
  try {
23171
- const locked = new Set(this.effectiveLockedFilterFields);
23172
- const preserved = {};
23173
- for (const key of locked) {
23174
- if (key in this.tableFilterCriteria) {
23175
- preserved[key] = this.tableFilterCriteria[key];
23176
- }
23177
- }
23423
+ const preserved = this.currentLockedCriteria();
23178
23424
  this.tableFilterCriteria = preserved;
23179
23425
  if (this.table) {
23180
23426
  if (Object.keys(preserved).length > 0) {
@@ -23191,6 +23437,11 @@ class PraxisCrudComponent {
23191
23437
  this.isClearingFilterCriteria = false;
23192
23438
  }
23193
23439
  }
23440
+ currentLockedCriteria() {
23441
+ return Object.fromEntries(this.effectiveLockedFilterFields
23442
+ .filter(key => Object.prototype.hasOwnProperty.call(this.tableFilterCriteria, key))
23443
+ .map(key => [key, this.tableFilterCriteria[key]]));
23444
+ }
23194
23445
  getEffectiveBindableFields() {
23195
23446
  const schemaFields = Array.isArray(this.schemaFields) && this.schemaFields.length > 0
23196
23447
  ? this.schemaFields
@@ -23293,13 +23544,13 @@ class PraxisCrudComponent {
23293
23544
  Object.assign(nextCriteria, projection.values);
23294
23545
  }
23295
23546
  this.workspaceProjectedFilterKeys = nextProjectedKeys;
23296
- this.tableQueryContext = this.resolveQueryContext(this.resolvedMetadata);
23547
+ this.tableQueryContext = this.resolveQueryContext(this.resolvedMetadata, this.tableQueryContext);
23297
23548
  const changed = !this.areFilterCriteriaEquivalent(this.tableFilterCriteria, nextCriteria);
23298
23549
  if (changed) {
23299
23550
  this.tableFilterCriteria = nextCriteria;
23300
23551
  this.filterCriteriaChange.emit({ ...nextCriteria });
23301
23552
  }
23302
- if (applyToTable && this.table) {
23553
+ if (applyToTable && this.table && this.resolvedKpiBandConfig?.filterScope !== 'table') {
23303
23554
  this.table.applyAdvancedFilterCriteria(this.tableFilterCriteria);
23304
23555
  this.kpiBand?.refresh?.();
23305
23556
  }
@@ -23323,9 +23574,7 @@ class PraxisCrudComponent {
23323
23574
  if (!cleanPath || this.isInspectOnly() || this.loadedSchemaResourcePath === cleanPath) {
23324
23575
  return;
23325
23576
  }
23326
- const rawKpiBand = this.resolvedMetadata?.kpiBand ??
23327
- this.resolvedMetadata?.table?.kpiBand ??
23328
- this.resolvedMetadata?.table?.behavior?.kpiBand;
23577
+ const rawKpiBand = resolveConfiguredKpiBand(this.resolvedMetadata);
23329
23578
  const wantsSchemaKpi = typeof rawKpiBand === 'object' &&
23330
23579
  rawKpiBand !== null &&
23331
23580
  rawKpiBand.source?.trim().toLowerCase() === 'schema';
@@ -25319,7 +25568,7 @@ class PraxisCrudComponent {
25319
25568
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisCrudComponent, isStandalone: true, selector: "praxis-crud", inputs: { metadata: "metadata", crudId: "crudId", resource: "resource", componentInstanceId: "componentInstanceId", tableConfigPersistenceStrategy: "tableConfigPersistenceStrategy", configPersistenceStrategy: "configPersistenceStrategy", context: "context", enableCustomization: "enableCustomization", showResourceIdentityKey: "showResourceIdentityKey", authoringCapability: "authoringCapability", filterCriteria: "filterCriteria", lockedFilterFields: "lockedFilterFields", schemaFields: "schemaFields", filterTeleport: ["filterTeleport", "filterTeleport", booleanAttribute], disableAutoDrawer: ["disableAutoDrawer", "disableAutoDrawer", booleanAttribute], hostManagedChrome: ["hostManagedChrome", "hostManagedChrome", booleanAttribute] }, outputs: { configureRequested: "configureRequested", afterOpen: "afterOpen", afterClose: "afterClose", afterSave: "afterSave", afterDelete: "afterDelete", reactiveDeterminationExecuted: "reactiveDeterminationExecuted", reactiveDeterminationPendingChange: "reactiveDeterminationPendingChange", reactiveDeterminationStabilityChange: "reactiveDeterminationStabilityChange", formStepTelemetry: "formStepTelemetry", error: "error", rowClick: "rowClick", rowAction: "rowAction", selectionChange: "selectionChange", resourceEvent: "resourceEvent", tableRuntimeConfigChange: "tableRuntimeConfigChange", drawerOpen: "drawerOpen", drawerClose: "drawerClose", crudAuthoringDocumentApplied: "crudAuthoringDocumentApplied", crudAuthoringDocumentSaved: "crudAuthoringDocumentSaved", filterCriteriaChange: "filterCriteriaChange", discoveredQuickFiltersChange: "discoveredQuickFiltersChange", discoveredInlineFilterFieldsChange: "discoveredInlineFilterFieldsChange", kpiCardClick: "kpiCardClick" }, providers: [
25320
25569
  providePraxisI18nConfig(RESOURCE_DISCOVERY_I18N_CONFIG),
25321
25570
  providePraxisI18nConfig(PRAXIS_CRUD_RUNTIME_I18N_CONFIG),
25322
- ], viewQueries: [{ propertyName: "kpiBand", first: true, predicate: PraxisKpiBandComponent, descendants: true }, { propertyName: "table", first: true, predicate: PraxisTable, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
25571
+ ], viewQueries: [{ propertyName: "tableFilterService", first: true, predicate: PraxisTable, descendants: true, read: GenericCrudService, isSignal: true }, { propertyName: "kpiBand", first: true, predicate: PraxisKpiBandComponent, descendants: true }, { propertyName: "table", first: true, predicate: PraxisTable, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
25323
25572
  <div class="praxis-crud-runtime" [attr.aria-busy]="openingActionLabel() ? 'true' : null">
25324
25573
  @if (openingActionLabel(); as actionLabel) {
25325
25574
  <div class="praxis-crud-opening-status" role="status" aria-live="polite" data-testid="praxis-crud-opening-status">
@@ -25363,10 +25612,13 @@ class PraxisCrudComponent {
25363
25612
  [quickFilters]="discoveredSchemaQuickFilters"
25364
25613
  [capabilities]="collectionCapabilities"
25365
25614
  [schemaMetadata]="discoveredSchemaMetadata"
25615
+ [tableFilterRequest]="resolveResourcePath(resolvedMetadata) ? tableFilterService()?.lastCollectionFilterRequest() ?? null : null"
25366
25616
  [baseFilter]="tableFilterCriteria"
25617
+ [queryContext]="tableQueryContext"
25367
25618
  (cardClick)="onKpiCardClick($event)"
25368
25619
  />
25369
25620
  }
25621
+ <ng-content select="praxis-scope-bar" />
25370
25622
  @if (resolvedStandaloneScopeBarItems; as scopeItems) {
25371
25623
  <praxis-scope-bar
25372
25624
  leadLabel="Filtro:"
@@ -25407,6 +25659,7 @@ class PraxisCrudComponent {
25407
25659
  (loadingStateChange)="onTableLoadingStateChange($event)"
25408
25660
  (drawerOpen)="onTableDrawerOpen($event)"
25409
25661
  (drawerClose)="onTableDrawerClose()"
25662
+ (queryContextChange)="tableQueryContext = $event"
25410
25663
  (filterCriteriaChange)="onTableFilterCriteriaChange($event)"
25411
25664
  (discoveredQuickFiltersChange)="onTableDiscoveredQuickFiltersChange($event)"
25412
25665
  (discoveredResourceFactsChange)="onTableDiscoveredResourceFactsChange($event)"
@@ -25423,7 +25676,7 @@ class PraxisCrudComponent {
25423
25676
  }
25424
25677
  }
25425
25678
  </div>
25426
- `, isInline: true, styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.praxis-crud-runtime{position:relative;min-width:0;display:flex;flex-direction:column;gap:var(--praxis-crud-runtime-gap, 16px)}.praxis-crud-runtime__header{display:flex;justify-content:space-between;align-items:var(--praxis-header-align-items, center);gap:16px;flex-wrap:wrap;padding:var(--praxis-header-padding, 0);border-radius:var(--praxis-header-radius, 0);background:var(--praxis-header-bg, transparent);border:var(--praxis-header-border, none);box-shadow:var(--praxis-header-shadow, none)}.praxis-crud-runtime__header-main{min-width:0;display:flex;flex-direction:column}.praxis-crud-runtime__domain-badge{display:inline-flex;align-items:center;gap:6px;padding:var(--praxis-domain-badge-padding, 4px 10px);border-radius:9999px;font-size:var(--praxis-domain-badge-font-size, 11px);font-weight:var(--praxis-domain-badge-weight, var(--mat-sys-label-small-weight, 500));text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--praxis-domain-badge-margin-bottom, 8px);align-self:flex-start;background:var(--praxis-domain-badge-bg, rgba(255, 255, 255, .08));color:var(--praxis-domain-badge-color, inherit);border:1px solid var(--praxis-domain-badge-border, rgba(255, 255, 255, .1))}.praxis-crud-runtime__domain-badge.tone-primary,.praxis-crud-runtime__domain-badge.tone-info{background:color-mix(in srgb,var(--praxis-info, #0369a1) 14%,transparent);color:var(--praxis-info, #0369a1);border-color:color-mix(in srgb,var(--praxis-info, #0369a1) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-accent{background:color-mix(in srgb,var(--praxis-primary, #6366f1) 14%,transparent);color:var(--praxis-primary, #818cf8);border-color:color-mix(in srgb,var(--praxis-primary, #6366f1) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-success{background:color-mix(in srgb,var(--praxis-success, #059669) 14%,transparent);color:var(--praxis-success, #34d399);border-color:color-mix(in srgb,var(--praxis-success, #059669) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-warning,.praxis-crud-runtime__domain-badge.tone-warn{background:color-mix(in srgb,var(--praxis-warning, #92400e) 14%,transparent);color:var(--praxis-warning, #92400e);border-color:color-mix(in srgb,var(--praxis-warning, #92400e) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-danger,.praxis-crud-runtime__domain-badge.tone-error{background:color-mix(in srgb,var(--praxis-error, #dc2626) 14%,transparent);color:var(--praxis-error, #f87171);border-color:color-mix(in srgb,var(--praxis-error, #dc2626) 30%,transparent)}.praxis-crud-runtime__domain-badge span.material-symbols-outlined{font-size:14px}.praxis-crud-runtime__title{margin:var(--praxis-page-title-margin, 0 0 6px 0);font-size:var(--praxis-page-title-size, 1.75rem);font-weight:var(--praxis-page-title-weight, var(--mat-sys-headline-medium-weight, 500));letter-spacing:-.02em;color:var(--praxis-page-title-color, var(--foreground, inherit));background:var(--praxis-page-title-bg, none);-webkit-text-fill-color:var(--praxis-page-title-fill-color, currentColor);line-height:1.2}.praxis-crud-runtime__subtitle{margin:var(--praxis-page-subtitle-margin, 0);font-size:var(--praxis-page-subtitle-size, .9rem);color:var(--muted-foreground, #94a3b8);max-width:800px;line-height:var(--praxis-page-subtitle-line-height, 1.5)}.praxis-crud-opening-status{position:absolute;z-index:6;top:.7rem;right:.7rem;display:inline-flex;align-items:center;gap:.55rem;min-height:2.25rem;max-width:min(24rem,calc(100% - 1.4rem));padding:.48rem .72rem;border:1px solid color-mix(in srgb,var(--md-sys-color-primary, #3f51b5) 32%,transparent);border-radius:999px;color:var(--md-sys-color-on-surface, currentColor);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, var(--md-sys-color-surface)) 94%,transparent);box-shadow:0 10px 28px #0f172a29;font-size:.82rem;font-weight:650;line-height:1.25;pointer-events:none}.praxis-crud-opening-status__spinner{width:.95rem;height:.95rem;flex:0 0 auto;border:2px solid color-mix(in srgb,var(--md-sys-color-primary, #3f51b5) 26%,transparent);border-top-color:var(--md-sys-color-primary, #3f51b5);border-radius:50%;animation:praxis-crud-opening-spin .72s linear infinite}@keyframes praxis-crud-opening-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.praxis-crud-opening-status__spinner{animation:none;border-top-color:currentColor}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone", "variant", "alignment", "density", "iconContainer"] }, { kind: "component", type: PraxisKpiBandComponent, selector: "praxis-kpi-band", inputs: ["config", "dataContext", "isInteractiveHost", "activeFilter", "endpointKey", "apiUrlEntry", "resourcePath", "resourceFacts", "quickFilters", "capabilities", "schemaMetadata", "baseFilter"], outputs: ["cardClick", "statsLoaded", "statsError", "refreshClick"] }, { kind: "component", type: PraxisScopeBarComponent, selector: "praxis-scope-bar", inputs: ["config", "items", "activeId", "showOmnibox", "omniboxPlaceholder", "omniboxValue", "omniboxDebounceMs", "leadIcon", "leadLabel", "showClearButton", "clearLabel", "showActiveFilterSummary", "activeFilters", "filterLabels", "target", "targetWidgetId", "targetWidgetIds", "scopeBarId", "searchField"], outputs: ["activeIdChange", "omniboxValueChange", "activeFiltersChange", "scopeChange", "searchChange", "filterCriteriaChange", "clear"] }] });
25679
+ `, isInline: true, styles: [":host{display:block;width:100%;min-width:0;max-width:100%}.praxis-crud-runtime{position:relative;min-width:0;display:flex;flex-direction:column;gap:var(--praxis-crud-runtime-gap, 16px)}.praxis-crud-runtime__header{display:flex;justify-content:space-between;align-items:var(--praxis-header-align-items, center);gap:16px;flex-wrap:wrap;padding:var(--praxis-header-padding, 0);border-radius:var(--praxis-header-radius, 0);background:var(--praxis-header-bg, transparent);border:var(--praxis-header-border, none);box-shadow:var(--praxis-header-shadow, none)}.praxis-crud-runtime__header-main{min-width:0;display:flex;flex-direction:column}.praxis-crud-runtime__domain-badge{display:inline-flex;align-items:center;gap:6px;padding:var(--praxis-domain-badge-padding, 4px 10px);border-radius:9999px;font-size:var(--praxis-domain-badge-font-size, 11px);font-weight:var(--praxis-domain-badge-weight, var(--mat-sys-label-small-weight, 500));text-transform:uppercase;letter-spacing:.05em;margin-bottom:var(--praxis-domain-badge-margin-bottom, 8px);align-self:flex-start;background:var(--praxis-domain-badge-bg, rgba(255, 255, 255, .08));color:var(--praxis-domain-badge-color, inherit);border:1px solid var(--praxis-domain-badge-border, rgba(255, 255, 255, .1))}.praxis-crud-runtime__domain-badge.tone-primary,.praxis-crud-runtime__domain-badge.tone-info{background:color-mix(in srgb,var(--praxis-info, #0369a1) 14%,transparent);color:var(--praxis-info, #0369a1);border-color:color-mix(in srgb,var(--praxis-info, #0369a1) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-accent{background:color-mix(in srgb,var(--praxis-primary, #6366f1) 14%,transparent);color:var(--praxis-primary, #818cf8);border-color:color-mix(in srgb,var(--praxis-primary, #6366f1) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-success{background:color-mix(in srgb,var(--praxis-success, #059669) 14%,transparent);color:var(--praxis-success, #34d399);border-color:color-mix(in srgb,var(--praxis-success, #059669) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-warning,.praxis-crud-runtime__domain-badge.tone-warn{background:color-mix(in srgb,var(--praxis-warning, #92400e) 14%,transparent);color:var(--praxis-warning, #92400e);border-color:color-mix(in srgb,var(--praxis-warning, #92400e) 30%,transparent)}.praxis-crud-runtime__domain-badge.tone-danger,.praxis-crud-runtime__domain-badge.tone-error{background:color-mix(in srgb,var(--praxis-error, #dc2626) 14%,transparent);color:var(--praxis-error, #f87171);border-color:color-mix(in srgb,var(--praxis-error, #dc2626) 30%,transparent)}.praxis-crud-runtime__domain-badge span.material-symbols-outlined{font-size:14px}.praxis-crud-runtime__title{margin:var(--praxis-page-title-margin, 0 0 6px 0);font-size:var(--praxis-page-title-size, 1.75rem);font-weight:var(--praxis-page-title-weight, var(--mat-sys-headline-medium-weight, 500));letter-spacing:-.02em;color:var(--praxis-page-title-color, var(--foreground, inherit));background:var(--praxis-page-title-bg, none);-webkit-text-fill-color:var(--praxis-page-title-fill-color, currentColor);line-height:1.2}.praxis-crud-runtime__subtitle{margin:var(--praxis-page-subtitle-margin, 0);font-size:var(--praxis-page-subtitle-size, .9rem);color:var(--muted-foreground, #94a3b8);max-width:800px;line-height:var(--praxis-page-subtitle-line-height, 1.5)}.praxis-crud-opening-status{position:absolute;z-index:6;top:.7rem;right:.7rem;display:inline-flex;align-items:center;gap:.55rem;min-height:2.25rem;max-width:min(24rem,calc(100% - 1.4rem));padding:.48rem .72rem;border:1px solid color-mix(in srgb,var(--md-sys-color-primary, #3f51b5) 32%,transparent);border-radius:999px;color:var(--md-sys-color-on-surface, currentColor);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, var(--md-sys-color-surface)) 94%,transparent);box-shadow:0 10px 28px #0f172a29;font-size:.82rem;font-weight:650;line-height:1.25;pointer-events:none}.praxis-crud-opening-status__spinner{width:.95rem;height:.95rem;flex:0 0 auto;border:2px solid color-mix(in srgb,var(--md-sys-color-primary, #3f51b5) 26%,transparent);border-top-color:var(--md-sys-color-primary, #3f51b5);border-radius:50%;animation:praxis-crud-opening-spin .72s linear infinite}@keyframes praxis-crud-opening-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.praxis-crud-opening-status__spinner{animation:none;border-top-color:currentColor}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: EmptyStateCardComponent, selector: "praxis-empty-state-card", inputs: ["icon", "title", "description", "primaryAction", "secondaryActions", "inline", "tone", "variant", "alignment", "density", "iconContainer"] }, { kind: "component", type: PraxisKpiBandComponent, selector: "praxis-kpi-band", inputs: ["config", "dataContext", "isInteractiveHost", "activeFilter", "endpointKey", "apiUrlEntry", "resourcePath", "resourceFacts", "quickFilters", "capabilities", "schemaMetadata", "queryContext", "tableFilterRequest", "baseFilter"], outputs: ["cardClick", "statsLoaded", "statsError", "refreshClick"] }, { kind: "component", type: PraxisScopeBarComponent, selector: "praxis-scope-bar", inputs: ["config", "items", "activeId", "showOmnibox", "omniboxPlaceholder", "omniboxValue", "omniboxDebounceMs", "leadIcon", "leadLabel", "showClearButton", "clearLabel", "showActiveFilterSummary", "activeFilters", "filterLabels", "target", "targetWidgetId", "targetWidgetIds", "scopeBarId", "searchField"], outputs: ["activeIdChange", "omniboxValueChange", "activeFiltersChange", "scopeChange", "searchChange", "filterCriteriaChange", "clear"] }] });
25427
25680
  }
25428
25681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisCrudComponent, decorators: [{
25429
25682
  type: Component,
@@ -25480,10 +25733,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
25480
25733
  [quickFilters]="discoveredSchemaQuickFilters"
25481
25734
  [capabilities]="collectionCapabilities"
25482
25735
  [schemaMetadata]="discoveredSchemaMetadata"
25736
+ [tableFilterRequest]="resolveResourcePath(resolvedMetadata) ? tableFilterService()?.lastCollectionFilterRequest() ?? null : null"
25483
25737
  [baseFilter]="tableFilterCriteria"
25738
+ [queryContext]="tableQueryContext"
25484
25739
  (cardClick)="onKpiCardClick($event)"
25485
25740
  />
25486
25741
  }
25742
+ <ng-content select="praxis-scope-bar" />
25487
25743
  @if (resolvedStandaloneScopeBarItems; as scopeItems) {
25488
25744
  <praxis-scope-bar
25489
25745
  leadLabel="Filtro:"
@@ -25524,6 +25780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
25524
25780
  (loadingStateChange)="onTableLoadingStateChange($event)"
25525
25781
  (drawerOpen)="onTableDrawerOpen($event)"
25526
25782
  (drawerClose)="onTableDrawerClose()"
25783
+ (queryContextChange)="tableQueryContext = $event"
25527
25784
  (filterCriteriaChange)="onTableFilterCriteriaChange($event)"
25528
25785
  (discoveredQuickFiltersChange)="onTableDiscoveredQuickFiltersChange($event)"
25529
25786
  (discoveredResourceFactsChange)="onTableDiscoveredResourceFactsChange($event)"
@@ -25623,7 +25880,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
25623
25880
  }], kpiBand: [{
25624
25881
  type: ViewChild,
25625
25882
  args: [PraxisKpiBandComponent]
25626
- }], table: [{
25883
+ }], tableFilterService: [{ type: i0.ViewChild, args: [i0.forwardRef(() => PraxisTable), { ...{ read: GenericCrudService }, isSignal: true }] }], table: [{
25627
25884
  type: ViewChild,
25628
25885
  args: [PraxisTable]
25629
25886
  }] } });
@@ -25640,7 +25897,7 @@ function createCrudFormRoute(target) {
25640
25897
  return {
25641
25898
  path: target.path,
25642
25899
  data: { crudFormTarget: { formId: target.formId, resourcePath: target.resourcePath } },
25643
- loadComponent: () => import('./praxisui-crud-crud-route-form.component-BHZZFLt1.mjs').then(m => m.CrudRouteFormComponent),
25900
+ loadComponent: () => import('./praxisui-crud-crud-route-form.component-C7ysEweZ.mjs').then(m => m.CrudRouteFormComponent),
25644
25901
  canDeactivate: [(component) => component.canLeave()],
25645
25902
  };
25646
25903
  }
@@ -28131,6 +28388,7 @@ const CRUD_AI_CAPABILITIES = {
28131
28388
  { path: 'filterBar.showAdvanced', category: 'table', valueKind: 'boolean', description: 'Habilita o painel de filtros avançados.' },
28132
28389
  { path: 'filterBar.placement', category: 'table', valueKind: 'enum', allowedValues: ENUMS.filterBarPlacement, description: 'Onde renderizar os filtros: table-toolbar ou scope-bar.' },
28133
28390
  { path: 'kpiBand', category: 'table', valueKind: 'object', description: 'Faixa executiva declarativa de KPIs acima da listagem principal.' },
28391
+ { path: 'kpiBand.filterScope', category: 'table', valueKind: 'string', description: 'Use table para limitar a agregação da coleção aos filtros ativos.' },
28134
28392
  { path: 'kpiBand.source', category: 'table', valueKind: 'string', description: 'Path relativo do endpoint de KPIs/stats (ex: /stats, /stats/group-by).' },
28135
28393
  { path: 'kpiBand.method', category: 'table', valueKind: 'enum', allowedValues: ENUMS.kpiBandMethod, description: 'Metodo HTTP da consulta de KPIs (GET ou POST).' },
28136
28394
  { path: 'kpiBand.payload', category: 'table', valueKind: 'object', description: 'Payload JSON enviado quando kpiBand.method = POST.' },
@@ -28273,12 +28531,13 @@ const kpiBandSchema = {
28273
28531
  type: 'object',
28274
28532
  properties: {
28275
28533
  enabled: { type: 'boolean' },
28276
- columns: { enum: [2, 3, 4] },
28534
+ columns: { type: 'integer', minimum: 1 },
28277
28535
  source: {
28278
28536
  type: 'string',
28279
28537
  description: "Endpoint de telemetria agregada (/stats/group-by ou /filter?page=0&size=1) ou 'schema' para auto-hidratação via /schemas/filtered, x-ui.resourceFacts, capabilities.stats e @QuickFilter.",
28280
28538
  },
28281
28539
  method: { enum: ['GET', 'POST'] },
28540
+ filterScope: { enum: ['table'], description: 'Apply the active table criteria to an explicit group-by on the same collection.' },
28282
28541
  payload: { type: 'object' },
28283
28542
  cards: {
28284
28543
  type: 'array',
@@ -28982,6 +29241,11 @@ class PraxisDossierPageComponent {
28982
29241
  }
28983
29242
  return this.fetchedSiblings();
28984
29243
  }, ...(ngDevMode ? [{ debugName: "resolvedSiblings" }] : /* istanbul ignore next */ []));
29244
+ siblingIdentities = computed(() => {
29245
+ const contract = this.schemaIdentity();
29246
+ const fields = this.schemaFields().filter(({ name }) => name === contract?.titleField || name === contract?.subtitleField);
29247
+ return new Map(this.resolvedSiblings().map((row) => [row, materializeResourceIdentity(contract, row, fields)]));
29248
+ }, ...(ngDevMode ? [{ debugName: "siblingIdentities" }] : /* istanbul ignore next */ []));
28985
29249
  filteredSiblings = computed(() => {
28986
29250
  const siblings = this.resolvedSiblings();
28987
29251
  const term = this.switcherFilterSignal().trim().toLowerCase();
@@ -28989,10 +29253,15 @@ class PraxisDossierPageComponent {
28989
29253
  return siblings;
28990
29254
  }
28991
29255
  return siblings.filter((row) => {
28992
- const label = this.resolveSiblingLabel(row).toLowerCase();
28993
- const sub = this.resolveSiblingSubtitle(row).toLowerCase();
28994
- const id = String(this.resolveSiblingId(row)).toLowerCase();
28995
- return label.includes(term) || sub.includes(term) || id.includes(term);
29256
+ const identity = this.siblingIdentities().get(row);
29257
+ const candidates = [
29258
+ this.resolveSiblingLabel(row),
29259
+ this.resolveSiblingSubtitle(row),
29260
+ this.resolveSiblingId(row),
29261
+ identity?.title?.value,
29262
+ identity?.subtitle?.value,
29263
+ ];
29264
+ return candidates.some((value) => String(value ?? '').toLowerCase().includes(term));
28996
29265
  });
28997
29266
  }, ...(ngDevMode ? [{ debugName: "filteredSiblings" }] : /* istanbul ignore next */ []));
28998
29267
  materializedIdentity = computed(() => {
@@ -29004,8 +29273,8 @@ class PraxisDossierPageComponent {
29004
29273
  return materializeResourceIdentity(contract, record, this.schemaFields());
29005
29274
  }, ...(ngDevMode ? [{ debugName: "materializedIdentity" }] : /* istanbul ignore next */ []));
29006
29275
  heroTitle = computed(() => {
29007
- const rawTitle = this.materializedIdentity()?.title?.value;
29008
- const identityTitle = rawTitle !== null && rawTitle !== undefined ? String(rawTitle).trim() : '';
29276
+ const title = this.materializedIdentity()?.title;
29277
+ const identityTitle = String(title?.formattedValue ?? title?.value ?? '').trim();
29009
29278
  if (identityTitle) {
29010
29279
  return identityTitle;
29011
29280
  }
@@ -29015,8 +29284,8 @@ class PraxisDossierPageComponent {
29015
29284
  this.effectiveEyebrow());
29016
29285
  }, ...(ngDevMode ? [{ debugName: "heroTitle" }] : /* istanbul ignore next */ []));
29017
29286
  heroSubtitle = computed(() => {
29018
- const rawSub = this.materializedIdentity()?.subtitle?.value;
29019
- const identitySubtitle = rawSub !== null && rawSub !== undefined ? String(rawSub).trim() : '';
29287
+ const subtitle = this.materializedIdentity()?.subtitle;
29288
+ const identitySubtitle = String(subtitle?.formattedValue ?? subtitle?.value ?? '').trim();
29020
29289
  if (identitySubtitle) {
29021
29290
  return identitySubtitle;
29022
29291
  }
@@ -29045,14 +29314,14 @@ class PraxisDossierPageComponent {
29045
29314
  if (!this.isFieldVisibleForCurrentAuthorities(fieldDef)) {
29046
29315
  continue;
29047
29316
  }
29048
- const rawValue = record[item.field] ?? item.value;
29049
29317
  const sensitive = this.isSensitiveField(fieldDef, item.field);
29050
29318
  const revealed = revealedSet.has(item.field);
29051
- const formatted = this.formatScalarValue(rawValue);
29319
+ const formatted = this.formatScalarValue(sensitive ? item.value : item.formattedValue ?? item.value);
29320
+ const protectedValue = sensitive && !revealed && !isMaskedPresentationToken(item.value);
29052
29321
  chips.push({
29053
29322
  field: item.field,
29054
29323
  label: item.label || fieldDef?.label || item.field,
29055
- value: sensitive && !revealed ? this.maskValue(formatted) : formatted,
29324
+ value: protectedValue ? this.maskValue(formatted) : formatted,
29056
29325
  masked: sensitive,
29057
29326
  revealed,
29058
29327
  icon: fieldDef?.icon,
@@ -29327,6 +29596,9 @@ class PraxisDossierPageComponent {
29327
29596
  return typeof raw === 'string' || typeof raw === 'number' ? raw : '';
29328
29597
  }
29329
29598
  resolveSiblingLabel(row) {
29599
+ const formatted = this.siblingIdentities().get(row)?.title?.formattedValue;
29600
+ if (formatted)
29601
+ return formatted;
29330
29602
  const identity = this.schemaIdentity();
29331
29603
  if (identity?.titleField && row[identity.titleField]) {
29332
29604
  return String(row[identity.titleField]);
@@ -29335,6 +29607,9 @@ class PraxisDossierPageComponent {
29335
29607
  return String(candidate ?? '');
29336
29608
  }
29337
29609
  resolveSiblingSubtitle(row) {
29610
+ const formatted = this.siblingIdentities().get(row)?.subtitle?.formattedValue;
29611
+ if (formatted)
29612
+ return formatted;
29338
29613
  const identity = this.schemaIdentity();
29339
29614
  if (identity?.subtitleField && row[identity.subtitleField]) {
29340
29615
  return String(row[identity.subtitleField]);
@@ -31383,9 +31658,20 @@ class PraxisResourcePage {
31383
31658
  const cardFilter = event.card.filter;
31384
31659
  if (cardFilter !== undefined && cardFilter !== null) {
31385
31660
  const normalized = this.normalizeScopeFilterExpression(cardFilter);
31661
+ const band = resolveConfiguredKpiBand(this.effectiveMetadata());
31386
31662
  if (Object.keys(normalized).length === 0) {
31387
31663
  this.onScopeClear();
31388
31664
  }
31665
+ else if (band && band.filterScope === 'table') {
31666
+ const locked = this.effectiveLockedFilterFields();
31667
+ const current = { ...this.activeScopeFilter() };
31668
+ const effective = this.effectiveFilterCriteria();
31669
+ for (const field of locked) {
31670
+ if (Object.prototype.hasOwnProperty.call(effective, field))
31671
+ current[field] = effective[field];
31672
+ }
31673
+ this.onCrudFilterCriteriaChange(toggleKpiCriteria(current, normalized, locked));
31674
+ }
31389
31675
  else if (this.areScopeFiltersEqual(this.activeScopeFilter(), normalized)) {
31390
31676
  this.onScopeClear();
31391
31677
  }
@@ -31652,32 +31938,37 @@ class PraxisResourcePage {
31652
31938
  </header>
31653
31939
  }
31654
31940
 
31655
- <!-- Auto-ScopeBar Integrado -->
31656
- @if (effectiveScopeBar(); as sb) {
31657
- <praxis-scope-bar
31658
- [leadLabel]="sb.leadLabel || 'Filtro:'"
31659
- [leadIcon]="sb.leadIcon || 'tune'"
31660
- [items]="sb.items || []"
31661
- [activeId]="activeScopeId()"
31662
- [showClearButton]="sb.showClearButton ?? true"
31663
- [clearLabel]="sb.clearLabel || 'Limpar Filtro'"
31664
- [showOmnibox]="sb.showOmnibox ?? false"
31665
- [omniboxPlaceholder]="sb.omniboxPlaceholder || 'Buscar registros...'"
31666
- [searchField]="sb.searchField || 'q'"
31667
- [showActiveFilterSummary]="sb.showActiveFilterSummary ?? false"
31668
- [activeFilters]="orthogonalScopeFilters()"
31669
- [filterLabels]="sb.filterLabels"
31670
- (scopeChange)="onScopeChange($event)"
31671
- (filterCriteriaChange)="onScopeFilterCriteriaChange($event)"
31672
- (clear)="onScopeClear()"
31673
- >
31674
- @if (effectiveIncludeInlineFilters()) {
31675
- <praxis-filter-outlet
31676
- scope-bar-filters
31677
- [target]="crudSurface()"
31678
- />
31679
- }
31680
- </praxis-scope-bar>
31941
+ <ng-template #pageFilters>
31942
+ @if (effectiveScopeBar(); as sb) {
31943
+ <praxis-scope-bar
31944
+ [leadLabel]="sb.leadLabel || 'Filtro:'"
31945
+ [leadIcon]="sb.leadIcon || 'tune'"
31946
+ [items]="sb.items || []"
31947
+ [activeId]="activeScopeId()"
31948
+ [showClearButton]="sb.showClearButton ?? true"
31949
+ [clearLabel]="sb.clearLabel || 'Limpar Filtro'"
31950
+ [showOmnibox]="sb.showOmnibox ?? false"
31951
+ [omniboxPlaceholder]="sb.omniboxPlaceholder || 'Buscar registros...'"
31952
+ [searchField]="sb.searchField || 'q'"
31953
+ [showActiveFilterSummary]="sb.showActiveFilterSummary ?? false"
31954
+ [activeFilters]="orthogonalScopeFilters()"
31955
+ [filterLabels]="sb.filterLabels"
31956
+ (scopeChange)="onScopeChange($event)"
31957
+ (filterCriteriaChange)="onScopeFilterCriteriaChange($event)"
31958
+ (clear)="onScopeClear()"
31959
+ >
31960
+ @if (effectiveIncludeInlineFilters()) {
31961
+ <praxis-filter-outlet
31962
+ scope-bar-filters
31963
+ [target]="crudSurface()"
31964
+ />
31965
+ }
31966
+ </praxis-scope-bar>
31967
+ }
31968
+ </ng-template>
31969
+
31970
+ @if (!effectiveResource() && !effectiveEnableCustomization() && !hasLocalData()) {
31971
+ <ng-container [ngTemplateOutlet]="pageFilters" />
31681
31972
  }
31682
31973
 
31683
31974
  <!-- Praxis CRUD Runtime com isolamento reativo multi-tenant -->
@@ -31717,12 +32008,18 @@ class PraxisResourcePage {
31717
32008
  (afterSave)="afterSave.emit($event)"
31718
32009
  (afterDelete)="afterDelete.emit($event)"
31719
32010
  (error)="error.emit($event)"
31720
- ></praxis-crud>
32011
+ >
32012
+ <ng-container ngProjectAs="praxis-scope-bar">
32013
+ @if (effectiveResource() || effectiveEnableCustomization() || hasLocalData()) {
32014
+ <ng-container [ngTemplateOutlet]="pageFilters" />
32015
+ }
32016
+ </ng-container>
32017
+ </praxis-crud>
31721
32018
  </section>
31722
32019
  }
31723
32020
  }
31724
32021
  </div>
31725
- `, isInline: true, styles: [":host{display:block;width:100%;min-height:100%;box-sizing:border-box}.praxis-resource-page{width:100%;display:flex;flex-direction:column;gap:var(--praxis-page-gap, 16px);padding:var(--praxis-page-padding, 24px);box-sizing:border-box;max-width:var(--praxis-page-max-width, 1560px);margin:0 auto}:host-context(.praxis-shell__content) .praxis-resource-page{padding:var(--praxis-page-padding, 0)}.praxis-resource-page__header{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:var(--praxis-header-padding, 0);border-radius:var(--praxis-header-radius, 0);background:var(--praxis-header-bg, transparent);border:var(--praxis-header-border, none);box-shadow:var(--praxis-header-shadow, none)}.praxis-resource-page__header-main{min-width:0;display:flex;flex-direction:column}.praxis-resource-page__domain-badge{display:inline-flex;align-items:center;gap:6px;padding:var(--praxis-domain-badge-padding, 4px 10px);border-radius:9999px;font-size:var(--praxis-domain-badge-font-size, 11px);font-weight:var(--praxis-domain-badge-weight, var(--mat-sys-label-small-weight, 500));text-transform:uppercase;letter-spacing:var(--praxis-domain-badge-tracking, var(--hero-label-tracking, .05em));margin-bottom:var(--praxis-domain-badge-margin-bottom, 6px);align-self:flex-start;background:var(--praxis-domain-badge-bg, color-mix(in srgb, currentColor 10%, transparent));color:var(--praxis-domain-badge-color, inherit);border:1px solid var(--praxis-domain-badge-border, color-mix(in srgb, currentColor 24%, transparent))}.praxis-resource-page__domain-badge.tone-primary,.praxis-resource-page__domain-badge.tone-info{background:color-mix(in srgb,var(--praxis-info, var(--primary, #0369a1)) 12%,transparent);color:var(--praxis-info, var(--primary, #0369a1));border-color:color-mix(in srgb,var(--praxis-info, var(--primary, #0369a1)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-accent{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 12%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-success,.praxis-resource-page__domain-badge.tone-ready{background:color-mix(in srgb,var(--praxis-success, var(--ready, #059669)) 12%,transparent);color:var(--praxis-success, var(--ready, #059669));border-color:color-mix(in srgb,var(--praxis-success, var(--ready, #059669)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-warning,.praxis-resource-page__domain-badge.tone-warn{background:color-mix(in srgb,var(--praxis-warning, var(--warning, #92400e)) 14%,transparent);color:var(--praxis-warning, var(--warning, #92400e));border-color:color-mix(in srgb,var(--praxis-warning, var(--warning, #92400e)) 30%,transparent)}.praxis-resource-page__domain-badge.tone-danger,.praxis-resource-page__domain-badge.tone-error{background:color-mix(in srgb,var(--praxis-error, var(--destructive, #dc2626)) 12%,transparent);color:var(--praxis-error, var(--destructive, #dc2626));border-color:color-mix(in srgb,var(--praxis-error, var(--destructive, #dc2626)) 28%,transparent)}.praxis-resource-page__domain-badge span.material-symbols-outlined{font-size:14px}.praxis-resource-page__title{margin:var(--praxis-page-title-margin, 0);font-family:var(--praxis-page-title-font, var(--font-display, inherit));font-size:var(--praxis-page-title-size, clamp(1.28rem, 1.6vw, 1.45rem));font-weight:var(--praxis-page-title-weight, var(--mat-sys-headline-medium-weight, 500));letter-spacing:-.02em;color:var(--praxis-page-title-color, var(--foreground, inherit));background:var(--praxis-page-title-bg, none);-webkit-text-fill-color:var(--praxis-page-title-fill-color, currentColor);line-height:1.22}.praxis-resource-page__subtitle{margin:var(--praxis-page-subtitle-margin, 4px 0 0);font-size:var(--praxis-page-subtitle-size, .84rem);color:var(--muted-foreground, var(--md-sys-color-on-surface-variant, #64748b));max-width:800px;line-height:var(--praxis-page-subtitle-line-height, 1.45)}.praxis-resource-page__header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.praxis-resource-page__configure-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 35%,transparent);background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 14%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__configure-btn:hover{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 22%,transparent)}.praxis-resource-page__configure-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__configure-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__rules-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 72%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .12)) 80%,transparent);color:var(--md-sys-color-on-surface, inherit);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__rules-btn:hover{border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 45%,transparent);color:var(--praxis-primary, var(--primary, #6366f1))}.praxis-resource-page__rules-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__rules-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__assistant-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 38%,transparent);background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 14%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__assistant-btn:hover{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 24%,transparent)}.praxis-resource-page__assistant-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__assistant-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__studio-btn{display:inline-flex;align-items:center;gap:6px;height:36px;min-height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 72%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .12)) 80%,transparent);color:var(--md-sys-color-on-surface, inherit);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__studio-btn:hover{border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 45%,transparent);color:var(--praxis-primary, var(--primary, #6366f1))}.praxis-resource-page__studio-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__studio-btn .material-symbols-outlined{font-size:18px}@media(prefers-reduced-motion:reduce){.praxis-resource-page__configure-btn,.praxis-resource-page__rules-btn,.praxis-resource-page__assistant-btn,.praxis-resource-page__studio-btn{transition:none}}.praxis-resource-page__crud-surface{width:100%;border-radius:var(--praxis-surface-radius, 0);overflow:visible}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: PraxisCrudComponent, selector: "praxis-crud", inputs: ["metadata", "crudId", "resource", "componentInstanceId", "tableConfigPersistenceStrategy", "configPersistenceStrategy", "context", "enableCustomization", "showResourceIdentityKey", "authoringCapability", "filterCriteria", "lockedFilterFields", "schemaFields", "filterTeleport", "disableAutoDrawer", "hostManagedChrome"], outputs: ["configureRequested", "afterOpen", "afterClose", "afterSave", "afterDelete", "reactiveDeterminationExecuted", "reactiveDeterminationPendingChange", "reactiveDeterminationStabilityChange", "formStepTelemetry", "error", "rowClick", "rowAction", "selectionChange", "resourceEvent", "tableRuntimeConfigChange", "drawerOpen", "drawerClose", "crudAuthoringDocumentApplied", "crudAuthoringDocumentSaved", "filterCriteriaChange", "discoveredQuickFiltersChange", "discoveredInlineFilterFieldsChange", "kpiCardClick"] }, { kind: "component", type: PraxisScopeBarComponent, selector: "praxis-scope-bar", inputs: ["config", "items", "activeId", "showOmnibox", "omniboxPlaceholder", "omniboxValue", "omniboxDebounceMs", "leadIcon", "leadLabel", "showClearButton", "clearLabel", "showActiveFilterSummary", "activeFilters", "filterLabels", "target", "targetWidgetId", "targetWidgetIds", "scopeBarId", "searchField"], outputs: ["activeIdChange", "omniboxValueChange", "activeFiltersChange", "scopeChange", "searchChange", "filterCriteriaChange", "clear"] }, { kind: "component", type: PraxisFilterOutletComponent, selector: "praxis-filter-outlet", inputs: ["target"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
32022
+ `, isInline: true, styles: [":host{display:block;width:100%;min-height:100%;box-sizing:border-box}.praxis-resource-page{width:100%;display:flex;flex-direction:column;gap:var(--praxis-page-gap, 16px);padding:var(--praxis-page-padding, 24px);box-sizing:border-box;max-width:var(--praxis-page-max-width, 1560px);margin:0 auto}:host-context(.praxis-shell__content) .praxis-resource-page{padding:var(--praxis-page-padding, 0)}.praxis-resource-page__header{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:var(--praxis-header-padding, 0);border-radius:var(--praxis-header-radius, 0);background:var(--praxis-header-bg, transparent);border:var(--praxis-header-border, none);box-shadow:var(--praxis-header-shadow, none)}.praxis-resource-page__header-main{min-width:0;display:flex;flex-direction:column}.praxis-resource-page__domain-badge{display:inline-flex;align-items:center;gap:6px;padding:var(--praxis-domain-badge-padding, 4px 10px);border-radius:9999px;font-size:var(--praxis-domain-badge-font-size, 11px);font-weight:var(--praxis-domain-badge-weight, var(--mat-sys-label-small-weight, 500));text-transform:uppercase;letter-spacing:var(--praxis-domain-badge-tracking, var(--hero-label-tracking, .05em));margin-bottom:var(--praxis-domain-badge-margin-bottom, 6px);align-self:flex-start;background:var(--praxis-domain-badge-bg, color-mix(in srgb, currentColor 10%, transparent));color:var(--praxis-domain-badge-color, inherit);border:1px solid var(--praxis-domain-badge-border, color-mix(in srgb, currentColor 24%, transparent))}.praxis-resource-page__domain-badge.tone-primary,.praxis-resource-page__domain-badge.tone-info{background:color-mix(in srgb,var(--praxis-info, var(--primary, #0369a1)) 12%,transparent);color:var(--praxis-info, var(--primary, #0369a1));border-color:color-mix(in srgb,var(--praxis-info, var(--primary, #0369a1)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-accent{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 12%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-success,.praxis-resource-page__domain-badge.tone-ready{background:color-mix(in srgb,var(--praxis-success, var(--ready, #059669)) 12%,transparent);color:var(--praxis-success, var(--ready, #059669));border-color:color-mix(in srgb,var(--praxis-success, var(--ready, #059669)) 28%,transparent)}.praxis-resource-page__domain-badge.tone-warning,.praxis-resource-page__domain-badge.tone-warn{background:color-mix(in srgb,var(--praxis-warning, var(--warning, #92400e)) 14%,transparent);color:var(--praxis-warning, var(--warning, #92400e));border-color:color-mix(in srgb,var(--praxis-warning, var(--warning, #92400e)) 30%,transparent)}.praxis-resource-page__domain-badge.tone-danger,.praxis-resource-page__domain-badge.tone-error{background:color-mix(in srgb,var(--praxis-error, var(--destructive, #dc2626)) 12%,transparent);color:var(--praxis-error, var(--destructive, #dc2626));border-color:color-mix(in srgb,var(--praxis-error, var(--destructive, #dc2626)) 28%,transparent)}.praxis-resource-page__domain-badge span.material-symbols-outlined{font-size:14px}.praxis-resource-page__title{margin:var(--praxis-page-title-margin, 0);font-family:var(--praxis-page-title-font, var(--font-display, inherit));font-size:var(--praxis-page-title-size, clamp(1.28rem, 1.6vw, 1.45rem));font-weight:var(--praxis-page-title-weight, var(--mat-sys-headline-medium-weight, 500));letter-spacing:-.02em;color:var(--praxis-page-title-color, var(--foreground, inherit));background:var(--praxis-page-title-bg, none);-webkit-text-fill-color:var(--praxis-page-title-fill-color, currentColor);line-height:1.22}.praxis-resource-page__subtitle{margin:var(--praxis-page-subtitle-margin, 4px 0 0);font-size:var(--praxis-page-subtitle-size, .84rem);color:var(--muted-foreground, var(--md-sys-color-on-surface-variant, #64748b));max-width:800px;line-height:var(--praxis-page-subtitle-line-height, 1.45)}.praxis-resource-page__header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.praxis-resource-page__configure-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 35%,transparent);background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 14%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__configure-btn:hover{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 22%,transparent)}.praxis-resource-page__configure-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__configure-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__rules-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 72%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .12)) 80%,transparent);color:var(--md-sys-color-on-surface, inherit);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__rules-btn:hover{border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 45%,transparent);color:var(--praxis-primary, var(--primary, #6366f1))}.praxis-resource-page__rules-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__rules-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__assistant-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 38%,transparent);background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 14%,transparent);color:var(--praxis-primary, var(--primary, #6366f1));font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__assistant-btn:hover{background:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 24%,transparent)}.praxis-resource-page__assistant-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__assistant-btn .material-symbols-outlined{font-size:18px}.praxis-resource-page__studio-btn{display:inline-flex;align-items:center;gap:6px;height:36px;min-height:36px;padding:0 14px;border-radius:var(--praxis-configure-btn-radius, 10px);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, #64748b) 72%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container-high, rgba(148, 163, 184, .12)) 80%,transparent);color:var(--md-sys-color-on-surface, inherit);font-size:13px;font-weight:600;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.praxis-resource-page__studio-btn:hover{border-color:color-mix(in srgb,var(--praxis-primary, var(--primary, #6366f1)) 45%,transparent);color:var(--praxis-primary, var(--primary, #6366f1))}.praxis-resource-page__studio-btn:focus-visible{outline:2px solid var(--praxis-primary, var(--primary, #6366f1));outline-offset:2px}.praxis-resource-page__studio-btn .material-symbols-outlined{font-size:18px}@media(prefers-reduced-motion:reduce){.praxis-resource-page__configure-btn,.praxis-resource-page__rules-btn,.praxis-resource-page__assistant-btn,.praxis-resource-page__studio-btn{transition:none}}.praxis-resource-page__crud-surface{width:100%;border-radius:var(--praxis-surface-radius, 0);overflow:visible}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PraxisCrudComponent, selector: "praxis-crud", inputs: ["metadata", "crudId", "resource", "componentInstanceId", "tableConfigPersistenceStrategy", "configPersistenceStrategy", "context", "enableCustomization", "showResourceIdentityKey", "authoringCapability", "filterCriteria", "lockedFilterFields", "schemaFields", "filterTeleport", "disableAutoDrawer", "hostManagedChrome"], outputs: ["configureRequested", "afterOpen", "afterClose", "afterSave", "afterDelete", "reactiveDeterminationExecuted", "reactiveDeterminationPendingChange", "reactiveDeterminationStabilityChange", "formStepTelemetry", "error", "rowClick", "rowAction", "selectionChange", "resourceEvent", "tableRuntimeConfigChange", "drawerOpen", "drawerClose", "crudAuthoringDocumentApplied", "crudAuthoringDocumentSaved", "filterCriteriaChange", "discoveredQuickFiltersChange", "discoveredInlineFilterFieldsChange", "kpiCardClick"] }, { kind: "component", type: PraxisScopeBarComponent, selector: "praxis-scope-bar", inputs: ["config", "items", "activeId", "showOmnibox", "omniboxPlaceholder", "omniboxValue", "omniboxDebounceMs", "leadIcon", "leadLabel", "showClearButton", "clearLabel", "showActiveFilterSummary", "activeFilters", "filterLabels", "target", "targetWidgetId", "targetWidgetIds", "scopeBarId", "searchField"], outputs: ["activeIdChange", "omniboxValueChange", "activeFiltersChange", "scopeChange", "searchChange", "filterCriteriaChange", "clear"] }, { kind: "component", type: PraxisFilterOutletComponent, selector: "praxis-filter-outlet", inputs: ["target"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
31726
32023
  }
31727
32024
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisResourcePage, decorators: [{
31728
32025
  type: Component,
@@ -31806,32 +32103,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
31806
32103
  </header>
31807
32104
  }
31808
32105
 
31809
- <!-- Auto-ScopeBar Integrado -->
31810
- @if (effectiveScopeBar(); as sb) {
31811
- <praxis-scope-bar
31812
- [leadLabel]="sb.leadLabel || 'Filtro:'"
31813
- [leadIcon]="sb.leadIcon || 'tune'"
31814
- [items]="sb.items || []"
31815
- [activeId]="activeScopeId()"
31816
- [showClearButton]="sb.showClearButton ?? true"
31817
- [clearLabel]="sb.clearLabel || 'Limpar Filtro'"
31818
- [showOmnibox]="sb.showOmnibox ?? false"
31819
- [omniboxPlaceholder]="sb.omniboxPlaceholder || 'Buscar registros...'"
31820
- [searchField]="sb.searchField || 'q'"
31821
- [showActiveFilterSummary]="sb.showActiveFilterSummary ?? false"
31822
- [activeFilters]="orthogonalScopeFilters()"
31823
- [filterLabels]="sb.filterLabels"
31824
- (scopeChange)="onScopeChange($event)"
31825
- (filterCriteriaChange)="onScopeFilterCriteriaChange($event)"
31826
- (clear)="onScopeClear()"
31827
- >
31828
- @if (effectiveIncludeInlineFilters()) {
31829
- <praxis-filter-outlet
31830
- scope-bar-filters
31831
- [target]="crudSurface()"
31832
- />
31833
- }
31834
- </praxis-scope-bar>
32106
+ <ng-template #pageFilters>
32107
+ @if (effectiveScopeBar(); as sb) {
32108
+ <praxis-scope-bar
32109
+ [leadLabel]="sb.leadLabel || 'Filtro:'"
32110
+ [leadIcon]="sb.leadIcon || 'tune'"
32111
+ [items]="sb.items || []"
32112
+ [activeId]="activeScopeId()"
32113
+ [showClearButton]="sb.showClearButton ?? true"
32114
+ [clearLabel]="sb.clearLabel || 'Limpar Filtro'"
32115
+ [showOmnibox]="sb.showOmnibox ?? false"
32116
+ [omniboxPlaceholder]="sb.omniboxPlaceholder || 'Buscar registros...'"
32117
+ [searchField]="sb.searchField || 'q'"
32118
+ [showActiveFilterSummary]="sb.showActiveFilterSummary ?? false"
32119
+ [activeFilters]="orthogonalScopeFilters()"
32120
+ [filterLabels]="sb.filterLabels"
32121
+ (scopeChange)="onScopeChange($event)"
32122
+ (filterCriteriaChange)="onScopeFilterCriteriaChange($event)"
32123
+ (clear)="onScopeClear()"
32124
+ >
32125
+ @if (effectiveIncludeInlineFilters()) {
32126
+ <praxis-filter-outlet
32127
+ scope-bar-filters
32128
+ [target]="crudSurface()"
32129
+ />
32130
+ }
32131
+ </praxis-scope-bar>
32132
+ }
32133
+ </ng-template>
32134
+
32135
+ @if (!effectiveResource() && !effectiveEnableCustomization() && !hasLocalData()) {
32136
+ <ng-container [ngTemplateOutlet]="pageFilters" />
31835
32137
  }
31836
32138
 
31837
32139
  <!-- Praxis CRUD Runtime com isolamento reativo multi-tenant -->
@@ -31871,7 +32173,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
31871
32173
  (afterSave)="afterSave.emit($event)"
31872
32174
  (afterDelete)="afterDelete.emit($event)"
31873
32175
  (error)="error.emit($event)"
31874
- ></praxis-crud>
32176
+ >
32177
+ <ng-container ngProjectAs="praxis-scope-bar">
32178
+ @if (effectiveResource() || effectiveEnableCustomization() || hasLocalData()) {
32179
+ <ng-container [ngTemplateOutlet]="pageFilters" />
32180
+ }
32181
+ </ng-container>
32182
+ </praxis-crud>
31875
32183
  </section>
31876
32184
  }
31877
32185
  }