@masterteam/client-components 0.0.113 → 0.0.115

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.113",
3
+ "version": "0.0.115",
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/components": "^0.0.342",
20
21
  "@masterteam/icons": "^0.0.17",
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"
22
+ "@masterteam/data-grid": "^0.0.6",
23
+ "@masterteam/data-table": "^0.0.10",
24
+ "@masterteam/dashboard-builder": "^0.0.121"
25
25
  },
26
26
  "dependencies": {
27
27
  "tslib": "^2.8.1"
@@ -49,6 +49,10 @@
49
49
  "./escalation-runtime": {
50
50
  "types": "./types/masterteam-client-components-escalation-runtime.d.ts",
51
51
  "default": "./fesm2022/masterteam-client-components-escalation-runtime.mjs"
52
+ },
53
+ "./studio": {
54
+ "types": "./types/masterteam-client-components-studio.d.ts",
55
+ "default": "./fesm2022/masterteam-client-components-studio.mjs"
52
56
  }
53
57
  },
54
58
  "module": "fesm2022/masterteam-client-components.mjs",
@@ -1143,6 +1143,41 @@ declare function isClientListTotalIncomplete(total: ClientListFetchSum | null |
1143
1143
  */
1144
1144
  declare function findClientListSourceGroup(groups: readonly ClientListFetchSourceGroup[] | null | undefined, levelDataId: number): ClientListFetchSourceGroup | null;
1145
1145
 
1146
+ interface ClientListTableShape {
1147
+ columns: RuntimeEntityColumnDef[];
1148
+ rows: RuntimeTableDisplayRow[];
1149
+ }
1150
+ /**
1151
+ * Stakeholder tables expose two mutually-exclusive name columns — "Stakeholder
1152
+ * Name" (User, `internal_username`) and "External Username" (Text,
1153
+ * `external_username`): internal rows fill the user, external rows fill the
1154
+ * text. This merges them into the single "Stakeholder Name" column so each row
1155
+ * shows whichever one applies. Internal rows also derive the existing Email
1156
+ * cell from the selected User value; external rows retain their stored email.
1157
+ *
1158
+ * Works because `mt-table` renders each cell from its own `EntityData.viewType`
1159
+ * (User → avatar, Text → plain text), so one column with mixed cells renders
1160
+ * correctly without a custom cell template.
1161
+ *
1162
+ * Self-gating: returns the input unchanged when the two columns are absent, so
1163
+ * it is safe to attach to every module's ClientList config.
1164
+ */
1165
+ declare function mergeStakeholderNameColumns(result: ClientListTableShape): ClientListTableShape;
1166
+ /**
1167
+ * Applies the same mutually-exclusive Stakeholder name projection to a record
1168
+ * preview. The internal-user tile is the stable visual slot: internal records
1169
+ * keep it, while external records render the external text value with that
1170
+ * slot's label, order, and layout configuration. The second name tile is then
1171
+ * removed. Internal records also project the selected user's email into the
1172
+ * existing Email tile, matching the table behaviour.
1173
+ *
1174
+ * Matching uses `normalizedKey`, because preview entity `key` values are the
1175
+ * template-specific backend keys. The `key` fallback keeps the helper useful
1176
+ * for already-normalized data. It returns the original array when either name
1177
+ * property or a recognized Stakeholder Type is absent.
1178
+ */
1179
+ declare function mergeStakeholderPreviewEntities(entities: EntityData[]): EntityData[];
1180
+
1146
1181
  declare class ClientListApiService {
1147
1182
  private readonly http;
1148
1183
  private readonly runtimeFetchBaseUrl;
@@ -1319,5 +1354,5 @@ declare class ClientListToolbarService {
1319
1354
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClientListToolbarService>;
1320
1355
  }
1321
1356
 
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 };
1357
+ 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, mergeStakeholderNameColumns, mergeStakeholderPreviewEntities, readClientListRowSource };
1323
1358
  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 };
