@masterteam/client-components 0.0.8 → 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,18 +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
- type?: ClientListType;
28
- areaType?: ClientListAreaType;
29
- mode?: ClientListMode;
30
- columnKeys?: string[];
31
- isPaginated?: boolean;
32
- take?: number;
25
+ showHeader?: boolean;
33
26
  collapse?: ClientListCollapseConfig;
34
27
  layout?: ClientListLayoutConfig;
35
28
  headerStart?: TemplateRef<ClientListContentTemplateContext>;
@@ -40,6 +33,22 @@ interface ClientListConfiguration {
40
33
  rowActions?: TableAction[];
41
34
  dataLoaded?: ClientListDataLoadedHandler;
42
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;
43
52
  interface ClientListCollapseConfig {
44
53
  enabled?: boolean;
45
54
  expandedByDefault?: boolean;
@@ -57,100 +66,134 @@ interface ClientListTableQuery {
57
66
  skip: number;
58
67
  take: number;
59
68
  }
60
- interface RuntimeTableColumn {
61
- columnKey: string;
62
- sourceType: string;
63
- order: number;
64
- isVisible: boolean;
65
- id?: number;
66
- 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 {
67
89
  key?: string;
68
- normalizedKey?: string;
69
- name?: string;
70
- viewType?: string;
71
- configuration?: string;
72
- type?: string;
90
+ propertyKey?: string;
91
+ order?: number;
92
+ visible?: boolean;
73
93
  }
74
- /** Raw row as returned by the API, flat object keyed by column keys */
75
- type RuntimeTableApiRow = Record<string, unknown>;
76
- /** A single cell value enriched with its column metadata */
77
- interface RuntimeTableCell extends RuntimeTableColumn {
78
- value: unknown;
94
+ interface ClientListTableSettingsCatalogResponse {
95
+ effectiveColumns?: Array<ClientListTableSettingsColumn | string>;
79
96
  }
80
- /** Display row: Id stays plain, every other key holds a RuntimeTableCell */
81
- type RuntimeTableDisplayRow = Record<string, unknown | RuntimeTableCell>;
82
- /** Column definition extended with full runtime column metadata and forced entity type */
83
- interface RuntimeEntityColumnDef extends ColumnDef, Omit<RuntimeTableColumn, 'type'> {
97
+ interface ClientListFetchPropertyMeta {
98
+ id: number;
84
99
  key: string;
100
+ normalizedKey: string;
85
101
  label: string;
86
- /** Original API column type (e.g. CustomProperty) preserved as runtimeType */
87
- runtimeType?: RuntimeTableColumn['type'];
88
- type: 'entity';
102
+ viewType: string;
103
+ configuration: Record<string, unknown> | null;
104
+ source?: string;
105
+ order: number;
106
+ isRequired?: boolean;
107
+ isSystem?: boolean;
89
108
  }
90
- interface RuntimeTablePagination {
91
- skip: number;
92
- take: number;
93
- totalCount: number;
109
+ interface ClientListFetchValueCell {
110
+ raw: unknown;
111
+ value: unknown;
112
+ display?: string | null;
113
+ [key: string]: unknown;
94
114
  }
95
- interface RuntimeTableRowsResponse {
96
- levelId: number;
97
- levelDataId: number;
98
- moduleId: number;
99
- moduleKey: string;
100
- surfaceKey: string;
101
- columns: RuntimeTableColumn[];
102
- rows: RuntimeTableApiRow[];
103
- pagination: RuntimeTablePagination;
115
+ interface ClientListFetchRecord {
116
+ id: number;
117
+ name?: string;
118
+ schemaId?: number;
119
+ values: Record<string, ClientListFetchValueCell>;
104
120
  }
105
- interface ClientListCardModule {
121
+ interface ClientListFetchSchema {
106
122
  id: number;
107
- key?: string;
123
+ key: string;
108
124
  name: string;
109
125
  order?: number;
110
126
  typeGroup?: string;
111
127
  }
112
- interface ClientListCardProperty {
113
- id?: number;
114
- propertyId?: number;
128
+ interface ClientListFetchCatalog {
129
+ properties: ClientListFetchPropertyMeta[];
130
+ }
131
+ interface ClientListFetchTableColumn {
115
132
  key: string;
116
- 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;
117
182
  name: string;
118
- rawValue?: string;
119
- value: EntityData['value'];
120
- viewType: EntityData['viewType'];
121
- configuration?: Record<string, unknown>;
122
- type?: string;
123
- [key: string]: unknown;
183
+ order?: number;
184
+ typeGroup?: string;
124
185
  }
186
+ type ClientListCardProperty = EntityData;
125
187
  interface ClientListCard {
126
188
  id: number;
127
189
  name: string;
128
190
  module?: ClientListCardModule;
129
- levelDataId?: number;
191
+ instanceId?: number;
130
192
  properties: ClientListCardProperty[];
131
193
  displayProperties?: Record<string, unknown>;
132
194
  entities: EntityData[];
133
195
  }
134
- interface ClientListCardDisplayProperty {
135
- propertyKey: string;
136
- areaKey: string;
137
- order: number;
138
- configuration: EntityConfiguration;
139
- }
140
- interface ClientListCardDisplayConfiguration {
141
- contextKey: string;
142
- moduleId?: number;
143
- levelId?: number;
144
- properties: ClientListCardDisplayProperty[];
145
- }
146
- interface ClientListCardsDetailsBlock {
147
- module?: ClientListCardModule;
148
- data: Omit<ClientListCard, 'entities'>[];
149
- }
150
- interface ClientListCardsPayload {
151
- details?: ClientListCardsDetailsBlock[];
152
- displayConfigurations?: ClientListCardDisplayConfiguration[];
153
- }
196
+ type ClientListCardsPayload = ClientListFetchQueryResponse;
154
197
  interface ClientListInformativeChartLink {
155
198
  id?: number;
156
199
  chartComponentId?: string;
@@ -197,9 +240,16 @@ interface ClientListInformativeState extends ClientListBaseState {
197
240
  areaType: 'table';
198
241
  }
199
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
+ }
200
250
  interface NormalizedClientListConfiguration {
201
- levelId: number;
202
- levelDataId: number;
251
+ contextKey: ClientListRuntimeContext | null;
252
+ instanceId: number | null;
203
253
  moduleId: number;
204
254
  type: ClientListType;
205
255
  areaType: ClientListAreaType;
@@ -207,6 +257,7 @@ interface NormalizedClientListConfiguration {
207
257
  isPaginated: boolean;
208
258
  take: number;
209
259
  title?: string;
260
+ showHeader: boolean;
210
261
  columnKeys: string[];
211
262
  collapse: Required<ClientListCollapseConfig>;
212
263
  layout: Required<ClientListLayoutConfig>;
@@ -244,21 +295,10 @@ declare class ClientListStateService {
244
295
  setInformativeResult(key: string, response: ClientListInformativeDashboardPayload | null, config: NormalizedClientListConfiguration): void;
245
296
  toggleExpanded(key: string): void;
246
297
  private mergeItemState;
247
- private getVisibleColumns;
248
- private toColumnDefs;
249
- /**
250
- * Enriches each flat API row so that every cell value becomes a
251
- * RuntimeTableCell carrying both the original value and the full
252
- * column metadata. The `Id` key is preserved as-is.
253
- */
254
- private toDisplayRows;
255
- private toCell;
256
298
  private toCards;
299
+ private orderRecords;
300
+ private toEntityData;
257
301
  private toDashboardData;
258
- private buildDisplayConfigurationLookup;
259
- private mapEntities;
260
- private getPropertyConfiguration;
261
- private toLabel;
262
302
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientListStateService, never>;
263
303
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListStateService>;
264
304
  }
@@ -273,6 +313,7 @@ declare class ClientList implements OnDestroy {
273
313
  key: string;
274
314
  message: string;
275
315
  }>;
316
+ readonly itemClicked: _angular_core.OutputEmitterRef<ClientListItemClickedEvent>;
276
317
  protected readonly items: _angular_core.Signal<ClientListState[]>;
277
318
  private readonly subscriptions;
278
319
  private readonly inFlightRequestSignatures;
@@ -282,6 +323,8 @@ declare class ClientList implements OnDestroy {
282
323
  reload(itemKey?: string): void;
283
324
  reloadByKey(itemKey: string): void;
284
325
  toggleExpanded(key: string): void;
326
+ onTableRowClick(item: ClientListState, row: RuntimeTableDisplayRow): void;
327
+ onCardClick(item: ClientListState, card: ClientListCard): void;
285
328
  templateContext(item: ClientListState): ClientListContentTemplateContext;
286
329
  defaultTitle(item: ClientListState): string;
287
330
  ngOnDestroy(): void;
@@ -294,6 +337,7 @@ declare class ClientList implements OnDestroy {
294
337
  private resolveType;
295
338
  private resolveMode;
296
339
  private toNormalizedConfig;
340
+ private createItemKey;
297
341
  private resolveLayout;
298
342
  private clampSpan;
299
343
  private cleanupStaleResources;
@@ -304,21 +348,30 @@ declare class ClientList implements OnDestroy {
304
348
  private createInformativeRequestSignature;
305
349
  private hasValidIdentifiers;
306
350
  private getMissingIdentifiersMessage;
351
+ private isInformativeConfig;
352
+ private asInformativeConfig;
353
+ private asFormConfig;
307
354
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientList, never>;
308
- 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>;
309
356
  }
310
357
 
311
358
  declare class ClientListApiService {
312
359
  private readonly http;
313
- private readonly tablesBaseUrl;
314
- private readonly cardsBaseUrl;
360
+ private readonly runtimeFetchBaseUrl;
361
+ private readonly tableSettingsBaseUrl;
315
362
  private readonly informativeBaseUrl;
316
- getRows(levelId: number, levelDataId: number, moduleId: number, query: ClientListTableQuery): Observable<Response<RuntimeTableRowsResponse>>;
317
- 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>>;
318
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;
319
372
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientListApiService, never>;
320
373
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListApiService>;
321
374
  }
322
375
 
323
376
  export { ClientList, ClientListApiService, ClientListStateService };
324
- 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 };