@praxisui/table 8.0.0-beta.7 → 8.0.0-beta.9

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.
@@ -23722,7 +23722,9 @@ const CONTROL_TYPE_LABELS = {
23722
23722
  [INLINE_SEARCHABLE_SELECT_CONTROL_TYPE$1]: 'Select buscável inline',
23723
23723
  [String(FieldControlType.ASYNC_SELECT).toLowerCase()]: 'Select assíncrono',
23724
23724
  [INLINE_ASYNC_SELECT_CONTROL_TYPE$1]: 'Select assíncrono inline',
23725
+ [String(FieldControlType.ENTITY_LOOKUP).toLowerCase()]: 'Lookup de entidade',
23725
23726
  [INLINE_ENTITY_LOOKUP_CONTROL_TYPE$1]: 'Lookup entidade inline',
23727
+ [normalizeControlTypeToken(INLINE_ENTITY_LOOKUP_CONTROL_TYPE$1)]: 'Lookup entidade inline',
23726
23728
  [String(FieldControlType.AUTO_COMPLETE).toLowerCase()]: 'Autocomplete',
23727
23729
  [INLINE_AUTOCOMPLETE_CONTROL_TYPE$1]: 'Autocomplete inline',
23728
23730
  [INLINE_NUMBER_CONTROL_TYPE$1]: 'Numérico inline',
@@ -24485,6 +24487,7 @@ class FilterSettingsComponent {
24485
24487
  const token = normalizeControlTypeToken(base);
24486
24488
  const searchableSelectToken = normalizeControlTypeToken(FieldControlType.SEARCHABLE_SELECT);
24487
24489
  const asyncSelectToken = normalizeControlTypeToken(FieldControlType.ASYNC_SELECT);
24490
+ const entityLookupToken = normalizeControlTypeToken(FieldControlType.ENTITY_LOOKUP);
24488
24491
  const autoCompleteToken = normalizeControlTypeToken(FieldControlType.AUTO_COMPLETE);
24489
24492
  const numericTextBoxToken = normalizeControlTypeToken(FieldControlType.NUMERIC_TEXT_BOX);
24490
24493
  const currencyToken = normalizeControlTypeToken(FieldControlType.CURRENCY_INPUT);
@@ -24590,6 +24593,9 @@ class FilterSettingsComponent {
24590
24593
  ? INLINE_ASYNC_SELECT_CONTROL_TYPE$1
24591
24594
  : String(FieldControlType.ASYNC_SELECT).toLowerCase();
24592
24595
  }
24596
+ if (token === entityLookupToken || token === 'entitylookup') {
24597
+ return INLINE_ENTITY_LOOKUP_CONTROL_TYPE$1;
24598
+ }
24593
24599
  if (token === autoCompleteToken || token === 'autocomplete') {
24594
24600
  return this.form.controls.useInlineSearchableSelectVariant.value
24595
24601
  ? INLINE_AUTOCOMPLETE_CONTROL_TYPE$1
@@ -33847,7 +33853,10 @@ class PraxisFilter {
33847
33853
  normalizedControlType === 'autocomplete' ||
33848
33854
  normalizedControlType === 'auto-complete' ||
33849
33855
  controlTypeToken === 'autocomplete';
33850
- const isEntityLookup = normalizedControlType === INLINE_ENTITY_LOOKUP_CONTROL_TYPE ||
33856
+ const isEntityLookup = controlType === FieldControlType.ENTITY_LOOKUP ||
33857
+ normalizedControlType === 'entitylookup' ||
33858
+ controlTypeToken === 'entitylookup' ||
33859
+ controlTypeToken === normalizeControlTypeToken(INLINE_ENTITY_LOOKUP_CONTROL_TYPE) ||
33851
33860
  meta?.entityLookup === true;
33852
33861
  const isNumeric = controlType === FieldControlType.NUMERIC_TEXT_BOX ||
33853
33862
  normalizedControlType === 'numerictextbox' ||
@@ -47274,12 +47283,22 @@ class PraxisTable {
47274
47283
  : configuredActionsRef
47275
47284
  .map((action) => this.decorateConfiguredRowAction(action, row))
47276
47285
  .filter((action) => !!action);
47277
- if (!actionCatalog) {
47278
- return configuredActions;
47286
+ if (canReuseConfiguredActionsDirectly) {
47287
+ return configuredActionsRef;
47279
47288
  }
47280
47289
  const normalizedConfiguredIds = new Set(configuredActions.map((action) => this.normalizeActionId(action)).filter(Boolean));
47290
+ const discoveredSurfaces = this.getDiscoveredRowSurfaceActionsFromSnapshot(capabilitySnapshot, normalizedConfiguredIds);
47291
+ discoveredSurfaces.forEach((action) => {
47292
+ const normalizedId = this.normalizeActionId(action);
47293
+ if (normalizedId) {
47294
+ normalizedConfiguredIds.add(normalizedId);
47295
+ }
47296
+ });
47297
+ if (!actionCatalog) {
47298
+ return [...configuredActions, ...discoveredSurfaces];
47299
+ }
47281
47300
  const discoveredActions = this.getDiscoveredRowWorkflowActionsFromCatalog(actionCatalog, normalizedConfiguredIds);
47282
- return [...configuredActions, ...discoveredActions];
47301
+ return [...configuredActions, ...discoveredSurfaces, ...discoveredActions];
47283
47302
  }
47284
47303
  splitVisibleRowActionsFromVisible(visible, display = this.getRowActionsDisplay()) {
47285
47304
  if (!visible.length) {
@@ -47320,6 +47339,25 @@ class PraxisTable {
47320
47339
  }
47321
47340
  return action;
47322
47341
  }
47342
+ const capabilitySnapshot = this.getCachedRowCapabilitySnapshot(row);
47343
+ const discoveredSurface = this.findItemSurface(capabilitySnapshot?.surfaces, normalizedId);
47344
+ if (discoveredSurface) {
47345
+ return {
47346
+ ...action,
47347
+ label: action.label || discoveredSurface.title || action.action,
47348
+ tooltip: action.tooltip
47349
+ || discoveredSurface.description
47350
+ || this.getUnavailableSurfaceMessage(discoveredSurface),
47351
+ color: action.color
47352
+ || (discoveredSurface.availability?.allowed === false
47353
+ ? 'warn'
47354
+ : this.getDiscoveredSurfaceColor(discoveredSurface)),
47355
+ disabled: typeof action.disabled === 'boolean'
47356
+ ? action.disabled
47357
+ : discoveredSurface.availability?.allowed === false,
47358
+ __praxisDiscoveredSurface: discoveredSurface,
47359
+ };
47360
+ }
47323
47361
  const hasResolvedCatalog = this.hasResolvedRowActionCatalog(row);
47324
47362
  const catalog = this.getCachedRowActionCatalog(row);
47325
47363
  if (!hasResolvedCatalog || !catalog) {
@@ -47350,6 +47388,25 @@ class PraxisTable {
47350
47388
  }
47351
47389
  return this.getDiscoveredRowWorkflowActionsFromCatalog(catalog, normalizedConfiguredIds);
47352
47390
  }
47391
+ getDiscoveredRowSurfaceActionsFromSnapshot(snapshot, normalizedConfiguredIds) {
47392
+ return (snapshot?.surfaces || [])
47393
+ .filter((surface) => surface.scope === 'ITEM')
47394
+ .filter((surface) => this.isRowSurfaceAction(surface))
47395
+ .sort((left, right) => (left.order ?? 0) - (right.order ?? 0))
47396
+ .filter((surface) => !normalizedConfiguredIds.has(this.normalizeActionId(surface)))
47397
+ .map((surface) => ({
47398
+ id: surface.id,
47399
+ action: surface.id,
47400
+ label: surface.title || surface.id,
47401
+ icon: this.getDiscoveredSurfaceIcon(surface),
47402
+ color: surface.availability?.allowed === false
47403
+ ? 'warn'
47404
+ : this.getDiscoveredSurfaceColor(surface),
47405
+ tooltip: surface.description || this.getUnavailableSurfaceMessage(surface),
47406
+ disabled: surface.availability?.allowed === false,
47407
+ __praxisDiscoveredSurface: surface,
47408
+ }));
47409
+ }
47353
47410
  getDiscoveredRowWorkflowActionsFromCatalog(catalog, normalizedConfiguredIds) {
47354
47411
  return (catalog.actions || [])
47355
47412
  .filter((action) => action.scope === 'ITEM')
@@ -47387,12 +47444,41 @@ class PraxisTable {
47387
47444
  }
47388
47445
  return (actions.find((action) => action.scope === 'ITEM' && this.normalizeActionId(action) === normalizedId) || null);
47389
47446
  }
47447
+ findItemSurface(surfaces, normalizedId) {
47448
+ if (!Array.isArray(surfaces) || !surfaces.length) {
47449
+ return null;
47450
+ }
47451
+ return (surfaces.find((surface) => surface.scope === 'ITEM'
47452
+ && this.isRowSurfaceAction(surface)
47453
+ && this.normalizeActionId(surface) === normalizedId) || null);
47454
+ }
47455
+ isRowSurfaceAction(surface) {
47456
+ return this.isWritableRowSurface(surface) || this.isReadableRowSurface(surface);
47457
+ }
47458
+ isWritableRowSurface(surface) {
47459
+ return surface.kind === 'FORM' || surface.kind === 'PARTIAL_FORM';
47460
+ }
47461
+ isReadableRowSurface(surface) {
47462
+ return surface.kind === 'VIEW' || surface.kind === 'READ_PROJECTION';
47463
+ }
47464
+ getDiscoveredSurfaceIcon(surface) {
47465
+ return this.isReadableRowSurface(surface) ? 'visibility' : 'edit_note';
47466
+ }
47467
+ getDiscoveredSurfaceColor(surface) {
47468
+ return this.isReadableRowSurface(surface) ? 'accent' : 'primary';
47469
+ }
47390
47470
  getUnavailableWorkflowMessage(action) {
47391
47471
  if (action.availability?.allowed !== false) {
47392
47472
  return undefined;
47393
47473
  }
47394
47474
  return translateUnavailableWorkflowMessage(this.i18n, action.availability);
47395
47475
  }
47476
+ getUnavailableSurfaceMessage(surface) {
47477
+ if (surface.availability?.allowed !== false) {
47478
+ return undefined;
47479
+ }
47480
+ return translateUnavailableWorkflowMessage(this.i18n, surface.availability);
47481
+ }
47396
47482
  normalizeActionId(action) {
47397
47483
  return String(action?.action || action?.id || '').trim().toLowerCase();
47398
47484
  }
@@ -47420,6 +47506,9 @@ class PraxisTable {
47420
47506
  if (action.__praxisDiscoveredAction?.availability?.allowed === false) {
47421
47507
  return true;
47422
47508
  }
47509
+ if (action.__praxisDiscoveredSurface?.availability?.allowed === false) {
47510
+ return true;
47511
+ }
47423
47512
  if (typeof action.disabled === 'boolean')
47424
47513
  return action.disabled;
47425
47514
  const disabledWhen = action.disabledWhen;
@@ -47441,10 +47530,15 @@ class PraxisTable {
47441
47530
  actionConfig: action.__praxisDiscoveredAction,
47442
47531
  }, action);
47443
47532
  }
47533
+ if (action.__praxisDiscoveredSurface) {
47534
+ return this.resolveRowActionRuntimeOptions({
47535
+ actionConfig: action.__praxisDiscoveredSurface,
47536
+ }, action);
47537
+ }
47444
47538
  return this.resolveRowActionRuntimeOptions(undefined, action);
47445
47539
  }
47446
47540
  isWorkflowRowAction(action) {
47447
- return !!action?.__praxisDiscoveredAction;
47541
+ return !!action?.__praxisDiscoveredAction || !!action?.__praxisDiscoveredSurface;
47448
47542
  }
47449
47543
  isBlockedWorkflowRowAction(action, row) {
47450
47544
  return this.isWorkflowRowAction(action) && this.isActionDisabled(action, row);
@@ -47455,7 +47549,9 @@ class PraxisTable {
47455
47549
  }
47456
47550
  const disabledReason = action.__praxisDiscoveredAction
47457
47551
  ? this.getUnavailableWorkflowMessage(action.__praxisDiscoveredAction)
47458
- : undefined;
47552
+ : action.__praxisDiscoveredSurface
47553
+ ? this.getUnavailableSurfaceMessage(action.__praxisDiscoveredSurface)
47554
+ : undefined;
47459
47555
  const tooltip = String(disabledReason
47460
47556
  || action.tooltip
47461
47557
  || action.label
package/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { CdkDragDrop, CdkDragEnd, CdkDrag, CdkDropList } from '@angular/cdk/drag
10
10
  import { BehaviorSubject, Subscription, Observable } from 'rxjs';
11
11
  import { SettingsPanelService, SettingsValueProvider } from '@praxisui/settings-panel';
12
12
  import * as _praxisui_core from '@praxisui/core';
13
- import { TableConfig, LoggerService, PraxisI18nService, GlobalConfigService, AsyncConfigStorage, FieldMetadata, SchemaIdParams, FormConfig, GenericCrudService, DynamicFormService, SchemaNormalizerService, ComponentKeyService, ComponentDocMeta, LoadingState, RestApiLinks, ColumnDefinition, RichBlockNode, ConnectionStorage, ResourceDiscoveryService, LoadingOrchestrator, PraxisLoadingRenderer, TableDetailRichListNode, TableDetailCardGridNode, TableDetailCardGridCardNode, TableDetailTimelineNode, JsonLogicDataRecord, TableDetailListItemAction, TableDetailActionBarNode, TableDetailActionBarAction, TableDetailRefNode, TableDetailTemplateRefNode, TableDetailDiagramEmbedNode, TableDetailEmbedAction, ResourceActionCatalogItem, JsonLogicExpression, GlobalActionSpec, IconPickerService, SurfaceOpenPayload, GlobalActionField, FieldDefinition, PraxisJsonLogicService, TableConfigService, PraxisTextValue, PraxisAnalyticsProjection, PraxisDataQueryContext, ApiUrlConfig, AnalyticsSchemaContractService, AnalyticsPresentationResolver, RichPresenterNode, RichComposeNode, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
13
+ import { TableConfig, LoggerService, PraxisI18nService, GlobalConfigService, AsyncConfigStorage, FieldMetadata, SchemaIdParams, FormConfig, GenericCrudService, DynamicFormService, SchemaNormalizerService, ComponentKeyService, ComponentDocMeta, LoadingState, RestApiLinks, ColumnDefinition, RichBlockNode, ConnectionStorage, ResourceDiscoveryService, LoadingOrchestrator, PraxisLoadingRenderer, TableDetailRichListNode, TableDetailCardGridNode, TableDetailCardGridCardNode, TableDetailTimelineNode, JsonLogicDataRecord, TableDetailListItemAction, TableDetailActionBarNode, TableDetailActionBarAction, TableDetailRefNode, TableDetailTemplateRefNode, TableDetailDiagramEmbedNode, TableDetailEmbedAction, ResourceActionCatalogItem, ResourceSurfaceCatalogItem, JsonLogicExpression, GlobalActionSpec, IconPickerService, SurfaceOpenPayload, GlobalActionField, FieldDefinition, PraxisJsonLogicService, TableConfigService, PraxisTextValue, PraxisAnalyticsProjection, PraxisDataQueryContext, ApiUrlConfig, AnalyticsSchemaContractService, AnalyticsPresentationResolver, RichPresenterNode, RichComposeNode, AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
14
14
  import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
15
15
  import { MatDialog } from '@angular/material/dialog';
16
16
  import { CdkOverlayOrigin, ConnectedPosition } from '@angular/cdk/overlay';
@@ -842,6 +842,7 @@ type RuntimeRowAction = {
842
842
  disabled?: boolean;
843
843
  overflow?: boolean;
844
844
  __praxisDiscoveredAction?: ResourceActionCatalogItem;
845
+ __praxisDiscoveredSurface?: ResourceSurfaceCatalogItem;
845
846
  __praxisCapabilityDenied?: boolean;
846
847
  };
847
848
  type ExpansionDetailRuntimeStatus = 'idle' | 'loading' | 'ready' | 'error' | 'blocked';
@@ -1811,11 +1812,19 @@ declare class PraxisTable implements OnInit, OnChanges, AfterViewInit, AfterCont
1811
1812
  private splitVisibleRowActionsFromVisible;
1812
1813
  private decorateConfiguredRowAction;
1813
1814
  private getDiscoveredRowWorkflowActions;
1815
+ private getDiscoveredRowSurfaceActionsFromSnapshot;
1814
1816
  private getDiscoveredRowWorkflowActionsFromCatalog;
1815
1817
  private supportsRowCrudAction;
1816
1818
  private isCapabilityManagedCrudRowAction;
1817
1819
  private findItemWorkflowAction;
1820
+ private findItemSurface;
1821
+ private isRowSurfaceAction;
1822
+ private isWritableRowSurface;
1823
+ private isReadableRowSurface;
1824
+ private getDiscoveredSurfaceIcon;
1825
+ private getDiscoveredSurfaceColor;
1818
1826
  private getUnavailableWorkflowMessage;
1827
+ private getUnavailableSurfaceMessage;
1819
1828
  private normalizeActionId;
1820
1829
  private isActionVisible;
1821
1830
  trackAction(index: number, item: any): any;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@praxisui/table",
3
- "version": "8.0.0-beta.7",
3
+ "version": "8.0.0-beta.9",
4
4
  "description": "Advanced data table for Angular (Praxis UI) with editing, filtering, sorting, virtualization, and settings panel integration.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
- "@praxisui/ai": "^8.0.0-beta.7",
9
- "@praxisui/core": "^8.0.0-beta.7",
10
- "@praxisui/dynamic-fields": "^8.0.0-beta.7",
11
- "@praxisui/dynamic-form": "^8.0.0-beta.7",
12
- "@praxisui/metadata-editor": "^8.0.0-beta.7",
13
- "@praxisui/rich-content": "^8.0.0-beta.7",
14
- "@praxisui/settings-panel": "^8.0.0-beta.7",
15
- "@praxisui/table-rule-builder": "^8.0.0-beta.7"
8
+ "@praxisui/ai": "^8.0.0-beta.9",
9
+ "@praxisui/core": "^8.0.0-beta.9",
10
+ "@praxisui/dynamic-fields": "^8.0.0-beta.9",
11
+ "@praxisui/dynamic-form": "^8.0.0-beta.9",
12
+ "@praxisui/metadata-editor": "^8.0.0-beta.9",
13
+ "@praxisui/rich-content": "^8.0.0-beta.9",
14
+ "@praxisui/settings-panel": "^8.0.0-beta.9",
15
+ "@praxisui/table-rule-builder": "^8.0.0-beta.9"
16
16
  },
17
17
  "dependencies": {
18
18
  "tslib": "^2.3.0"