@@ -0,0 +1,232 @@
1
+ import * as _masterteam_client_components_studio from '@masterteam/client-components/studio';
2
+ import * as _angular_core from '@angular/core';
3
+ import { InjectionToken, Provider } from '@angular/core';
4
+ import { ClientListFetchSchema, ClientListFetchRecord, ClientListFetchRequestFilter } from '@masterteam/client-components/client-list';
5
+
6
+ interface StudioOwner {
7
+ readonly moduleId?: number;
8
+ readonly recordId: number;
9
+ readonly levelId: number;
10
+ readonly name: string;
11
+ readonly levelName: string;
12
+ readonly contextKey: string;
13
+ }
14
+ /**
15
+ * A schema of the root `fetch/query` response exactly as received. Schemas that
16
+ * track statuses (KPIs) carry `statuses` and `updateStatuses` with their counts;
17
+ * other schemas do not have those keys at all.
18
+ */
19
+ type ClientStudioSchemaMeta = ClientListFetchSchema & Readonly<Record<string, unknown>>;
20
+ /**
21
+ * A root record of the response without its `values`. Any other top-level field
22
+ * the backend sends (for example `updateStatus` and `paceStatus`) passes through.
23
+ */
24
+ type ClientStudioRecordMeta = Omit<ClientListFetchRecord, 'values'> & Readonly<Record<string, unknown>>;
25
+ /**
26
+ * The root records load of a Studio (`mt-client-studio (dataLoaded)`). `contextKey`
27
+ * and `key` are the context the load was requested for, so a host can discard a
28
+ * load that a later context change has replaced.
29
+ */
30
+ interface ClientStudioDataLoaded {
31
+ readonly contextKey: string;
32
+ /** The context's cache salt (`ClientStudioContext.key`), empty when none. */
33
+ readonly key: string;
34
+ readonly schemaId: number;
35
+ /** The first page's `schemas`. */
36
+ readonly schemas: readonly ClientStudioSchemaMeta[];
37
+ /** Every page's records, in query order. */
38
+ readonly records: readonly ClientStudioRecordMeta[];
39
+ readonly totalCount: number;
40
+ }
41
+ /**
42
+ * The user chose "Open record" on a row (`mt-client-studio (recordOpen)`). A root
43
+ * row has `owner: null` and `schemaId` equal to the Studio's schema. A row of a
44
+ * connected level has `owner: null` and another `schemaId`. A module row has the
45
+ * owning record in `owner`; its `recordId` is the module row's own id and its
46
+ * `schemaId` is the owning record's schema.
47
+ */
48
+ interface ClientStudioRecordOpen {
49
+ readonly recordId: number;
50
+ readonly schemaId: number;
51
+ readonly name: string;
52
+ readonly owner: StudioOwner | null;
53
+ }
54
+
55
+ /**
56
+ * What a Studio shows. Like `mt-client-list`, the context key is opaque: the
57
+ * host owns its grammar (`Level:12` in pplus, `ComponentSchema:7` in splus).
58
+ */
59
+ interface ClientStudioContext {
60
+ /** The root schema's context key, e.g. `Level:12`. Module contexts are `${contextKey}/Module:{id}`. */
61
+ contextKey: string;
62
+ /** The root schema id. Defaults to the number after the first `:` of the key's first segment. */
63
+ schemaId?: number;
64
+ /** Extra host scope for the ROOT records query only (for example an archive filter). */
65
+ filters?: ClientListFetchRequestFilter[];
66
+ /** Cache salt: changing it drops every cached read and reloads. */
67
+ key?: string;
68
+ }
69
+ interface ClientStudioOptions {
70
+ /** Show connected child schemas as workspace tabs. Default `false` (hidden since 2026-10-25). */
71
+ showConnections?: boolean;
72
+ /** The records grid label, chart context and export name. Defaults to the schema name. */
73
+ title?: string;
74
+ /**
75
+ * Where the grids keep their charts. `'server'` (the default) saves them in the browser
76
+ * and on the backend (`chartsEndpoint` of `provideClientStudio`); `'local'` keeps them in
77
+ * the browser only, for a backend without the grid-charts routes.
78
+ */
79
+ chartStore?: 'server' | 'local';
80
+ /**
81
+ * Adds "Open record" to the row menu of every grid (root, module and connected-level
82
+ * rows) and reports the choice as `recordOpen`. Default `false`: no new UI.
83
+ */
84
+ recordOpen?: boolean;
85
+ }
86
+ /** A context with every default applied. `schemaId` is null when the key names no schema. */
87
+ interface StudioResolvedContext {
88
+ readonly contextKey: string;
89
+ readonly schemaId: number | null;
90
+ readonly filters: readonly ClientListFetchRequestFilter[];
91
+ readonly key: string;
92
+ }
93
+ /** `Level:12` → 12, `ComponentSchema:7/Module:3` → 7. */
94
+ declare function studioSchemaId(contextKey: string): number | null;
95
+ declare function resolveClientStudioContext(value: ClientStudioContext | string | null | undefined): StudioResolvedContext;
96
+
97
+ /**
98
+ * Studio: one page, no navigation. A records grid whose detail row is the
99
+ * record's workspace (module tabs), module grids paged at 50 rows on the
100
+ * client, cross-record comparison, summaries and the combined export.
101
+ *
102
+ * The context is opaque, like `mt-client-list`: `'Level:12'` (pplus) or
103
+ * `{ contextKey: 'ComponentSchema:7' }` (splus). Endpoints come from
104
+ * `provideClientStudio()`; the defaults are the pplus routes.
105
+ *
106
+ * Every grid keeps its charts through `mt-standard-grid [chartPersistence]`; Studio
107
+ * provides the store: the backend set at `chartsEndpoint` (default `grid-charts/me`) after
108
+ * the browser copy, or the browser only with `options.chartStore: 'local'`. A visit warms
109
+ * the schema's sets with one level request.
110
+ *
111
+ * Load it from a lazy route: this entry pulls in the grid, and
112
+ * `@masterteam/client-components` (the main entry) never imports it.
113
+ */
114
+ declare class ClientStudio {
115
+ /** `'Level:12'` is shorthand for `{ contextKey: 'Level:12' }`. */
116
+ readonly context: _angular_core.InputSignal<string | ClientStudioContext>;
117
+ readonly options: _angular_core.InputSignal<ClientStudioOptions>;
118
+ /** `'fill'` fills the window below the Studio's top (minimum 400px). */
119
+ readonly height: _angular_core.InputSignal<number | "fill">;
120
+ /** The first records load of a context finished. */
121
+ readonly loaded: _angular_core.OutputEmitterRef<void>;
122
+ /** The catalog or the records failed, with the message the section shows. */
123
+ readonly errored: _angular_core.OutputEmitterRef<{
124
+ message: string;
125
+ }>;
126
+ /**
127
+ * The user chose "Open record" on a row of any Studio grid. Only offered when
128
+ * `options.recordOpen` is `true`; the host decides what opening means.
129
+ */
130
+ readonly recordOpen: _angular_core.OutputEmitterRef<ClientStudioRecordOpen>;
131
+ /**
132
+ * The root records load finished (and again after a reload or a context or `key`
133
+ * change): the root query's `schemas` and each record without its `values`. Tagged
134
+ * with the context it was loaded for, so a host can discard a stale load.
135
+ */
136
+ readonly dataLoaded: _angular_core.OutputEmitterRef<ClientStudioDataLoaded>;
137
+ protected readonly resolved: _angular_core.Signal<_masterteam_client_components_studio.StudioResolvedContext>;
138
+ protected readonly schemaId: _angular_core.Signal<number | null>;
139
+ protected readonly title: _angular_core.Signal<string>;
140
+ private readonly measured;
141
+ protected readonly gridHeight: _angular_core.Signal<number>;
142
+ private readonly text;
143
+ private announced;
144
+ constructor();
145
+ protected recordsLoaded(): void;
146
+ protected rootLoaded(event: ClientStudioDataLoaded): void;
147
+ protected recordsFailed(): void;
148
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientStudio, never>;
149
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClientStudio, "mt-client-studio", never, { "context": { "alias": "context"; "required": true; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "errored": "errored"; "recordOpen": "recordOpen"; "dataLoaded": "dataLoaded"; }, never, never, true, never>;
150
+ }
151
+
152
+ /** A backend display name. Studio reads only the resolved display text. */
153
+ interface ClientStudioLocalizedName {
154
+ readonly display: string;
155
+ }
156
+ /** A module inside a workspace layout group (pplus `WorkspaceBuilderModuleRef`). */
157
+ interface ClientStudioLayoutModule {
158
+ readonly id: string;
159
+ readonly moduleKey?: string;
160
+ readonly name?: ClientStudioLocalizedName;
161
+ readonly moduleTypeGroup?: string;
162
+ readonly order?: number;
163
+ }
164
+ /** One workspace layout tab: a module, or a group of modules (pplus `WorkspaceBuilderItem`). */
165
+ interface ClientStudioLayoutTab {
166
+ readonly type: string;
167
+ readonly id: string;
168
+ readonly moduleKey?: string;
169
+ readonly name: ClientStudioLocalizedName;
170
+ readonly moduleTypeGroup?: string;
171
+ readonly order: number;
172
+ readonly modules?: readonly ClientStudioLayoutModule[];
173
+ }
174
+ /** A connected child schema of the workspace (pplus `WorkspaceBuilderChildLevel`). */
175
+ interface ClientStudioLayoutChildLevel {
176
+ readonly referenceId: string;
177
+ readonly levelId: number;
178
+ readonly connectionId: number;
179
+ readonly name: ClientStudioLocalizedName;
180
+ readonly order: number;
181
+ }
182
+ /**
183
+ * The workspace layout fields Studio reads (pplus `WorkspaceBuilderData`).
184
+ * Another backend's layout is normalised into this shape by
185
+ * {@link ClientStudioEndpoints.layoutMapper}.
186
+ */
187
+ interface ClientStudioLayout {
188
+ readonly tabs: readonly ClientStudioLayoutTab[];
189
+ readonly childLevels?: readonly ClientStudioLayoutChildLevel[] | null;
190
+ }
191
+ /** The record workspace-state fields Studio reads (pplus `WorkspaceStatePayload`). */
192
+ interface ClientStudioRecordState {
193
+ readonly modules?: readonly {
194
+ readonly moduleId: number;
195
+ readonly visible?: boolean | null;
196
+ }[] | null;
197
+ }
198
+ /**
199
+ * Where Studio reads its data. Every URL is relative: the host's HTTP
200
+ * interceptor adds the base URL, exactly as it does for `mt-client-list`.
201
+ */
202
+ interface ClientStudioEndpoints {
203
+ /** `GET` a property catalog for an opaque context key (schema or `…/Module:{id}`). */
204
+ readonly catalog: (contextKey: string) => string;
205
+ /** `GET` the workspace layout (module tabs and connected schemas) of a schema. */
206
+ readonly layout: (schemaId: number) => string;
207
+ /** Normalises the layout response into {@link ClientStudioLayout}. */
208
+ readonly layoutMapper: (raw: unknown, schemaId: number) => ClientStudioLayout;
209
+ /** `GET` a module's table display settings (visible columns, order, configuration). */
210
+ readonly moduleSettings: (schemaId: number, moduleId: number) => string;
211
+ /** `GET` a record's workspace state (which modules the record shows). */
212
+ readonly recordState: (recordId: number) => string;
213
+ /** `POST` the runtime record query. */
214
+ readonly query: string;
215
+ /**
216
+ * The caller's grid chart sets (`GET`/`PUT`/`DELETE`, plus `GET …/level/{id}`), used when
217
+ * `ClientStudioOptions.chartStore` is `'server'` (the default). Default (and when unset)
218
+ * `grid-charts/me`.
219
+ */
220
+ readonly chartsEndpoint?: string;
221
+ }
222
+ /** Today's pplus routes. Another product overrides only what differs through `provideClientStudio`. */
223
+ declare const CLIENT_STUDIO_DEFAULT_ENDPOINTS: ClientStudioEndpoints;
224
+ declare const MT_CLIENT_STUDIO_ENDPOINTS: InjectionToken<ClientStudioEndpoints>;
225
+ /**
226
+ * Installs Studio's endpoint adapter. Unset entries keep the pplus defaults.
227
+ * Works in application, route and component `providers`.
228
+ */
229
+ declare function provideClientStudio(config?: Partial<ClientStudioEndpoints>): Provider[];
230
+
231
+ export { CLIENT_STUDIO_DEFAULT_ENDPOINTS, ClientStudio, MT_CLIENT_STUDIO_ENDPOINTS, provideClientStudio, resolveClientStudioContext, studioSchemaId };
232
+ export type { ClientStudioContext, ClientStudioDataLoaded, ClientStudioEndpoints, ClientStudioLayout, ClientStudioLayoutChildLevel, ClientStudioLayoutModule, ClientStudioLayoutTab, ClientStudioLocalizedName, ClientStudioOptions, ClientStudioRecordMeta, ClientStudioRecordOpen, ClientStudioRecordState, ClientStudioSchemaMeta, StudioOwner, StudioResolvedContext };