@maro-tech/card 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maro-tech/card",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@panzoom/panzoom": "^4.6.2",
@@ -381,13 +381,41 @@ interface AuditFieldChange {
381
381
  value: unknown;
382
382
  display: string;
383
383
  url?: string;
384
+ structured?: StructuredItem[];
384
385
  };
385
386
  to: {
386
387
  value: unknown;
387
388
  display: string;
388
389
  url?: string;
390
+ structured?: StructuredItem[];
389
391
  };
390
392
  }
393
+ interface StructuredField {
394
+ key: string;
395
+ label: string;
396
+ value: unknown;
397
+ display: string;
398
+ }
399
+ interface StructuredItem {
400
+ key: string;
401
+ fields: StructuredField[];
402
+ }
403
+ interface HistoryFieldConfig {
404
+ label?: string;
405
+ type?: string;
406
+ data?: string;
407
+ link?: string;
408
+ displayMode?: 'text' | 'structured';
409
+ itemFields?: Record<string, {
410
+ label?: string;
411
+ data?: string;
412
+ }>;
413
+ }
414
+ interface HistoryConfig {
415
+ primaryEntity?: string;
416
+ entities?: Record<string, string>;
417
+ fields?: Record<string, HistoryFieldConfig>;
418
+ }
391
419
  interface AuditChange {
392
420
  action: string;
393
421
  entityId: string;
@@ -404,9 +432,8 @@ interface AuditOperation {
404
432
  }
405
433
  declare class HistoryTabComponent {
406
434
  readonly entity: _angular_core.InputSignal<string>;
407
- readonly primaryEntity: _angular_core.InputSignal<string>;
408
435
  readonly id: _angular_core.InputSignal<string>;
409
- readonly entityLabels: _angular_core.InputSignal<Record<string, string>>;
436
+ readonly config: _angular_core.InputSignal<HistoryConfig>;
410
437
  readonly operations: _angular_core.WritableSignal<AuditOperation[]>;
411
438
  readonly isLoading: _angular_core.WritableSignal<boolean>;
412
439
  readonly hasError: _angular_core.WritableSignal<boolean>;
@@ -420,13 +447,25 @@ declare class HistoryTabComponent {
420
447
  private readonly destroyRef;
421
448
  private readonly refreshSequence;
422
449
  private lastRequestKey;
450
+ private readonly dictionaryCache;
423
451
  constructor();
424
452
  private readonly loadEffect;
453
+ private prepareOperations;
454
+ private extractRawFields;
455
+ private getFieldConfig;
456
+ private toDisplayValue;
457
+ private resolveDisplay;
458
+ private resolveDictionary;
459
+ private toStructuredItems;
425
460
  toggleOperation(id: string): void;
426
461
  isExpanded(id: string): boolean;
427
462
  getEntityLabel(entityType: string): string;
428
463
  getActionLabel(action: string): string;
429
464
  isImageField(field: AuditFieldChange): boolean;
465
+ isStructuredField(field: AuditFieldChange): boolean;
466
+ getStructuredItems(value: {
467
+ structured?: StructuredItem[];
468
+ }): StructuredItem[];
430
469
  isHtmlField(field: AuditFieldChange): boolean;
431
470
  isFileField(field: AuditFieldChange): boolean;
432
471
  getImageUrls(value: unknown): string[];
@@ -436,7 +475,7 @@ declare class HistoryTabComponent {
436
475
  getPrimaryChanges(operation: AuditOperation): AuditChange[];
437
476
  getRelatedChanges(operation: AuditOperation): AuditChange[];
438
477
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<HistoryTabComponent, never>;
439
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<HistoryTabComponent, "app-history-tab", never, { "entity": { "alias": "entity"; "required": false; "isSignal": true; }; "primaryEntity": { "alias": "primaryEntity"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "entityLabels": { "alias": "entityLabels"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
478
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<HistoryTabComponent, "app-history-tab", never, { "entity": { "alias": "entity"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
440
479
  }
441
480
 
442
481
  declare class TableComponent implements OnChanges {
@@ -493,4 +532,4 @@ declare class TableComponent implements OnChanges {
493
532
  }
494
533
 
495
534
  export { CARD_ACTION_COMPLETED, CARD_ACTION_FINISHED, CARD_ACTION_REQUESTED, CARD_ACTION_STARTED, CardComponent, CardCurrentUserService, CardDictionaryService, CardImageService, CardSectionHeaderComponent, DocumentsComponent, ENTITY_UPDATED, HistoryTabComponent, ImagesViewerComponent, TableComponent, UI_CARD_API_BASE_URL, UI_CARD_TAB_REGISTRY, UI_ENTITY_CARD_HOST, UiEntityDocumentsService, cardApiParams, cardApiResourceUrl, normalizeCardConfig, resolveCardConfig };
496
- export type { ApiPluginConfig, ApiPluginMethod, CardAction, CardActionContext, CardActionLifecycleEvent, CardActionRequestedEvent, CardConfig, CardData, CardDictionarySuggestItem, CardField, CardPanelInput, CardSection, CardTab, EntityUpdatedEvent, UiCardLayout, UiCardLayoutInput, UiCardTabComponent, UiCardTabConfig, UiCardTabField, UiCardTabRegistration, UiEntityCardAction, UiEntityCardHost, UiEntityCardResponse, UiEntityCardTab, UiEntityDocumentFile, UiEntityDocumentRecognitionStatus };
535
+ export type { ApiPluginConfig, ApiPluginMethod, CardAction, CardActionContext, CardActionLifecycleEvent, CardActionRequestedEvent, CardConfig, CardData, CardDictionarySuggestItem, CardField, CardPanelInput, CardSection, CardTab, EntityUpdatedEvent, HistoryConfig, HistoryFieldConfig, UiCardLayout, UiCardLayoutInput, UiCardTabComponent, UiCardTabConfig, UiCardTabField, UiCardTabRegistration, UiEntityCardAction, UiEntityCardHost, UiEntityCardResponse, UiEntityCardTab, UiEntityDocumentFile, UiEntityDocumentRecognitionStatus };