@praxisui/crud 10.0.0-rc.26 → 10.0.0-rc.28

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,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-10-15T19:07:41.629Z",
3
+ "generatedAt": "2026-10-16T01:37:23.681Z",
4
4
  "packageName": "@praxisui/crud",
5
- "packageVersion": "10.0.0-rc.26",
5
+ "packageVersion": "10.0.0-rc.28",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 2,
@@ -3,19 +3,19 @@ import { inject, DestroyRef, signal, HostListener, ViewChild, Inject, ViewEncaps
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { HttpClient } from '@angular/common/http';
5
5
  import { Router, ActivatedRoute, RouterLink } from '@angular/router';
6
+ import * as i1$1 from '@angular/material/dialog';
7
+ import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
8
+ export { MAT_DIALOG_DATA as DIALOG_DATA } from '@angular/material/dialog';
6
9
  import { MatSnackBar } from '@angular/material/snack-bar';
7
10
  import { Subscription, firstValueFrom, BehaviorSubject } from 'rxjs';
8
11
  import { take, filter } from 'rxjs/operators';
9
12
  import * as i2$1 from '@praxisui/core';
10
- import { PraxisBulkClientService, PraxisI18nService, generateBulkIdempotencyKey, isBulkExecutionTerminal, API_URL, SafeExpressionEvaluator, buildApiUrl, ASYNC_CONFIG_STORAGE, GlobalConfigService, CrudOperationResolutionService, LoggerService, SurfaceNavigationError, fillUndefined, GenericCrudService, SETTINGS_PANEL_DATA, buildBaseColumnFromDef, PraxisIconDirective, providePraxisI18nConfig, SchemaNormalizerService, createDefaultTableConfig, PraxisWidgetEventBus, EnterpriseRuntimeContextService, GLOBAL_SURFACE_SERVICE, SurfaceOutletRegistryService, ComponentKeyService, ResourceDiscoveryService, ResourceActionOpenAdapterService, ResourceSurfaceOpenAdapterService, composeHeadersWithVersion, normalizeSurfaceOperationContext, translateUnavailableWorkflowMessage, isSurfaceNavigationError, translateSurfaceNavigationRejected, normalizeUnknownError, EmptyStateCardComponent, RESOURCE_DISCOVERY_I18N_CONFIG, SURFACE_DRAWER_REF, SURFACE_DRAWER_CONTENT_DATA, PraxisIconButtonComponent, PraxisResourceIdentityComponent, ComponentMetadataRegistry, PraxisCustomizationModeService } from '@praxisui/core';
13
+ import { PraxisBulkClientService, PraxisI18nService, generateBulkIdempotencyKey, isBulkExecutionTerminal, API_URL, SafeExpressionEvaluator, buildApiUrl, ASYNC_CONFIG_STORAGE, GlobalConfigService, CrudOperationResolutionService, LoggerService, SurfaceNavigationError, fillUndefined, GenericCrudService, SETTINGS_PANEL_DATA, buildBaseColumnFromDef, PraxisIconDirective, providePraxisI18nConfig, SchemaNormalizerService, createDefaultTableConfig, PraxisWidgetEventBus, EnterpriseRuntimeContextService, GLOBAL_SURFACE_SERVICE, SurfaceOutletRegistryService, ComponentKeyService, ResourceDiscoveryService, ResourceActionOpenAdapterService, ResourceSurfaceOpenAdapterService, composeHeadersWithVersion, normalizeSurfaceOperationContext, SURFACE_DRAWER_REF, translateUnavailableWorkflowMessage, isSurfaceNavigationError, translateSurfaceNavigationRejected, normalizeUnknownError, EmptyStateCardComponent, RESOURCE_DISCOVERY_I18N_CONFIG, SURFACE_DRAWER_CONTENT_DATA, PraxisIconButtonComponent, PraxisResourceIdentityComponent, ComponentMetadataRegistry, PraxisCustomizationModeService } from '@praxisui/core';
11
14
  export { createDynamicRecord, extractRecordId, isDynamicDataRecord, resolveDataField } from '@praxisui/core';
12
15
  import * as i1 from '@angular/common';
13
16
  import { CommonModule } from '@angular/common';
14
17
  import * as i3 from '@angular/material/button';
15
18
  import { MatButtonModule } from '@angular/material/button';
16
- import * as i1$1 from '@angular/material/dialog';
17
- import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
18
- export { MAT_DIALOG_DATA as DIALOG_DATA } from '@angular/material/dialog';
19
19
  import * as i4 from '@angular/material/icon';
20
20
  import { MatIconModule } from '@angular/material/icon';
21
21
  import * as i4$1 from '@angular/material/progress-spinner';
@@ -10801,15 +10801,21 @@ class PraxisCrudComponent {
10801
10801
  if (this.tryRefreshMaterializedLocalData()) {
10802
10802
  return;
10803
10803
  }
10804
- this.table.refetch();
10804
+ this.table?.refetch?.();
10805
10805
  }
10806
10806
  resolveSurfaceRuntime() {
10807
10807
  const candidate = this.context?.['surfaceRuntime'];
10808
- if (!candidate || typeof candidate !== 'object') {
10808
+ if (candidate && typeof candidate === 'object') {
10809
+ const runtime = candidate;
10810
+ return typeof runtime.push === 'function' ? runtime : null;
10811
+ }
10812
+ if (this.injector.get(MatDialogRef, null)) {
10809
10813
  return null;
10810
10814
  }
10811
- const runtime = candidate;
10812
- return typeof runtime.push === 'function' ? runtime : null;
10815
+ const injectedRuntime = this.injector.get(SURFACE_DRAWER_REF, null);
10816
+ return injectedRuntime && typeof injectedRuntime.push === 'function'
10817
+ ? injectedRuntime
10818
+ : null;
10813
10819
  }
10814
10820
  tryRefreshMaterializedLocalData() {
10815
10821
  const readUrl = this.resolveMaterializedReadUrl();
@@ -11086,6 +11092,7 @@ class PraxisCrudComponent {
11086
11092
  ].join(':');
11087
11093
  let openPromise;
11088
11094
  try {
11095
+ const surfaceRuntime = this.resolveSurfaceRuntime();
11089
11096
  const surfaceContext = {
11090
11097
  sourceId: this.componentKeyId() || undefined,
11091
11098
  payload: { action: normalizedAction, row: row ?? null },
@@ -11097,11 +11104,13 @@ class PraxisCrudComponent {
11097
11104
  correlationId,
11098
11105
  },
11099
11106
  runtime: {
11107
+ injector: this.injector,
11100
11108
  row: row ?? null,
11101
11109
  item: row ?? null,
11102
11110
  state: {
11103
11111
  action: normalizedAction,
11104
11112
  resourcePath,
11113
+ ...(surfaceRuntime ? { surfaceRuntime } : {}),
11105
11114
  },
11106
11115
  ...(focusOrigin ? { focusOrigin } : {}),
11107
11116
  },
@@ -11254,6 +11263,7 @@ class PraxisCrudComponent {
11254
11263
  const focusOrigin = this.resolveRuntimeFocusOrigin(runtimeEvent);
11255
11264
  let openPromise;
11256
11265
  try {
11266
+ const surfaceRuntime = this.resolveSurfaceRuntime();
11257
11267
  openPromise = Promise.resolve(this.surfaceService.open(payload, {
11258
11268
  sourceId: this.componentKeyId() || undefined,
11259
11269
  payload: { action: normalizedAction, row: row ?? null },
@@ -11265,11 +11275,13 @@ class PraxisCrudComponent {
11265
11275
  correlationId,
11266
11276
  },
11267
11277
  runtime: {
11278
+ injector: this.injector,
11268
11279
  row: row ?? null,
11269
11280
  item: row ?? null,
11270
11281
  state: {
11271
11282
  action: normalizedAction,
11272
11283
  resourcePath,
11284
+ ...(surfaceRuntime ? { surfaceRuntime } : {}),
11273
11285
  },
11274
11286
  ...(focusOrigin ? { focusOrigin } : {}),
11275
11287
  },
@@ -11280,7 +11292,17 @@ class PraxisCrudComponent {
11280
11292
  return true;
11281
11293
  }
11282
11294
  try {
11283
- this.handleDiscoveredSurfaceResult(await openPromise);
11295
+ const openedRef = await openPromise;
11296
+ if (openedRef &&
11297
+ typeof openedRef === 'object' &&
11298
+ (typeof openedRef.afterClosed === 'function' ||
11299
+ typeof openedRef.result$?.subscribe === 'function' ||
11300
+ typeof openedRef.closed$?.subscribe === 'function')) {
11301
+ this.bindDiscoveredSurfaceLifecycle(openedRef);
11302
+ }
11303
+ else {
11304
+ this.handleDiscoveredSurfaceResult(openedRef);
11305
+ }
11284
11306
  this.afterOpen.emit({
11285
11307
  mode: this.mapSurfacePresentationToCrudMode(payload?.presentation),
11286
11308
  action,
@@ -11452,12 +11474,14 @@ class PraxisCrudComponent {
11452
11474
  handleDiscoveredSurfaceResult(result) {
11453
11475
  const data = (result?.data || {});
11454
11476
  const idField = this.getIdField();
11455
- if (result?.type === 'save') {
11477
+ const type = typeof result?.type === 'string' ? result.type.trim().toLowerCase() : '';
11478
+ if (type === 'save' ||
11479
+ (result?.kind === 'completed' && (!type || type === 'save'))) {
11456
11480
  const id = data?.[idField];
11457
11481
  this.afterSave.emit({ id, data });
11458
11482
  this.refreshTable();
11459
11483
  }
11460
- if (result?.type === 'delete') {
11484
+ if (type === 'delete') {
11461
11485
  const id = data?.[idField];
11462
11486
  this.afterDelete.emit({ id });
11463
11487
  this.refreshTable();
@@ -11469,9 +11493,33 @@ class PraxisCrudComponent {
11469
11493
  return;
11470
11494
  let terminalResultHandled = false;
11471
11495
  let closeHandled = false;
11496
+ const isCompletedSaveOrDelete = (candidate) => {
11497
+ if (!candidate || typeof candidate !== 'object') {
11498
+ return false;
11499
+ }
11500
+ const outcome = candidate;
11501
+ if (outcome.kind === 'dismissed' ||
11502
+ outcome.kind === 'notification' ||
11503
+ outcome.kind === 'failed') {
11504
+ return false;
11505
+ }
11506
+ const type = typeof outcome.type === 'string'
11507
+ ? outcome.type.trim().toLowerCase()
11508
+ : '';
11509
+ if (type === 'cancel' ||
11510
+ type === 'close' ||
11511
+ type === 'back' ||
11512
+ type === 'esc' ||
11513
+ type === 'backdrop') {
11514
+ return false;
11515
+ }
11516
+ if (outcome.kind === 'completed') {
11517
+ return !type || type === 'save' || type === 'delete';
11518
+ }
11519
+ return outcome.kind == null && (type === 'save' || type === 'delete');
11520
+ };
11472
11521
  const handleResult = (result) => {
11473
- const type = String(result?.type || '');
11474
- if (terminalResultHandled || (type !== 'save' && type !== 'delete'))
11522
+ if (terminalResultHandled || !isCompletedSaveOrDelete(result))
11475
11523
  return;
11476
11524
  terminalResultHandled = true;
11477
11525
  this.handleDiscoveredSurfaceResult(result);
@@ -12557,7 +12605,6 @@ class DynamicFormDialogHostComponent {
12557
12605
  dialogService;
12558
12606
  crud;
12559
12607
  configStorage;
12560
- surfaceRef;
12561
12608
  formComp;
12562
12609
  reactiveDeterminationExecuted = new EventEmitter();
12563
12610
  reactiveDeterminationPendingChange = new EventEmitter();
@@ -12615,13 +12662,15 @@ class DynamicFormDialogHostComponent {
12615
12662
  discardConfirm: 'Descartar',
12616
12663
  discardCancel: 'Cancelar',
12617
12664
  };
12618
- constructor(dialogRef, dialogData, dialogService, crud, configStorage, surfaceRef = null, surfaceContentData = null) {
12665
+ surfaceRef;
12666
+ constructor(dialogRef, dialogData, dialogService, crud, configStorage, injectedSurfaceRef = null, surfaceContentData = null) {
12619
12667
  this.dialogRef = dialogRef;
12620
12668
  this.dialogService = dialogService;
12621
12669
  this.crud = crud;
12622
12670
  this.configStorage = configStorage;
12623
- this.surfaceRef = surfaceRef;
12624
- this.data = dialogData ?? surfaceContentData?.['data'] ?? {};
12671
+ this.surfaceRef = this.dialogRef ? null : injectedSurfaceRef;
12672
+ this.data =
12673
+ dialogData ?? (this.surfaceRef ? surfaceContentData?.['data'] : undefined) ?? {};
12625
12674
  this.isSurfaceFrame = !!this.surfaceRef;
12626
12675
  if (!this.dialogRef && !this.surfaceRef) {
12627
12676
  throw new Error('DynamicFormDialogHostComponent requires a MatDialogRef or an active SurfaceDrawerRef.');
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@praxisui/crud",
3
- "version": "10.0.0-rc.26",
3
+ "version": "10.0.0-rc.28",
4
4
  "description": "CRUD building blocks for Praxis UI: integrates dynamic forms and tables with unified configuration and services.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/dynamic-form": "^10.0.0-rc.26",
9
- "@praxisui/table": "^10.0.0-rc.26",
10
- "@praxisui/core": "^10.0.0-rc.26",
11
- "@praxisui/dynamic-fields": "^10.0.0-rc.26",
12
- "@praxisui/settings-panel": "^10.0.0-rc.26",
8
+ "@praxisui/dynamic-form": "^10.0.0-rc.28",
9
+ "@praxisui/table": "^10.0.0-rc.28",
10
+ "@praxisui/core": "^10.0.0-rc.28",
11
+ "@praxisui/dynamic-fields": "^10.0.0-rc.28",
12
+ "@praxisui/settings-panel": "^10.0.0-rc.28",
13
13
  "@angular/cdk": "^21.0.0",
14
14
  "@angular/forms": "^21.0.0",
15
15
  "@angular/material": "^21.0.0",
16
16
  "@angular/router": "^21.0.0",
17
- "@praxisui/ai": "^10.0.0-rc.26",
17
+ "@praxisui/ai": "^10.0.0-rc.28",
18
18
  "rxjs": "~7.8.0"
19
19
  },
20
20
  "dependencies": {
@@ -610,7 +610,6 @@ declare class DynamicFormDialogHostComponent implements OnInit, AfterViewInit {
610
610
  private dialogService;
611
611
  private crud;
612
612
  private configStorage;
613
- private readonly surfaceRef;
614
613
  formComp?: PraxisDynamicForm;
615
614
  reactiveDeterminationExecuted: EventEmitter<ReactiveDeterminationExecutionEvent>;
616
615
  reactiveDeterminationPendingChange: EventEmitter<boolean>;
@@ -655,7 +654,8 @@ declare class DynamicFormDialogHostComponent implements OnInit, AfterViewInit {
655
654
  readonly isSurfaceFrame: boolean;
656
655
  readonly data: any;
657
656
  texts: Record<string, string>;
658
- constructor(dialogRef: DialogRef<DynamicFormDialogHostComponent> | null, dialogData: any, dialogService: DialogService, crud: GenericCrudService<any>, configStorage: AsyncConfigStorage, surfaceRef?: SurfaceDrawerRef | null, surfaceContentData?: Readonly<Record<string, unknown>> | null);
657
+ private readonly surfaceRef;
658
+ constructor(dialogRef: DialogRef<DynamicFormDialogHostComponent> | null, dialogData: any, dialogService: DialogService, crud: GenericCrudService<any>, configStorage: AsyncConfigStorage, injectedSurfaceRef?: SurfaceDrawerRef | null, surfaceContentData?: Readonly<Record<string, unknown>> | null);
659
659
  get resourceIdentityLabel(): string;
660
660
  get showContextIdentity(): boolean;
661
661
  private sameIdentity;