@masterteam/client-components 0.0.110 → 0.0.112

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": "@masterteam/client-components",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/client-components",
6
6
  "linkDirectory": true,
@@ -16,12 +16,12 @@
16
16
  "rxjs": "^7.8.2",
17
17
  "tailwindcss": "^4.2.2",
18
18
  "tailwindcss-primeui": "^0.6.1",
19
- "@masterteam/components": "^0.0.337",
20
- "@masterteam/data-grid": "^0.0.4",
21
- "@masterteam/icons": "^0.0.17",
22
- "@masterteam/data-table": "^0.0.6",
23
19
  "@masterteam/dashboard-builder": "^0.0.115",
24
- "@masterteam/forms": "^0.0.173"
20
+ "@masterteam/data-table": "^0.0.8",
21
+ "@masterteam/forms": "^0.0.173",
22
+ "@masterteam/icons": "^0.0.17",
23
+ "@masterteam/data-grid": "^0.0.5",
24
+ "@masterteam/components": "^0.0.339"
25
25
  },
26
26
  "dependencies": {
27
27
  "tslib": "^2.8.1"
@@ -1,8 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { OnDestroy } from '@angular/core';
3
- import * as _masterteam_components_entities from '@masterteam/components/entities';
4
- import { EntityRuntimeContext, EntityData, EntityViewType } from '@masterteam/components/entities';
5
3
  import { Observable } from 'rxjs';
4
+ import * as _masterteam_components_entities from '@masterteam/components/entities';
5
+ import { EntityRuntimeContext, EntityData, EntityViewType, EntityCalculationStatus } from '@masterteam/components/entities';
6
6
 
7
7
  interface ClientInstancePreviewConfig {
8
8
  contextKey: string;
@@ -38,6 +38,11 @@ interface Response<T> {
38
38
  data: T;
39
39
  cacheSession?: string;
40
40
  }
41
+ /** Properties currently being recalculated; their calculated icon pulses. */
42
+ interface ClientInstancePreviewCalculation {
43
+ status: EntityCalculationStatus;
44
+ propertyKeys: readonly string[];
45
+ }
41
46
  interface PreviewFetchPropertyMeta {
42
47
  id: number;
43
48
  key: string;
@@ -132,6 +137,7 @@ declare class ClientInstancePreview implements OnDestroy {
132
137
  private readonly clientInstancePreviewApiService;
133
138
  private readonly transloco;
134
139
  private readonly runtimeContextStore;
140
+ private readonly calculationHistory;
135
141
  private loadSub?;
136
142
  readonly config: _angular_core.InputSignal<ClientInstancePreviewConfig>;
137
143
  /** When true, suppresses the "No preview data" empty-state placeholder so the host can collapse. */
@@ -143,9 +149,17 @@ declare class ClientInstancePreview implements OnDestroy {
143
149
  * honored instead. The hard ≤280px overflow stack always applies regardless.
144
150
  */
145
151
  readonly stackOnNarrow: _angular_core.InputSignal<boolean>;
152
+ /** Marks the listed properties as being recalculated, without refetching. */
153
+ readonly calculation: _angular_core.InputSignal<ClientInstancePreviewCalculation | null>;
146
154
  readonly loading: _angular_core.WritableSignal<boolean>;
147
155
  readonly error: _angular_core.WritableSignal<string | null>;
148
156
  readonly response: _angular_core.WritableSignal<PreviewResponse | null>;
157
+ private readonly mappedEntities;
158
+ /**
159
+ * The `CalculatedValueHistory` scope of this preview: previews of a context
160
+ * compare with each other, never with a list's read of the same record.
161
+ */
162
+ private readonly calculationScope;
149
163
  readonly entities: _angular_core.Signal<EntityData[]>;
150
164
  /**
151
165
  * Name of the schema the loaded record belongs to — the level name for a
@@ -166,9 +180,15 @@ declare class ClientInstancePreview implements OnDestroy {
166
180
  private readonly runtimeContext;
167
181
  constructor();
168
182
  load(config: ClientInstancePreviewConfig): void;
183
+ /**
184
+ * Refetches the record in place: the fields stay on screen, without the
185
+ * skeleton `load()` shows, and calculated values that moved say so. The
186
+ * caller subscribes and owns the errors.
187
+ */
188
+ refresh(): Observable<PreviewResponse | null>;
169
189
  ngOnDestroy(): void;
170
190
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientInstancePreview, never>;
171
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientInstancePreview, "mt-client-instance-preview", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "hideEmptyState": { "alias": "hideEmptyState"; "required": false; "isSignal": true; }; "stackOnNarrow": { "alias": "stackOnNarrow"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
191
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientInstancePreview, "mt-client-instance-preview", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "hideEmptyState": { "alias": "hideEmptyState"; "required": false; "isSignal": true; }; "stackOnNarrow": { "alias": "stackOnNarrow"; "required": false; "isSignal": true; }; "calculation": { "alias": "calculation"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
172
192
  }
173
193
 
174
194
  declare class ClientInstancePreviewApiService {
@@ -181,4 +201,4 @@ declare class ClientInstancePreviewApiService {
181
201
  }
182
202
 
183
203
  export { ClientInstancePreview, ClientInstancePreviewApiService };
184
- export type { ClientInstancePreviewConfig, ClientInstancePreviewEntityTransform, DisplayConfiguration, PreviewFetchCatalog, PreviewFetchContext, PreviewFetchPropertyMeta, PreviewFetchRecord, PreviewFetchRecordResponse, PreviewFetchSchema, PreviewFetchValueCell, PreviewResponse, Response };
204
+ export type { ClientInstancePreviewCalculation, ClientInstancePreviewConfig, ClientInstancePreviewEntityTransform, DisplayConfiguration, PreviewFetchCatalog, PreviewFetchContext, PreviewFetchPropertyMeta, PreviewFetchRecord, PreviewFetchRecordResponse, PreviewFetchSchema, PreviewFetchValueCell, PreviewResponse, Response };
@@ -435,6 +435,8 @@ interface ClientListFetchPropertyMeta {
435
435
  order: number;
436
436
  isRequired?: boolean;
437
437
  isSystem?: boolean;
438
+ isCalculated?: boolean;
439
+ calculationMethod?: string | null;
438
440
  }
439
441
  interface ClientListFetchValueCell {
440
442
  raw: unknown;
@@ -797,6 +799,7 @@ interface ClientListLazyLoadEvent {
797
799
 
798
800
  declare class ClientListStateService {
799
801
  private readonly transloco;
802
+ private readonly calculationHistory;
800
803
  readonly itemsByKey: _angular_core.WritableSignal<Record<string, ClientListState>>;
801
804
  readonly items: _angular_core.Signal<ClientListState[]>;
802
805
  setConfigs(configs: ClientListState[]): void;
@@ -876,6 +879,12 @@ declare class ClientListStateService {
876
879
  private orderRecords;
877
880
  private resolvePrimarySchema;
878
881
  private toEntityData;
882
+ /**
883
+ * Hands the calculated values just read to the session history, which notes
884
+ * those that moved since a list of this context last read them.
885
+ */
886
+ private observeRows;
887
+ private observeCards;
879
888
  /** Active UI language for resolving localized display labels. */
880
889
  private resolveActiveLang;
881
890
  private createPropertyMaps;
@@ -889,6 +898,8 @@ declare class ClientListStateService {
889
898
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListStateService>;
890
899
  }
891
900
 
901
+ /** Above this many changed records a background refresh reloads the page. */
902
+ declare const MAX_BACKGROUND_REFRESH_RECORDS = 10;
892
903
  declare class ClientList implements OnDestroy {
893
904
  private readonly api;
894
905
  protected readonly state: ClientListStateService;
@@ -921,6 +932,8 @@ declare class ClientList implements OnDestroy {
921
932
  private readonly requestPropertyKeys;
922
933
  /** Single-record read-backs, kept apart from the page loads they must not cancel. */
923
934
  private readonly recordSubscriptions;
935
+ /** Background refreshes from {@link refreshRecords}; several may overlap. */
936
+ private readonly refreshSubscriptions;
924
937
  constructor();
925
938
  onLazyLoad(itemKey: string, event: ClientListLazyLoadEvent): void;
926
939
  /**
@@ -966,6 +979,14 @@ declare class ClientList implements OnDestroy {
966
979
  * record, so an insert lands at the top of the page in view.
967
980
  */
968
981
  applyWriteResult(itemKey: string, result: ClientListRecordWriteResult | null | undefined): void;
982
+ /**
983
+ * Reads records the backend changed on its own back into the list, without
984
+ * the loading state of a reload: values it recalculated after a save
985
+ * elsewhere. Only records the list already shows are read; a record it does
986
+ * not hold is not added. More than {@link MAX_BACKGROUND_REFRESH_RECORDS}
987
+ * records, or a hierarchy table, reload the page instead.
988
+ */
989
+ refreshRecords(itemKey: string, recordIds: readonly number[]): void;
969
990
  /**
970
991
  * Drops a deleted record from the list in place. Falls back to a reload when
971
992
  * the record is not part of the loaded set, so a stale list still corrects
@@ -1291,5 +1312,5 @@ declare class ClientListToolbarService {
1291
1312
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListToolbarService>;
1292
1313
  }
1293
1314
 
1294
- export { CLIENT_LIST_DEFAULT_INCLUDE_STATE, CLIENT_LIST_RECORD_ID_FILTER_KEY, CLIENT_LIST_RECORD_SOURCE_KEY, CLIENT_LIST_RECORD_STATE_KEY, ClientList, ClientListApiService, ClientListRuntimeActionsService, ClientListStateService, ClientListToolbarService, defaultResolveRecordId, findClientListSourceGroup, findClientListTotal, isClientListTotalIncomplete, readClientListRowSource };
1315
+ export { CLIENT_LIST_DEFAULT_INCLUDE_STATE, CLIENT_LIST_RECORD_ID_FILTER_KEY, CLIENT_LIST_RECORD_SOURCE_KEY, CLIENT_LIST_RECORD_STATE_KEY, ClientList, ClientListApiService, ClientListRuntimeActionsService, ClientListStateService, ClientListToolbarService, MAX_BACKGROUND_REFRESH_RECORDS, defaultResolveRecordId, findClientListSourceGroup, findClientListTotal, isClientListTotalIncomplete, readClientListRowSource };
1295
1316
  export type { ClientListAreaType, ClientListBaseConfiguration, ClientListBaseState, ClientListCard, ClientListCardIndicator, ClientListCardIndicatorsResolver, ClientListCardModule, ClientListCardProperty, ClientListCardsPayload, ClientListCardsState, ClientListClickableItem, ClientListCollapseConfig, ClientListConfiguration, ClientListContentTemplateContext, ClientListDataLoadedHandler, ClientListFetchCardDisplayOrderItem, ClientListFetchCardGroup, ClientListFetchCatalog, ClientListFetchHierarchyScope, ClientListFetchProjection, ClientListFetchProjectionMeta, ClientListFetchPropertyMeta, ClientListFetchQueryRequest, ClientListFetchQueryResponse, ClientListFetchRecord, ClientListFetchRecordSource, ClientListFetchRecordState, ClientListFetchRequestDisplay, ClientListFetchRequestFilter, ClientListFetchSchema, ClientListFetchSourceGroup, ClientListFetchStateKey, ClientListFetchSum, ClientListFetchTableColumn, ClientListFetchValueCell, ClientListFormConfiguration, ClientListInformativeChartLink, ClientListInformativeConfiguration, ClientListInformativeDashboardPayload, ClientListInformativeSelectionFilterInjection, ClientListInformativeState, ClientListItemClickedEvent, ClientListLayoutConfig, ClientListLazyLoadEvent, ClientListMode, ClientListRecordEscalationState, ClientListRecordProjectionStatus, ClientListRecordWriteResult, ClientListReturnRecordRequest, ClientListRowsFetchResult, ClientListRuntimeContext, ClientListRuntimeRecordActionsConfig, ClientListRuntimeRecordActionsContext, ClientListState, ClientListTableDisplayConfig, ClientListTablePersistStateKey, ClientListTableQuery, ClientListTableSettingsCatalogResponse, ClientListTableSettingsColumn, ClientListTableState, ClientListTableTransform, ClientListTableTransformResult, ClientListToolbarBucket, ClientListToolbarDefaults, ClientListType, NormalizedClientListConfiguration, NormalizedClientListTableDisplayConfig, Response, RuntimeEntityColumnDef, RuntimeTableDisplayRow, RuntimeTableRowsResponse };