@masterteam/client-components 0.0.111 → 0.0.113
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/fesm2022/masterteam-client-components-client-instance-preview.mjs +50 -24
- package/fesm2022/masterteam-client-components-client-instance-preview.mjs.map +1 -1
- package/fesm2022/masterteam-client-components-client-list.mjs +111 -8
- package/fesm2022/masterteam-client-components-client-list.mjs.map +1 -1
- package/package.json +5 -5
- package/types/masterteam-client-components-client-instance-preview.d.ts +20 -1
- package/types/masterteam-client-components-client-list.d.ts +29 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterteam/client-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.113",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/client-components",
|
|
6
6
|
"linkDirectory": true,
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"tailwindcss": "^4.2.2",
|
|
18
18
|
"tailwindcss-primeui": "^0.6.1",
|
|
19
19
|
"@masterteam/forms": "^0.0.173",
|
|
20
|
-
"@masterteam/dashboard-builder": "^0.0.115",
|
|
21
20
|
"@masterteam/icons": "^0.0.17",
|
|
22
|
-
"@masterteam/components": "^0.0.
|
|
23
|
-
"@masterteam/
|
|
24
|
-
"@masterteam/data-table": "^0.0.
|
|
21
|
+
"@masterteam/components": "^0.0.339",
|
|
22
|
+
"@masterteam/dashboard-builder": "^0.0.115",
|
|
23
|
+
"@masterteam/data-table": "^0.0.8",
|
|
24
|
+
"@masterteam/data-grid": "^0.0.5"
|
|
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 { Observable } from 'rxjs';
|
|
3
4
|
import * as _masterteam_components_entities from '@masterteam/components/entities';
|
|
4
5
|
import { EntityRuntimeContext, EntityData, EntityViewType, EntityCalculationStatus } from '@masterteam/components/entities';
|
|
5
|
-
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
interface ClientInstancePreviewConfig {
|
|
8
8
|
contextKey: string;
|
|
@@ -26,6 +26,13 @@ interface ClientInstancePreviewConfig {
|
|
|
26
26
|
* fields without changing the fetched record or the saved display config.
|
|
27
27
|
*/
|
|
28
28
|
transformEntities?: ClientInstancePreviewEntityTransform;
|
|
29
|
+
/**
|
|
30
|
+
* Mark the values the backend calculates (an icon beside the label) and
|
|
31
|
+
* show how they moved since this kind of surface last read them. Off by
|
|
32
|
+
* default: only a host that follows the record's recalculation, such as
|
|
33
|
+
* the level workspace, has anything live to show.
|
|
34
|
+
*/
|
|
35
|
+
calculatedValues?: boolean;
|
|
29
36
|
}
|
|
30
37
|
type ClientInstancePreviewEntityTransform = (entities: EntityData[], response: PreviewResponse) => EntityData[];
|
|
31
38
|
interface Response<T> {
|
|
@@ -137,6 +144,7 @@ declare class ClientInstancePreview implements OnDestroy {
|
|
|
137
144
|
private readonly clientInstancePreviewApiService;
|
|
138
145
|
private readonly transloco;
|
|
139
146
|
private readonly runtimeContextStore;
|
|
147
|
+
private readonly calculationHistory;
|
|
140
148
|
private loadSub?;
|
|
141
149
|
readonly config: _angular_core.InputSignal<ClientInstancePreviewConfig>;
|
|
142
150
|
/** When true, suppresses the "No preview data" empty-state placeholder so the host can collapse. */
|
|
@@ -154,6 +162,11 @@ declare class ClientInstancePreview implements OnDestroy {
|
|
|
154
162
|
readonly error: _angular_core.WritableSignal<string | null>;
|
|
155
163
|
readonly response: _angular_core.WritableSignal<PreviewResponse | null>;
|
|
156
164
|
private readonly mappedEntities;
|
|
165
|
+
/**
|
|
166
|
+
* The `CalculatedValueHistory` scope of this preview: previews of a context
|
|
167
|
+
* compare with each other, never with a list's read of the same record.
|
|
168
|
+
*/
|
|
169
|
+
private readonly calculationScope;
|
|
157
170
|
readonly entities: _angular_core.Signal<EntityData[]>;
|
|
158
171
|
/**
|
|
159
172
|
* Name of the schema the loaded record belongs to — the level name for a
|
|
@@ -174,6 +187,12 @@ declare class ClientInstancePreview implements OnDestroy {
|
|
|
174
187
|
private readonly runtimeContext;
|
|
175
188
|
constructor();
|
|
176
189
|
load(config: ClientInstancePreviewConfig): void;
|
|
190
|
+
/**
|
|
191
|
+
* Refetches the record in place: the fields stay on screen, without the
|
|
192
|
+
* skeleton `load()` shows, and calculated values that moved say so. The
|
|
193
|
+
* caller subscribes and owns the errors.
|
|
194
|
+
*/
|
|
195
|
+
refresh(): Observable<PreviewResponse | null>;
|
|
177
196
|
ngOnDestroy(): void;
|
|
178
197
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientInstancePreview, never>;
|
|
179
198
|
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>;
|
|
@@ -266,6 +266,13 @@ interface ClientListFormConfiguration extends ClientListBaseConfiguration {
|
|
|
266
266
|
* {@link ClientListCardIndicatorsResolver}.
|
|
267
267
|
*/
|
|
268
268
|
cardIndicators?: ClientListCardIndicatorsResolver;
|
|
269
|
+
/**
|
|
270
|
+
* `areaType: 'table'` only — mark the cells the backend calculates and show
|
|
271
|
+
* how a number moved since a list of this context last read it. Cards never
|
|
272
|
+
* do. Off by default: only a host that follows the record's recalculation,
|
|
273
|
+
* such as the level workspace, has anything live to show.
|
|
274
|
+
*/
|
|
275
|
+
calculatedValues?: boolean;
|
|
269
276
|
/**
|
|
270
277
|
* `areaType: 'cards'` only — close the toolbar's filter drawer on a click
|
|
271
278
|
* outside it. Defaults to false (the drawer stays open until closed or
|
|
@@ -435,6 +442,8 @@ interface ClientListFetchPropertyMeta {
|
|
|
435
442
|
order: number;
|
|
436
443
|
isRequired?: boolean;
|
|
437
444
|
isSystem?: boolean;
|
|
445
|
+
isCalculated?: boolean;
|
|
446
|
+
calculationMethod?: string | null;
|
|
438
447
|
}
|
|
439
448
|
interface ClientListFetchValueCell {
|
|
440
449
|
raw: unknown;
|
|
@@ -777,6 +786,7 @@ interface NormalizedClientListConfiguration {
|
|
|
777
786
|
runtimeRecordActions?: ClientListRuntimeRecordActionsConfig;
|
|
778
787
|
transformResult?: ClientListTableTransform;
|
|
779
788
|
cardIndicators?: ClientListCardIndicatorsResolver;
|
|
789
|
+
calculatedValues?: boolean;
|
|
780
790
|
filterCloseOnOutsideClick?: boolean;
|
|
781
791
|
}
|
|
782
792
|
interface ClientListContentTemplateContext {
|
|
@@ -797,6 +807,7 @@ interface ClientListLazyLoadEvent {
|
|
|
797
807
|
|
|
798
808
|
declare class ClientListStateService {
|
|
799
809
|
private readonly transloco;
|
|
810
|
+
private readonly calculationHistory;
|
|
800
811
|
readonly itemsByKey: _angular_core.WritableSignal<Record<string, ClientListState>>;
|
|
801
812
|
readonly items: _angular_core.Signal<ClientListState[]>;
|
|
802
813
|
setConfigs(configs: ClientListState[]): void;
|
|
@@ -876,6 +887,11 @@ declare class ClientListStateService {
|
|
|
876
887
|
private orderRecords;
|
|
877
888
|
private resolvePrimarySchema;
|
|
878
889
|
private toEntityData;
|
|
890
|
+
/**
|
|
891
|
+
* Hands the calculated values just read to the session history, which notes
|
|
892
|
+
* those that moved since a list of this context last read them.
|
|
893
|
+
*/
|
|
894
|
+
private observeRows;
|
|
879
895
|
/** Active UI language for resolving localized display labels. */
|
|
880
896
|
private resolveActiveLang;
|
|
881
897
|
private createPropertyMaps;
|
|
@@ -889,6 +905,8 @@ declare class ClientListStateService {
|
|
|
889
905
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListStateService>;
|
|
890
906
|
}
|
|
891
907
|
|
|
908
|
+
/** Above this many changed records a background refresh reloads the page. */
|
|
909
|
+
declare const MAX_BACKGROUND_REFRESH_RECORDS = 10;
|
|
892
910
|
declare class ClientList implements OnDestroy {
|
|
893
911
|
private readonly api;
|
|
894
912
|
protected readonly state: ClientListStateService;
|
|
@@ -921,6 +939,8 @@ declare class ClientList implements OnDestroy {
|
|
|
921
939
|
private readonly requestPropertyKeys;
|
|
922
940
|
/** Single-record read-backs, kept apart from the page loads they must not cancel. */
|
|
923
941
|
private readonly recordSubscriptions;
|
|
942
|
+
/** Background refreshes from {@link refreshRecords}; several may overlap. */
|
|
943
|
+
private readonly refreshSubscriptions;
|
|
924
944
|
constructor();
|
|
925
945
|
onLazyLoad(itemKey: string, event: ClientListLazyLoadEvent): void;
|
|
926
946
|
/**
|
|
@@ -966,6 +986,14 @@ declare class ClientList implements OnDestroy {
|
|
|
966
986
|
* record, so an insert lands at the top of the page in view.
|
|
967
987
|
*/
|
|
968
988
|
applyWriteResult(itemKey: string, result: ClientListRecordWriteResult | null | undefined): void;
|
|
989
|
+
/**
|
|
990
|
+
* Reads records the backend changed on its own back into the list, without
|
|
991
|
+
* the loading state of a reload: values it recalculated after a save
|
|
992
|
+
* elsewhere. Only records the list already shows are read; a record it does
|
|
993
|
+
* not hold is not added. More than {@link MAX_BACKGROUND_REFRESH_RECORDS}
|
|
994
|
+
* records, or a hierarchy table, reload the page instead.
|
|
995
|
+
*/
|
|
996
|
+
refreshRecords(itemKey: string, recordIds: readonly number[]): void;
|
|
969
997
|
/**
|
|
970
998
|
* Drops a deleted record from the list in place. Falls back to a reload when
|
|
971
999
|
* the record is not part of the loaded set, so a stale list still corrects
|
|
@@ -1291,5 +1319,5 @@ declare class ClientListToolbarService {
|
|
|
1291
1319
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListToolbarService>;
|
|
1292
1320
|
}
|
|
1293
1321
|
|
|
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 };
|
|
1322
|
+
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
1323
|
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 };
|