@masterteam/client-components 0.0.114 → 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.114",
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.341",
22
- "@masterteam/dashboard-builder": "^0.0.121",
23
- "@masterteam/data-table": "^0.0.9",
24
- "@masterteam/data-grid": "^0.0.6"
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"
@@ -1,7 +1,56 @@
1
1
  import * as _masterteam_client_components_studio from '@masterteam/client-components/studio';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { InjectionToken, Provider } from '@angular/core';
4
- import { ClientListFetchRequestFilter } from '@masterteam/client-components/client-list';
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
+ }
5
54
 
6
55
  /**
7
56
  * What a Studio shows. Like `mt-client-list`, the context key is opaque: the
@@ -28,6 +77,11 @@ interface ClientStudioOptions {
28
77
  * the browser only, for a backend without the grid-charts routes.
29
78
  */
30
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;
31
85
  }
32
86
  /** A context with every default applied. `schemaId` is null when the key names no schema. */
33
87
  interface StudioResolvedContext {
@@ -69,6 +123,17 @@ declare class ClientStudio {
69
123
  readonly errored: _angular_core.OutputEmitterRef<{
70
124
  message: string;
71
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>;
72
137
  protected readonly resolved: _angular_core.Signal<_masterteam_client_components_studio.StudioResolvedContext>;
73
138
  protected readonly schemaId: _angular_core.Signal<number | null>;
74
139
  protected readonly title: _angular_core.Signal<string>;
@@ -78,9 +143,10 @@ declare class ClientStudio {
78
143
  private announced;
79
144
  constructor();
80
145
  protected recordsLoaded(): void;
146
+ protected rootLoaded(event: ClientStudioDataLoaded): void;
81
147
  protected recordsFailed(): void;
82
148
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientStudio, never>;
83
- 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"; }, never, never, true, 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>;
84
150
  }
85
151
 
86
152
  /** A backend display name. Studio reads only the resolved display text. */
@@ -163,4 +229,4 @@ declare const MT_CLIENT_STUDIO_ENDPOINTS: InjectionToken<ClientStudioEndpoints>;
163
229
  declare function provideClientStudio(config?: Partial<ClientStudioEndpoints>): Provider[];
164
230
 
165
231
  export { CLIENT_STUDIO_DEFAULT_ENDPOINTS, ClientStudio, MT_CLIENT_STUDIO_ENDPOINTS, provideClientStudio, resolveClientStudioContext, studioSchemaId };
166
- export type { ClientStudioContext, ClientStudioEndpoints, ClientStudioLayout, ClientStudioLayoutChildLevel, ClientStudioLayoutModule, ClientStudioLayoutTab, ClientStudioLocalizedName, ClientStudioOptions, ClientStudioRecordState, StudioResolvedContext };
232
+ export type { ClientStudioContext, ClientStudioDataLoaded, ClientStudioEndpoints, ClientStudioLayout, ClientStudioLayoutChildLevel, ClientStudioLayoutModule, ClientStudioLayoutTab, ClientStudioLocalizedName, ClientStudioOptions, ClientStudioRecordMeta, ClientStudioRecordOpen, ClientStudioRecordState, ClientStudioSchemaMeta, StudioOwner, StudioResolvedContext };