@masterteam/client-components 0.0.9 → 0.0.10

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.
@@ -18,19 +18,11 @@ interface Response<T> {
18
18
  data: T;
19
19
  cacheSession?: string;
20
20
  }
21
- interface ClientListConfiguration {
21
+ type ClientListRuntimeContext = string;
22
+ interface ClientListBaseConfiguration {
22
23
  key?: string;
23
- levelId?: number;
24
- levelDataId?: number;
25
- moduleId?: number;
26
24
  title?: string;
27
25
  showHeader?: boolean;
28
- type?: ClientListType;
29
- areaType?: ClientListAreaType;
30
- mode?: ClientListMode;
31
- columnKeys?: string[];
32
- isPaginated?: boolean;
33
- take?: number;
34
26
  collapse?: ClientListCollapseConfig;
35
27
  layout?: ClientListLayoutConfig;
36
28
  headerStart?: TemplateRef<ClientListContentTemplateContext>;
@@ -41,6 +33,22 @@ interface ClientListConfiguration {
41
33
  rowActions?: TableAction[];
42
34
  dataLoaded?: ClientListDataLoadedHandler;
43
35
  }
36
+ interface ClientListFormConfiguration extends ClientListBaseConfiguration {
37
+ type?: 'form';
38
+ areaType?: ClientListAreaType;
39
+ contextKey: ClientListRuntimeContext;
40
+ instanceId?: number;
41
+ mode?: ClientListMode;
42
+ columnKeys?: string[];
43
+ isPaginated?: boolean;
44
+ take?: number;
45
+ }
46
+ interface ClientListInformativeConfiguration extends ClientListBaseConfiguration {
47
+ type: 'informative';
48
+ moduleId: number;
49
+ areaType?: 'table';
50
+ }
51
+ type ClientListConfiguration = ClientListFormConfiguration | ClientListInformativeConfiguration;
44
52
  interface ClientListCollapseConfig {
45
53
  enabled?: boolean;
46
54
  expandedByDefault?: boolean;
@@ -58,100 +66,134 @@ interface ClientListTableQuery {
58
66
  skip: number;
59
67
  take: number;
60
68
  }
61
- interface RuntimeTableColumn {
62
- columnKey: string;
63
- sourceType: string;
64
- order: number;
65
- isVisible: boolean;
66
- id?: number;
67
- propertyId?: number;
69
+ type ClientListFetchProjection = 'Card' | 'Table';
70
+ interface ClientListFetchRequestFilter {
71
+ key: string;
72
+ operator: 'Equals';
73
+ value: string;
74
+ }
75
+ interface ClientListFetchRequestDisplay {
76
+ areas: string[];
77
+ }
78
+ interface ClientListFetchQueryRequest {
79
+ contextKey: string;
80
+ projection: ClientListFetchProjection;
81
+ propertyKeys?: string[];
82
+ filters?: ClientListFetchRequestFilter[];
83
+ page?: number;
84
+ pageSize?: number;
85
+ surfaceKey?: string;
86
+ display?: ClientListFetchRequestDisplay;
87
+ }
88
+ interface ClientListTableSettingsColumn {
68
89
  key?: string;
69
- normalizedKey?: string;
70
- name?: string;
71
- viewType?: string;
72
- configuration?: string;
73
- type?: string;
90
+ propertyKey?: string;
91
+ order?: number;
92
+ visible?: boolean;
74
93
  }
75
- /** Raw row as returned by the API, flat object keyed by column keys */
76
- type RuntimeTableApiRow = Record<string, unknown>;
77
- /** A single cell value enriched with its column metadata */
78
- interface RuntimeTableCell extends RuntimeTableColumn {
79
- value: unknown;
94
+ interface ClientListTableSettingsCatalogResponse {
95
+ effectiveColumns?: Array<ClientListTableSettingsColumn | string>;
80
96
  }
81
- /** Display row: Id stays plain, every other key holds a RuntimeTableCell */
82
- type RuntimeTableDisplayRow = Record<string, unknown | RuntimeTableCell>;
83
- /** Column definition extended with full runtime column metadata and forced entity type */
84
- interface RuntimeEntityColumnDef extends ColumnDef, Omit<RuntimeTableColumn, 'type'> {
97
+ interface ClientListFetchPropertyMeta {
98
+ id: number;
85
99
  key: string;
100
+ normalizedKey: string;
86
101
  label: string;
87
- /** Original API column type (e.g. CustomProperty) preserved as runtimeType */
88
- runtimeType?: RuntimeTableColumn['type'];
89
- type: 'entity';
102
+ viewType: string;
103
+ configuration: Record<string, unknown> | null;
104
+ source?: string;
105
+ order: number;
106
+ isRequired?: boolean;
107
+ isSystem?: boolean;
90
108
  }
91
- interface RuntimeTablePagination {
92
- skip: number;
93
- take: number;
94
- totalCount: number;
109
+ interface ClientListFetchValueCell {
110
+ raw: unknown;
111
+ value: unknown;
112
+ display?: string | null;
113
+ [key: string]: unknown;
95
114
  }
96
- interface RuntimeTableRowsResponse {
97
- levelId: number;
98
- levelDataId: number;
99
- moduleId: number;
100
- moduleKey: string;
101
- surfaceKey: string;
102
- columns: RuntimeTableColumn[];
103
- rows: RuntimeTableApiRow[];
104
- pagination: RuntimeTablePagination;
115
+ interface ClientListFetchRecord {
116
+ id: number;
117
+ name?: string;
118
+ schemaId?: number;
119
+ values: Record<string, ClientListFetchValueCell>;
105
120
  }
106
- interface ClientListCardModule {
121
+ interface ClientListFetchSchema {
107
122
  id: number;
108
- key?: string;
123
+ key: string;
109
124
  name: string;
110
125
  order?: number;
111
126
  typeGroup?: string;
112
127
  }
113
- interface ClientListCardProperty {
114
- id?: number;
115
- propertyId?: number;
128
+ interface ClientListFetchCatalog {
129
+ properties: ClientListFetchPropertyMeta[];
130
+ }
131
+ interface ClientListFetchTableColumn {
116
132
  key: string;
117
- normalizedKey: string;
133
+ label: string;
134
+ viewType: string;
135
+ order: number;
136
+ visible: boolean;
137
+ configuration: Record<string, unknown> | null;
138
+ }
139
+ interface ClientListFetchCardDisplayOrderItem {
140
+ contextKey: string;
141
+ areaKey: string;
142
+ propertyKey: string;
143
+ order: number;
144
+ configuration?: EntityConfiguration | null;
145
+ }
146
+ interface ClientListFetchCardGroup {
147
+ schemaId: number;
148
+ recordIds: number[];
149
+ }
150
+ interface ClientListFetchProjectionMeta {
151
+ kind: string;
152
+ columns?: ClientListFetchTableColumn[];
153
+ displayOrder?: ClientListFetchCardDisplayOrderItem[];
154
+ groups?: ClientListFetchCardGroup[];
155
+ }
156
+ interface ClientListFetchQueryResponse {
157
+ contextKey: string;
158
+ schemas?: ClientListFetchSchema[];
159
+ catalog?: ClientListFetchCatalog;
160
+ records?: ClientListFetchRecord[];
161
+ pagination?: {
162
+ page: number;
163
+ pageSize: number;
164
+ totalCount: number;
165
+ };
166
+ projectionMeta?: ClientListFetchProjectionMeta;
167
+ }
168
+ interface RuntimeEntityColumnDef extends ColumnDef {
169
+ key: string;
170
+ label: string;
171
+ type: 'entity';
172
+ viewType?: string;
173
+ order?: number;
174
+ visible?: boolean;
175
+ configuration?: Record<string, unknown> | null;
176
+ }
177
+ type RuntimeTableDisplayRow = Record<string, unknown | EntityData>;
178
+ type RuntimeTableRowsResponse = ClientListFetchQueryResponse;
179
+ interface ClientListCardModule {
180
+ id: number;
181
+ key?: string;
118
182
  name: string;
119
- rawValue?: string;
120
- value: EntityData['value'];
121
- viewType: EntityData['viewType'];
122
- configuration?: Record<string, unknown>;
123
- type?: string;
124
- [key: string]: unknown;
183
+ order?: number;
184
+ typeGroup?: string;
125
185
  }
186
+ type ClientListCardProperty = EntityData;
126
187
  interface ClientListCard {
127
188
  id: number;
128
189
  name: string;
129
190
  module?: ClientListCardModule;
130
- levelDataId?: number;
191
+ instanceId?: number;
131
192
  properties: ClientListCardProperty[];
132
193
  displayProperties?: Record<string, unknown>;
133
194
  entities: EntityData[];
134
195
  }
135
- interface ClientListCardDisplayProperty {
136
- propertyKey: string;
137
- areaKey: string;
138
- order: number;
139
- configuration: EntityConfiguration;
140
- }
141
- interface ClientListCardDisplayConfiguration {
142
- contextKey: string;
143
- moduleId?: number;
144
- levelId?: number;
145
- properties: ClientListCardDisplayProperty[];
146
- }
147
- interface ClientListCardsDetailsBlock {
148
- module?: ClientListCardModule;
149
- data: Omit<ClientListCard, 'entities'>[];
150
- }
151
- interface ClientListCardsPayload {
152
- details?: ClientListCardsDetailsBlock[];
153
- displayConfigurations?: ClientListCardDisplayConfiguration[];
154
- }
196
+ type ClientListCardsPayload = ClientListFetchQueryResponse;
155
197
  interface ClientListInformativeChartLink {
156
198
  id?: number;
157
199
  chartComponentId?: string;
@@ -198,9 +240,16 @@ interface ClientListInformativeState extends ClientListBaseState {
198
240
  areaType: 'table';
199
241
  }
200
242
  type ClientListState = ClientListTableState | ClientListCardsState | ClientListInformativeState;
243
+ type ClientListClickableItem = RuntimeTableDisplayRow | ClientListCard;
244
+ interface ClientListItemClickedEvent {
245
+ key: string;
246
+ areaType: 'table' | 'cards';
247
+ item: ClientListClickableItem;
248
+ state: ClientListState;
249
+ }
201
250
  interface NormalizedClientListConfiguration {
202
- levelId: number;
203
- levelDataId: number;
251
+ contextKey: ClientListRuntimeContext | null;
252
+ instanceId: number | null;
204
253
  moduleId: number;
205
254
  type: ClientListType;
206
255
  areaType: ClientListAreaType;
@@ -246,21 +295,10 @@ declare class ClientListStateService {
246
295
  setInformativeResult(key: string, response: ClientListInformativeDashboardPayload | null, config: NormalizedClientListConfiguration): void;
247
296
  toggleExpanded(key: string): void;
248
297
  private mergeItemState;
249
- private getVisibleColumns;
250
- private toColumnDefs;
251
- /**
252
- * Enriches each flat API row so that every cell value becomes a
253
- * RuntimeTableCell carrying both the original value and the full
254
- * column metadata. The `Id` key is preserved as-is.
255
- */
256
- private toDisplayRows;
257
- private toCell;
258
298
  private toCards;
299
+ private orderRecords;
300
+ private toEntityData;
259
301
  private toDashboardData;
260
- private buildDisplayConfigurationLookup;
261
- private mapEntities;
262
- private getPropertyConfiguration;
263
- private toLabel;
264
302
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientListStateService, never>;
265
303
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListStateService>;
266
304
  }
@@ -275,6 +313,7 @@ declare class ClientList implements OnDestroy {
275
313
  key: string;
276
314
  message: string;
277
315
  }>;
316
+ readonly itemClicked: _angular_core.OutputEmitterRef<ClientListItemClickedEvent>;
278
317
  protected readonly items: _angular_core.Signal<ClientListState[]>;
279
318
  private readonly subscriptions;
280
319
  private readonly inFlightRequestSignatures;
@@ -284,6 +323,8 @@ declare class ClientList implements OnDestroy {
284
323
  reload(itemKey?: string): void;
285
324
  reloadByKey(itemKey: string): void;
286
325
  toggleExpanded(key: string): void;
326
+ onTableRowClick(item: ClientListState, row: RuntimeTableDisplayRow): void;
327
+ onCardClick(item: ClientListState, card: ClientListCard): void;
287
328
  templateContext(item: ClientListState): ClientListContentTemplateContext;
288
329
  defaultTitle(item: ClientListState): string;
289
330
  ngOnDestroy(): void;
@@ -296,6 +337,7 @@ declare class ClientList implements OnDestroy {
296
337
  private resolveType;
297
338
  private resolveMode;
298
339
  private toNormalizedConfig;
340
+ private createItemKey;
299
341
  private resolveLayout;
300
342
  private clampSpan;
301
343
  private cleanupStaleResources;
@@ -306,21 +348,30 @@ declare class ClientList implements OnDestroy {
306
348
  private createInformativeRequestSignature;
307
349
  private hasValidIdentifiers;
308
350
  private getMissingIdentifiersMessage;
351
+ private isInformativeConfig;
352
+ private asInformativeConfig;
353
+ private asFormConfig;
309
354
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientList, never>;
310
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientList, "mt-client-list", never, { "configurations": { "alias": "configurations"; "required": true; "isSignal": true; }; "defaultTake": { "alias": "defaultTake"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "errored": "errored"; }, never, never, true, never>;
355
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientList, "mt-client-list", never, { "configurations": { "alias": "configurations"; "required": true; "isSignal": true; }; "defaultTake": { "alias": "defaultTake"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "errored": "errored"; "itemClicked": "itemClicked"; }, never, never, true, never>;
311
356
  }
312
357
 
313
358
  declare class ClientListApiService {
314
359
  private readonly http;
315
- private readonly tablesBaseUrl;
316
- private readonly cardsBaseUrl;
360
+ private readonly runtimeFetchBaseUrl;
361
+ private readonly tableSettingsBaseUrl;
317
362
  private readonly informativeBaseUrl;
318
- getRows(levelId: number, levelDataId: number, moduleId: number, query: ClientListTableQuery): Observable<Response<RuntimeTableRowsResponse>>;
319
- getCards(levelDataId: number, moduleId: number): Observable<Response<ClientListCardsPayload>>;
363
+ getRows(contextKey: ClientListRuntimeContext, instanceId: number, query: ClientListTableQuery): Observable<Response<RuntimeTableRowsResponse>>;
364
+ getCards(contextKey: ClientListRuntimeContext, instanceId?: number | null): Observable<Response<ClientListCardsPayload>>;
320
365
  getInformativeDashboard(moduleId: number): Observable<Response<ClientListInformativeDashboardPayload>>;
366
+ private queryRuntime;
367
+ private resolveTablePropertyKeys;
368
+ private buildInstanceFilters;
369
+ private toPage;
370
+ private toEffectiveColumnKeys;
371
+ private readTableSettingsContext;
321
372
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientListApiService, never>;
322
373
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListApiService>;
323
374
  }
324
375
 
325
376
  export { ClientList, ClientListApiService, ClientListStateService };
326
- export type { ClientListAreaType, ClientListBaseState, ClientListCard, ClientListCardDisplayConfiguration, ClientListCardDisplayProperty, ClientListCardModule, ClientListCardProperty, ClientListCardsDetailsBlock, ClientListCardsPayload, ClientListCardsState, ClientListCollapseConfig, ClientListConfiguration, ClientListContentTemplateContext, ClientListDataLoadedHandler, ClientListInformativeChartLink, ClientListInformativeDashboardPayload, ClientListInformativeState, ClientListLayoutConfig, ClientListLazyLoadEvent, ClientListMode, ClientListState, ClientListTableQuery, ClientListTableState, ClientListType, NormalizedClientListConfiguration, Response, RuntimeEntityColumnDef, RuntimeTableApiRow, RuntimeTableCell, RuntimeTableColumn, RuntimeTableDisplayRow, RuntimeTablePagination, RuntimeTableRowsResponse };
377
+ export type { ClientListAreaType, ClientListBaseConfiguration, ClientListBaseState, ClientListCard, ClientListCardModule, ClientListCardProperty, ClientListCardsPayload, ClientListCardsState, ClientListClickableItem, ClientListCollapseConfig, ClientListConfiguration, ClientListContentTemplateContext, ClientListDataLoadedHandler, ClientListFetchCardDisplayOrderItem, ClientListFetchCardGroup, ClientListFetchCatalog, ClientListFetchProjection, ClientListFetchProjectionMeta, ClientListFetchPropertyMeta, ClientListFetchQueryRequest, ClientListFetchQueryResponse, ClientListFetchRecord, ClientListFetchRequestDisplay, ClientListFetchRequestFilter, ClientListFetchSchema, ClientListFetchTableColumn, ClientListFetchValueCell, ClientListFormConfiguration, ClientListInformativeChartLink, ClientListInformativeConfiguration, ClientListInformativeDashboardPayload, ClientListInformativeState, ClientListItemClickedEvent, ClientListLayoutConfig, ClientListLazyLoadEvent, ClientListMode, ClientListRuntimeContext, ClientListState, ClientListTableQuery, ClientListTableSettingsCatalogResponse, ClientListTableSettingsColumn, ClientListTableState, ClientListType, NormalizedClientListConfiguration, Response, RuntimeEntityColumnDef, RuntimeTableDisplayRow, RuntimeTableRowsResponse };