@masterteam/client-components 0.0.1 → 0.0.2
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.
|
@@ -2,12 +2,12 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, Injectable, signal, computed, input, output, effect, untracked, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { Card } from '@masterteam/components/card';
|
|
6
5
|
import { Table } from '@masterteam/components/table';
|
|
7
6
|
import { Button } from '@masterteam/components/button';
|
|
8
7
|
import * as i2 from 'primeng/skeleton';
|
|
9
8
|
import { SkeletonModule } from 'primeng/skeleton';
|
|
10
9
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
10
|
+
import { Card } from '@masterteam/components/card';
|
|
11
11
|
|
|
12
12
|
class ClientListApiService {
|
|
13
13
|
http = inject(HttpClient);
|
|
@@ -161,6 +161,8 @@ class ClientList {
|
|
|
161
161
|
tables = this.state.tables;
|
|
162
162
|
gridTemplateColumns = `repeat(${DEFAULT_GRID_COLUMNS}, minmax(0, 1fr))`;
|
|
163
163
|
subscriptions = new Map();
|
|
164
|
+
inFlightRequestSignatures = new Map();
|
|
165
|
+
fulfilledRequestSignatures = new Map();
|
|
164
166
|
constructor() {
|
|
165
167
|
effect(() => {
|
|
166
168
|
const configs = this.configurations();
|
|
@@ -180,6 +182,21 @@ class ClientList {
|
|
|
180
182
|
const skip = Number(event.first ?? 0);
|
|
181
183
|
this.loadTable(table.key, table.config, skip, take);
|
|
182
184
|
}
|
|
185
|
+
reload(tableKey) {
|
|
186
|
+
if (tableKey) {
|
|
187
|
+
this.reloadByKey(tableKey);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.tables().forEach((table) => {
|
|
191
|
+
this.loadTable(table.key, table.config, table.skip, table.take, true);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
reloadByKey(tableKey) {
|
|
195
|
+
const table = this.state.tablesByKey()[tableKey];
|
|
196
|
+
if (!table)
|
|
197
|
+
return;
|
|
198
|
+
this.loadTable(table.key, table.config, table.skip, table.take, true);
|
|
199
|
+
}
|
|
183
200
|
toggleExpanded(key) {
|
|
184
201
|
this.state.toggleExpanded(key);
|
|
185
202
|
}
|
|
@@ -197,48 +214,64 @@ class ClientList {
|
|
|
197
214
|
this.subscriptions.clear();
|
|
198
215
|
}
|
|
199
216
|
configureTables(configs) {
|
|
217
|
+
const previousTables = this.state.tablesByKey();
|
|
218
|
+
const hasMultipleConfigs = (configs ?? []).length > 1;
|
|
200
219
|
const normalized = (configs ?? []).map((config, index) => {
|
|
201
220
|
const mode = this.resolveMode(config.mode, config.columnKeys);
|
|
202
221
|
const isPaginated = config.isPaginated ?? true;
|
|
203
222
|
const take = isPaginated
|
|
204
223
|
? (config.take ?? this.defaultTake())
|
|
205
224
|
: LOCAL_PAGE_SIZE_SOURCE;
|
|
225
|
+
const collapseEnabled = (config.collapse?.enabled ?? true) && hasMultipleConfigs;
|
|
206
226
|
const layout = this.resolveLayout(config);
|
|
207
227
|
const key = config.key ??
|
|
208
228
|
`${config.levelId ?? 'x'}-${config.levelDataId ?? 'x'}-${config.moduleId ?? 'x'}-${index}`;
|
|
229
|
+
const current = previousTables[key];
|
|
209
230
|
return {
|
|
210
231
|
key,
|
|
211
|
-
config: this.toNormalizedConfig(config, mode, isPaginated, take, layout),
|
|
232
|
+
config: this.toNormalizedConfig(config, mode, isPaginated, take, collapseEnabled, layout),
|
|
212
233
|
loading: false,
|
|
213
234
|
error: null,
|
|
214
235
|
title: config.title?.trim() || '',
|
|
215
236
|
moduleKey: '',
|
|
216
237
|
columns: [],
|
|
217
238
|
rows: [],
|
|
218
|
-
skip: 0,
|
|
239
|
+
skip: current?.skip ?? 0,
|
|
219
240
|
take,
|
|
220
241
|
totalCount: 0,
|
|
221
242
|
expanded: config.collapse?.expandedByDefault ?? true,
|
|
222
243
|
};
|
|
223
244
|
});
|
|
224
245
|
this.state.setConfigs(normalized);
|
|
246
|
+
this.cleanupStaleResources(new Set(normalized.map((table) => table.key)));
|
|
225
247
|
}
|
|
226
|
-
loadTable(key, config, skip, take) {
|
|
248
|
+
loadTable(key, config, skip, take, force = false) {
|
|
249
|
+
if (!this.hasValidIdentifiers(config)) {
|
|
250
|
+
this.state.setLoading(key, false);
|
|
251
|
+
this.state.setError(key, 'Missing identifiers: levelId, levelDataId and moduleId are required');
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const query = this.toQuery(config, skip, take);
|
|
255
|
+
const requestSignature = this.createRequestSignature(config, query);
|
|
256
|
+
if (force) {
|
|
257
|
+
this.inFlightRequestSignatures.delete(key);
|
|
258
|
+
this.fulfilledRequestSignatures.delete(key);
|
|
259
|
+
}
|
|
260
|
+
else if (this.inFlightRequestSignatures.get(key) === requestSignature ||
|
|
261
|
+
this.fulfilledRequestSignatures.get(key) === requestSignature) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
227
264
|
this.subscriptions.get(key)?.unsubscribe();
|
|
265
|
+
this.inFlightRequestSignatures.set(key, requestSignature);
|
|
228
266
|
this.state.setLoading(key, true);
|
|
229
267
|
this.state.setError(key, null);
|
|
230
|
-
const query = {
|
|
231
|
-
mode: config.mode,
|
|
232
|
-
columnKeys: config.mode === 'override' ? config.columnKeys : undefined,
|
|
233
|
-
skip: config.isPaginated ? skip : 0,
|
|
234
|
-
take: config.isPaginated ? take : LOCAL_PAGE_SIZE_SOURCE,
|
|
235
|
-
};
|
|
236
268
|
const sub = this.api
|
|
237
269
|
.getRows(config.levelId, config.levelDataId, config.moduleId, query)
|
|
238
270
|
.subscribe({
|
|
239
271
|
next: (response) => {
|
|
240
272
|
if (response.data) {
|
|
241
273
|
this.state.setRowsResult(key, response.data, config, query.skip, query.take);
|
|
274
|
+
this.fulfilledRequestSignatures.set(key, requestSignature);
|
|
242
275
|
this.loaded.emit(key);
|
|
243
276
|
}
|
|
244
277
|
else {
|
|
@@ -247,11 +280,13 @@ class ClientList {
|
|
|
247
280
|
this.errored.emit({ key, message });
|
|
248
281
|
}
|
|
249
282
|
this.state.setLoading(key, false);
|
|
283
|
+
this.inFlightRequestSignatures.delete(key);
|
|
250
284
|
},
|
|
251
285
|
error: (error) => {
|
|
252
286
|
const message = error?.error?.message ?? error?.message ?? 'Failed to load rows';
|
|
253
287
|
this.state.setError(key, message);
|
|
254
288
|
this.state.setLoading(key, false);
|
|
289
|
+
this.inFlightRequestSignatures.delete(key);
|
|
255
290
|
this.errored.emit({ key, message });
|
|
256
291
|
},
|
|
257
292
|
});
|
|
@@ -262,7 +297,7 @@ class ClientList {
|
|
|
262
297
|
return DEFAULT_MODE;
|
|
263
298
|
return (columnKeys ?? []).length > 0 ? 'override' : DEFAULT_MODE;
|
|
264
299
|
}
|
|
265
|
-
toNormalizedConfig(config, mode, isPaginated, take, layout) {
|
|
300
|
+
toNormalizedConfig(config, mode, isPaginated, take, collapseEnabled, layout) {
|
|
266
301
|
return {
|
|
267
302
|
levelId: config.levelId,
|
|
268
303
|
levelDataId: config.levelDataId,
|
|
@@ -272,10 +307,12 @@ class ClientList {
|
|
|
272
307
|
take,
|
|
273
308
|
title: config.title,
|
|
274
309
|
columnKeys: config.columnKeys ?? [],
|
|
310
|
+
headerStart: config.headerStart,
|
|
311
|
+
headerEnd: config.headerEnd,
|
|
275
312
|
contentStart: config.contentStart,
|
|
276
313
|
contentEnd: config.contentEnd,
|
|
277
314
|
collapse: {
|
|
278
|
-
enabled:
|
|
315
|
+
enabled: collapseEnabled,
|
|
279
316
|
expandedByDefault: config.collapse?.expandedByDefault ?? true,
|
|
280
317
|
collapseIcon: config.collapse?.collapseIcon ?? DEFAULT_COLLAPSE_ICON,
|
|
281
318
|
expandIcon: config.collapse?.expandIcon ?? DEFAULT_EXPAND_ICON,
|
|
@@ -309,12 +346,49 @@ class ClientList {
|
|
|
309
346
|
return min;
|
|
310
347
|
return Math.min(max, Math.max(min, Math.trunc(normalized)));
|
|
311
348
|
}
|
|
349
|
+
cleanupStaleResources(activeKeys) {
|
|
350
|
+
for (const [key, sub] of this.subscriptions.entries()) {
|
|
351
|
+
if (!activeKeys.has(key)) {
|
|
352
|
+
sub.unsubscribe();
|
|
353
|
+
this.subscriptions.delete(key);
|
|
354
|
+
this.inFlightRequestSignatures.delete(key);
|
|
355
|
+
this.fulfilledRequestSignatures.delete(key);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
toQuery(config, skip, take) {
|
|
360
|
+
return {
|
|
361
|
+
mode: config.mode,
|
|
362
|
+
columnKeys: config.mode === 'override' ? config.columnKeys : undefined,
|
|
363
|
+
skip: config.isPaginated ? skip : 0,
|
|
364
|
+
take: config.isPaginated ? take : LOCAL_PAGE_SIZE_SOURCE,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
createRequestSignature(config, query) {
|
|
368
|
+
return [
|
|
369
|
+
config.levelId,
|
|
370
|
+
config.levelDataId,
|
|
371
|
+
config.moduleId,
|
|
372
|
+
query.mode,
|
|
373
|
+
query.skip,
|
|
374
|
+
query.take,
|
|
375
|
+
...(query.columnKeys ?? []),
|
|
376
|
+
].join('|');
|
|
377
|
+
}
|
|
378
|
+
hasValidIdentifiers(config) {
|
|
379
|
+
return (Number.isFinite(config.levelId) &&
|
|
380
|
+
config.levelId > 0 &&
|
|
381
|
+
Number.isFinite(config.levelDataId) &&
|
|
382
|
+
config.levelDataId > 0 &&
|
|
383
|
+
Number.isFinite(config.moduleId) &&
|
|
384
|
+
config.moduleId > 0);
|
|
385
|
+
}
|
|
312
386
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
313
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientList, isStandalone: true, selector: "mt-client-list", inputs: { configurations: { classPropertyName: "configurations", publicName: "configurations", isSignal: true, isRequired: true, transformFunction: null }, defaultTake: { classPropertyName: "defaultTake", publicName: "defaultTake", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", errored: "errored" }, providers: [ClientListStateService], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <
|
|
387
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientList, isStandalone: true, selector: "mt-client-list", inputs: { configurations: { classPropertyName: "configurations", publicName: "configurations", isSignal: true, isRequired: true, transformFunction: null }, defaultTake: { classPropertyName: "defaultTake", publicName: "defaultTake", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", errored: "errored" }, providers: [ClientListStateService], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <section class=\"flex flex-col gap-4\">\n <div class=\"flex w-full items-center gap-2\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\n @if (table.config.collapse.enabled) {\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n [icon]=\"\n table.expanded\n ? table.config.collapse.collapseIcon\n : table.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(table.key)\"\n />\n }\n <h3 class=\"m-0 text-lg font-bold\">\n {{ table.title || table.moduleKey || 'Table' }}\n </h3>\n @if (table.config.headerStart) {\n <div class=\"flex items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n @if (table.config.headerEnd) {\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n\n @if (table.expanded || !table.config.collapse.enabled) {\n <div\n class=\"grid gap-4\"\n [style.gridTemplateColumns]=\"gridTemplateColumns\"\n >\n @if (table.config.contentStart) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.startSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.tableSpan)\">\n <mt-card>\n @if (table.loading && table.rows.length === 0) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n </div>\n } @else if (table.error) {\n <div\n class=\"p-3 rounded-lg bg-red-50 text-red-700 border border-red-200 text-sm\"\n >\n {{ table.error }}\n </div>\n } @else {\n <mt-table\n [data]=\"table.rows\"\n [columns]=\"table.columns\"\n [loading]=\"table.loading\"\n [lazy]=\"table.config.isPaginated\"\n [lazyTotalRecords]=\"table.totalCount\"\n [pageSize]=\"table.config.isPaginated ? table.take : 10\"\n (lazyLoad)=\"onLazyLoad(table.key, $event)\"\n />\n }\n </mt-card>\n </div>\n\n @if (table.config.contentEnd) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.endSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n }\n </section>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "generalSearch", "showFilters", "loading", "updating", "lazy", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "exportable", "exportFilename", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "pageSize", "currentPage", "first", "filterTerm"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }] });
|
|
314
388
|
}
|
|
315
389
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientList, decorators: [{
|
|
316
390
|
type: Component,
|
|
317
|
-
args: [{ selector: 'mt-client-list', standalone: true, imports: [CommonModule, Card, Table, Button, SkeletonModule], providers: [ClientListStateService], template: "<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <
|
|
391
|
+
args: [{ selector: 'mt-client-list', standalone: true, imports: [CommonModule, Card, Table, Button, SkeletonModule], providers: [ClientListStateService], template: "<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <section class=\"flex flex-col gap-4\">\n <div class=\"flex w-full items-center gap-2\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\n @if (table.config.collapse.enabled) {\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n [icon]=\"\n table.expanded\n ? table.config.collapse.collapseIcon\n : table.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(table.key)\"\n />\n }\n <h3 class=\"m-0 text-lg font-bold\">\n {{ table.title || table.moduleKey || 'Table' }}\n </h3>\n @if (table.config.headerStart) {\n <div class=\"flex items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n @if (table.config.headerEnd) {\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n\n @if (table.expanded || !table.config.collapse.enabled) {\n <div\n class=\"grid gap-4\"\n [style.gridTemplateColumns]=\"gridTemplateColumns\"\n >\n @if (table.config.contentStart) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.startSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.tableSpan)\">\n <mt-card>\n @if (table.loading && table.rows.length === 0) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n </div>\n } @else if (table.error) {\n <div\n class=\"p-3 rounded-lg bg-red-50 text-red-700 border border-red-200 text-sm\"\n >\n {{ table.error }}\n </div>\n } @else {\n <mt-table\n [data]=\"table.rows\"\n [columns]=\"table.columns\"\n [loading]=\"table.loading\"\n [lazy]=\"table.config.isPaginated\"\n [lazyTotalRecords]=\"table.totalCount\"\n [pageSize]=\"table.config.isPaginated ? table.take : 10\"\n (lazyLoad)=\"onLazyLoad(table.key, $event)\"\n />\n }\n </mt-card>\n </div>\n\n @if (table.config.contentEnd) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.endSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n }\n </section>\n }\n</div>\n" }]
|
|
318
392
|
}], ctorParameters: () => [], propDecorators: { configurations: [{ type: i0.Input, args: [{ isSignal: true, alias: "configurations", required: true }] }], defaultTake: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultTake", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], errored: [{ type: i0.Output, args: ["errored"] }] } });
|
|
319
393
|
|
|
320
394
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-client-components-client-list.mjs","sources":["../../../../packages/masterteam/client-components/client-list/services/client-list-api.service.ts","../../../../packages/masterteam/client-components/client-list/services/client-list-state.service.ts","../../../../packages/masterteam/client-components/client-list/client-list.ts","../../../../packages/masterteam/client-components/client-list/client-list.html","../../../../packages/masterteam/client-components/client-list/masterteam-client-components-client-list.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { HttpClient, HttpParams } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport {\n ClientListQuery,\n Response,\n RuntimeTableRowsResponse,\n} from '../models/client-list.model';\n\n@Injectable({ providedIn: 'root' })\nexport class ClientListApiService {\n private readonly http = inject(HttpClient);\n private readonly baseUrl = 'data/tables';\n\n getRows(\n levelId: number,\n levelDataId: number,\n moduleId: number,\n query: ClientListQuery,\n ): Observable<Response<RuntimeTableRowsResponse>> {\n const endpoint = `${this.baseUrl}/level/${levelId}/level-data/${levelDataId}/module/${moduleId}/rows`;\n let params = new HttpParams()\n .set('mode', query.mode)\n .set('skip', query.skip)\n .set('take', query.take);\n\n (query.columnKeys ?? []).forEach((columnKey) => {\n params = params.append('columnKeys', columnKey);\n });\n\n return this.http.get<Response<RuntimeTableRowsResponse>>(endpoint, {\n params,\n });\n }\n}\n","import { Injectable, computed, signal } from '@angular/core';\nimport {\n NormalizedClientListConfiguration,\n ClientListTableState,\n RuntimeTableRowsResponse,\n} from '../models/client-list.model';\nimport { ColumnDef } from '@masterteam/components/table';\n\n@Injectable()\nexport class ClientListStateService {\n readonly tablesByKey = signal<Record<string, ClientListTableState>>({});\n\n readonly tables = computed<ClientListTableState[]>(() =>\n Object.values(this.tablesByKey()).sort((a, b) =>\n a.config.moduleId === b.config.moduleId\n ? a.config.levelDataId - b.config.levelDataId\n : a.config.moduleId - b.config.moduleId,\n ),\n );\n\n setConfigs(configs: ClientListTableState[]): void {\n const next: Record<string, ClientListTableState> = {};\n configs.forEach((table) => {\n const current = this.tablesByKey()[table.key];\n next[table.key] = {\n ...table,\n loading: current?.loading ?? false,\n error: current?.error ?? null,\n title: current?.title ?? table.title,\n moduleKey: current?.moduleKey ?? table.moduleKey,\n columns: current?.columns ?? table.columns,\n rows: current?.rows ?? table.rows,\n skip: current?.skip ?? table.skip,\n take: current?.take ?? table.take,\n totalCount: current?.totalCount ?? table.totalCount,\n expanded: current?.expanded ?? table.expanded,\n };\n });\n this.tablesByKey.set(next);\n }\n\n setLoading(key: string, loading: boolean): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n loading,\n },\n });\n }\n\n setError(key: string, message: string | null): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n error: message,\n },\n });\n }\n\n setRowsResult(\n key: string,\n response: RuntimeTableRowsResponse,\n config: NormalizedClientListConfiguration,\n skip: number,\n take: number,\n ): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n\n const columns = this.toColumnDefs(response.columns);\n const rows = response.rows ?? [];\n const title = (config.title ?? '').trim() || response.moduleKey;\n const totalCount =\n config.isPaginated === false\n ? rows.length\n : (response.pagination?.totalCount ?? rows.length);\n\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n title,\n moduleKey: response.moduleKey ?? '',\n columns,\n rows,\n skip,\n take,\n totalCount,\n error: null,\n },\n });\n }\n\n toggleExpanded(key: string): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n expanded: !target.expanded,\n },\n });\n }\n\n private toColumnDefs(\n columns: RuntimeTableRowsResponse['columns'],\n ): ColumnDef[] {\n return (columns ?? [])\n .filter((column) => column.isVisible)\n .sort((a, b) => a.order - b.order)\n .map((column) => ({\n key: column.columnKey,\n label: this.toLabel(column.columnKey),\n }));\n }\n\n private toLabel(key: string): string {\n return key\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word[0].toUpperCase() + word.slice(1))\n .join(' ');\n }\n}\n","import {\n Component,\n effect,\n inject,\n input,\n output,\n untracked,\n OnDestroy,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Subscription } from 'rxjs';\nimport { Card } from '@masterteam/components/card';\nimport { Table } from '@masterteam/components/table';\nimport { Button } from '@masterteam/components/button';\nimport { SkeletonModule } from 'primeng/skeleton';\nimport { ClientListApiService } from './services/client-list-api.service';\nimport { ClientListStateService } from './services/client-list-state.service';\nimport {\n ClientListConfiguration,\n ClientListContentTemplateContext,\n ClientListLazyLoadEvent,\n ClientListLayoutConfig,\n ClientListMode,\n NormalizedClientListConfiguration,\n ClientListQuery,\n ClientListTableState,\n} from './models/client-list.model';\n\nconst DEFAULT_MODE: ClientListMode = 'auto';\nconst DEFAULT_SERVER_PAGE_SIZE = 50;\nconst LOCAL_PAGE_SIZE_SOURCE = 100000;\nconst DEFAULT_COLLAPSE_ICON = 'arrow.chevron-up';\nconst DEFAULT_EXPAND_ICON = 'arrow.chevron-down';\nconst DEFAULT_SIDE_CONTENT_SPAN = 3;\nconst DEFAULT_GRID_COLUMNS = 12;\n\n@Component({\n selector: 'mt-client-list',\n standalone: true,\n imports: [CommonModule, Card, Table, Button, SkeletonModule],\n providers: [ClientListStateService],\n templateUrl: './client-list.html',\n styleUrl: './client-list.scss',\n})\nexport class ClientList implements OnDestroy {\n private readonly api = inject(ClientListApiService);\n protected readonly state = inject(ClientListStateService);\n\n readonly configurations = input.required<ClientListConfiguration[]>();\n readonly defaultTake = input(DEFAULT_SERVER_PAGE_SIZE);\n\n readonly loaded = output<string>();\n readonly errored = output<{ key: string; message: string }>();\n\n protected readonly tables = this.state.tables;\n protected readonly gridTemplateColumns = `repeat(${DEFAULT_GRID_COLUMNS}, minmax(0, 1fr))`;\n private readonly subscriptions = new Map<string, Subscription>();\n\n constructor() {\n effect(() => {\n const configs = this.configurations();\n untracked(() => this.configureTables(configs));\n\n untracked(() => {\n this.state.tables().forEach((table) => {\n this.loadTable(table.key, table.config, table.skip, table.take);\n });\n });\n });\n }\n\n onLazyLoad(tableKey: string, event: ClientListLazyLoadEvent): void {\n const table = this.state.tablesByKey()[tableKey];\n if (!table || !table.config.isPaginated) return;\n\n const take = Number(event.pageSize ?? table.take);\n const skip = Number(event.first ?? 0);\n this.loadTable(table.key, table.config, skip, take);\n }\n\n toggleExpanded(key: string): void {\n this.state.toggleExpanded(key);\n }\n\n slotGridSpan(span: number): string {\n return `span ${span} / span ${span}`;\n }\n\n templateContext(\n table: ClientListTableState,\n ): ClientListContentTemplateContext {\n return {\n $implicit: table,\n table,\n };\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions.clear();\n }\n\n private configureTables(configs: ClientListConfiguration[]): void {\n const normalized: ClientListTableState[] = (configs ?? []).map(\n (config, index) => {\n const mode = this.resolveMode(config.mode, config.columnKeys);\n const isPaginated = config.isPaginated ?? true;\n const take = isPaginated\n ? (config.take ?? this.defaultTake())\n : LOCAL_PAGE_SIZE_SOURCE;\n const layout = this.resolveLayout(config);\n const key =\n config.key ??\n `${config.levelId ?? 'x'}-${config.levelDataId ?? 'x'}-${config.moduleId ?? 'x'}-${index}`;\n return {\n key,\n config: this.toNormalizedConfig(\n config,\n mode,\n isPaginated,\n take,\n layout,\n ),\n loading: false,\n error: null,\n title: config.title?.trim() || '',\n moduleKey: '',\n columns: [],\n rows: [],\n skip: 0,\n take,\n totalCount: 0,\n expanded: config.collapse?.expandedByDefault ?? true,\n };\n },\n );\n\n this.state.setConfigs(normalized);\n }\n\n private loadTable(\n key: string,\n config: NormalizedClientListConfiguration,\n skip: number,\n take: number,\n ): void {\n this.subscriptions.get(key)?.unsubscribe();\n\n this.state.setLoading(key, true);\n this.state.setError(key, null);\n\n const query: ClientListQuery = {\n mode: config.mode,\n columnKeys: config.mode === 'override' ? config.columnKeys : undefined,\n skip: config.isPaginated ? skip : 0,\n take: config.isPaginated ? take : LOCAL_PAGE_SIZE_SOURCE,\n };\n\n const sub = this.api\n .getRows(config.levelId, config.levelDataId, config.moduleId, query)\n .subscribe({\n next: (response) => {\n if (response.data) {\n this.state.setRowsResult(\n key,\n response.data,\n config,\n query.skip,\n query.take,\n );\n this.loaded.emit(key);\n } else {\n const message = response.message ?? 'Failed to load table rows';\n this.state.setError(key, message);\n this.errored.emit({ key, message });\n }\n this.state.setLoading(key, false);\n },\n error: (error) => {\n const message =\n error?.error?.message ?? error?.message ?? 'Failed to load rows';\n this.state.setError(key, message);\n this.state.setLoading(key, false);\n this.errored.emit({ key, message });\n },\n });\n\n this.subscriptions.set(key, sub);\n }\n\n private resolveMode(\n mode: ClientListMode | undefined,\n columnKeys: string[] | undefined,\n ): ClientListMode {\n if (mode !== 'override') return DEFAULT_MODE;\n return (columnKeys ?? []).length > 0 ? 'override' : DEFAULT_MODE;\n }\n\n private toNormalizedConfig(\n config: ClientListConfiguration,\n mode: ClientListMode,\n isPaginated: boolean,\n take: number,\n layout: Required<ClientListLayoutConfig>,\n ): NormalizedClientListConfiguration {\n return {\n levelId: config.levelId as number,\n levelDataId: config.levelDataId as number,\n moduleId: config.moduleId as number,\n mode,\n isPaginated,\n take,\n title: config.title,\n columnKeys: config.columnKeys ?? [],\n contentStart: config.contentStart,\n contentEnd: config.contentEnd,\n collapse: {\n enabled: config.collapse?.enabled ?? true,\n expandedByDefault: config.collapse?.expandedByDefault ?? true,\n collapseIcon: config.collapse?.collapseIcon ?? DEFAULT_COLLAPSE_ICON,\n expandIcon: config.collapse?.expandIcon ?? DEFAULT_EXPAND_ICON,\n },\n layout,\n };\n }\n\n private resolveLayout(\n config: ClientListConfiguration,\n ): Required<ClientListLayoutConfig> {\n const hasStart = !!config.contentStart;\n const hasEnd = !!config.contentEnd;\n\n const startSpan = hasStart\n ? this.clampSpan(config.layout?.startSpan ?? DEFAULT_SIDE_CONTENT_SPAN)\n : 0;\n let endSpan = hasEnd\n ? this.clampSpan(config.layout?.endSpan ?? DEFAULT_SIDE_CONTENT_SPAN)\n : 0;\n\n if (startSpan + endSpan >= DEFAULT_GRID_COLUMNS) {\n endSpan = Math.max(0, DEFAULT_GRID_COLUMNS - startSpan - 1);\n }\n\n const availableForTable = Math.max(\n 1,\n DEFAULT_GRID_COLUMNS - startSpan - endSpan,\n );\n const tableSpan = this.clampSpan(\n config.layout?.tableSpan ?? availableForTable,\n 1,\n availableForTable,\n );\n\n return {\n startSpan,\n tableSpan,\n endSpan,\n };\n }\n\n private clampSpan(\n value: number | undefined,\n min = 0,\n max = DEFAULT_GRID_COLUMNS,\n ): number {\n const normalized = Number(value ?? min);\n if (!Number.isFinite(normalized)) return min;\n return Math.min(max, Math.max(min, Math.trunc(normalized)));\n }\n}\n","<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <mt-card [title]=\"table.title || table.moduleKey || 'Table'\" class=\"w-full\">\n @if (table.config.collapse.enabled) {\n <ng-template #cardEnd>\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n size=\"small\"\n [icon]=\"\n table.expanded\n ? table.config.collapse.collapseIcon\n : table.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(table.key)\"\n />\n </ng-template>\n }\n\n @if (table.expanded) {\n <div\n class=\"grid gap-4\"\n [style.gridTemplateColumns]=\"gridTemplateColumns\"\n >\n @if (table.config.contentStart) {\n <div\n [style.gridColumn]=\"slotGridSpan(table.config.layout.startSpan)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.tableSpan)\">\n @if (table.loading && table.rows.length === 0) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n </div>\n } @else if (table.error) {\n <div\n class=\"p-3 rounded-lg bg-red-50 text-red-700 border border-red-200 text-sm\"\n >\n {{ table.error }}\n </div>\n } @else {\n <mt-table\n [data]=\"table.rows\"\n [columns]=\"table.columns\"\n [loading]=\"table.loading\"\n [lazy]=\"table.config.isPaginated\"\n [lazyTotalRecords]=\"table.totalCount\"\n [pageSize]=\"table.config.isPaginated ? table.take : 10\"\n [first]=\"table.config.isPaginated ? table.skip : 0\"\n (lazyLoad)=\"onLazyLoad(table.key, $event)\"\n />\n }\n </div>\n\n @if (table.config.contentEnd) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.endSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n }\n </mt-card>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAUa,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IACzB,OAAO,GAAG,aAAa;AAExC,IAAA,OAAO,CACL,OAAe,EACf,WAAmB,EACnB,QAAgB,EAChB,KAAsB,EAAA;AAEtB,QAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,IAAI,CAAC,OAAO,CAAA,OAAA,EAAU,OAAO,CAAA,YAAA,EAAe,WAAW,CAAA,QAAA,EAAW,QAAQ,OAAO;AACrG,QAAA,IAAI,MAAM,GAAG,IAAI,UAAU;AACxB,aAAA,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;AACtB,aAAA,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;AACtB,aAAA,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IA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|
+
{"version":3,"file":"masterteam-client-components-client-list.mjs","sources":["../../../../packages/masterteam/client-components/client-list/services/client-list-api.service.ts","../../../../packages/masterteam/client-components/client-list/services/client-list-state.service.ts","../../../../packages/masterteam/client-components/client-list/client-list.ts","../../../../packages/masterteam/client-components/client-list/client-list.html","../../../../packages/masterteam/client-components/client-list/masterteam-client-components-client-list.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { HttpClient, HttpParams } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport {\n ClientListQuery,\n Response,\n RuntimeTableRowsResponse,\n} from '../models/client-list.model';\n\n@Injectable({ providedIn: 'root' })\nexport class ClientListApiService {\n private readonly http = inject(HttpClient);\n private readonly baseUrl = 'data/tables';\n\n getRows(\n levelId: number,\n levelDataId: number,\n moduleId: number,\n query: ClientListQuery,\n ): Observable<Response<RuntimeTableRowsResponse>> {\n const endpoint = `${this.baseUrl}/level/${levelId}/level-data/${levelDataId}/module/${moduleId}/rows`;\n let params = new HttpParams()\n .set('mode', query.mode)\n .set('skip', query.skip)\n .set('take', query.take);\n\n (query.columnKeys ?? []).forEach((columnKey) => {\n params = params.append('columnKeys', columnKey);\n });\n\n return this.http.get<Response<RuntimeTableRowsResponse>>(endpoint, {\n params,\n });\n }\n}\n","import { Injectable, computed, signal } from '@angular/core';\nimport {\n NormalizedClientListConfiguration,\n ClientListTableState,\n RuntimeTableRowsResponse,\n} from '../models/client-list.model';\nimport { ColumnDef } from '@masterteam/components/table';\n\n@Injectable()\nexport class ClientListStateService {\n readonly tablesByKey = signal<Record<string, ClientListTableState>>({});\n\n readonly tables = computed<ClientListTableState[]>(() =>\n Object.values(this.tablesByKey()).sort((a, b) =>\n a.config.moduleId === b.config.moduleId\n ? a.config.levelDataId - b.config.levelDataId\n : a.config.moduleId - b.config.moduleId,\n ),\n );\n\n setConfigs(configs: ClientListTableState[]): void {\n const next: Record<string, ClientListTableState> = {};\n configs.forEach((table) => {\n const current = this.tablesByKey()[table.key];\n next[table.key] = {\n ...table,\n loading: current?.loading ?? false,\n error: current?.error ?? null,\n title: current?.title ?? table.title,\n moduleKey: current?.moduleKey ?? table.moduleKey,\n columns: current?.columns ?? table.columns,\n rows: current?.rows ?? table.rows,\n skip: current?.skip ?? table.skip,\n take: current?.take ?? table.take,\n totalCount: current?.totalCount ?? table.totalCount,\n expanded: current?.expanded ?? table.expanded,\n };\n });\n this.tablesByKey.set(next);\n }\n\n setLoading(key: string, loading: boolean): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n loading,\n },\n });\n }\n\n setError(key: string, message: string | null): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n error: message,\n },\n });\n }\n\n setRowsResult(\n key: string,\n response: RuntimeTableRowsResponse,\n config: NormalizedClientListConfiguration,\n skip: number,\n take: number,\n ): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n\n const columns = this.toColumnDefs(response.columns);\n const rows = response.rows ?? [];\n const title = (config.title ?? '').trim() || response.moduleKey;\n const totalCount =\n config.isPaginated === false\n ? rows.length\n : (response.pagination?.totalCount ?? rows.length);\n\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n title,\n moduleKey: response.moduleKey ?? '',\n columns,\n rows,\n skip,\n take,\n totalCount,\n error: null,\n },\n });\n }\n\n toggleExpanded(key: string): void {\n const target = this.tablesByKey()[key];\n if (!target) return;\n this.tablesByKey.set({\n ...this.tablesByKey(),\n [key]: {\n ...target,\n expanded: !target.expanded,\n },\n });\n }\n\n private toColumnDefs(\n columns: RuntimeTableRowsResponse['columns'],\n ): ColumnDef[] {\n return (columns ?? [])\n .filter((column) => column.isVisible)\n .sort((a, b) => a.order - b.order)\n .map((column) => ({\n key: column.columnKey,\n label: this.toLabel(column.columnKey),\n }));\n }\n\n private toLabel(key: string): string {\n return key\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word[0].toUpperCase() + word.slice(1))\n .join(' ');\n }\n}\n","import {\n Component,\n effect,\n inject,\n input,\n output,\n untracked,\n OnDestroy,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Subscription } from 'rxjs';\nimport { Table } from '@masterteam/components/table';\nimport { Button } from '@masterteam/components/button';\nimport { SkeletonModule } from 'primeng/skeleton';\nimport { ClientListApiService } from './services/client-list-api.service';\nimport { ClientListStateService } from './services/client-list-state.service';\nimport {\n ClientListConfiguration,\n ClientListContentTemplateContext,\n ClientListLazyLoadEvent,\n ClientListLayoutConfig,\n ClientListMode,\n NormalizedClientListConfiguration,\n ClientListQuery,\n ClientListTableState,\n} from './models/client-list.model';\nimport { Card } from '@masterteam/components/card';\n\nconst DEFAULT_MODE: ClientListMode = 'auto';\nconst DEFAULT_SERVER_PAGE_SIZE = 50;\nconst LOCAL_PAGE_SIZE_SOURCE = 100000;\nconst DEFAULT_COLLAPSE_ICON = 'arrow.chevron-up';\nconst DEFAULT_EXPAND_ICON = 'arrow.chevron-down';\nconst DEFAULT_SIDE_CONTENT_SPAN = 3;\nconst DEFAULT_GRID_COLUMNS = 12;\n\n@Component({\n selector: 'mt-client-list',\n standalone: true,\n imports: [CommonModule, Card, Table, Button, SkeletonModule],\n providers: [ClientListStateService],\n templateUrl: './client-list.html',\n})\nexport class ClientList implements OnDestroy {\n private readonly api = inject(ClientListApiService);\n protected readonly state = inject(ClientListStateService);\n\n readonly configurations = input.required<ClientListConfiguration[]>();\n readonly defaultTake = input(DEFAULT_SERVER_PAGE_SIZE);\n\n readonly loaded = output<string>();\n readonly errored = output<{ key: string; message: string }>();\n\n protected readonly tables = this.state.tables;\n protected readonly gridTemplateColumns = `repeat(${DEFAULT_GRID_COLUMNS}, minmax(0, 1fr))`;\n private readonly subscriptions = new Map<string, Subscription>();\n private readonly inFlightRequestSignatures = new Map<string, string>();\n private readonly fulfilledRequestSignatures = new Map<string, string>();\n\n constructor() {\n effect(() => {\n const configs = this.configurations();\n untracked(() => this.configureTables(configs));\n\n untracked(() => {\n this.state.tables().forEach((table) => {\n this.loadTable(table.key, table.config, table.skip, table.take);\n });\n });\n });\n }\n\n onLazyLoad(tableKey: string, event: ClientListLazyLoadEvent): void {\n const table = this.state.tablesByKey()[tableKey];\n if (!table || !table.config.isPaginated) return;\n\n const take = Number(event.pageSize ?? table.take);\n const skip = Number(event.first ?? 0);\n this.loadTable(table.key, table.config, skip, take);\n }\n\n reload(tableKey?: string): void {\n if (tableKey) {\n this.reloadByKey(tableKey);\n return;\n }\n\n this.tables().forEach((table) => {\n this.loadTable(table.key, table.config, table.skip, table.take, true);\n });\n }\n\n reloadByKey(tableKey: string): void {\n const table = this.state.tablesByKey()[tableKey];\n if (!table) return;\n\n this.loadTable(table.key, table.config, table.skip, table.take, true);\n }\n\n toggleExpanded(key: string): void {\n this.state.toggleExpanded(key);\n }\n\n slotGridSpan(span: number): string {\n return `span ${span} / span ${span}`;\n }\n\n templateContext(\n table: ClientListTableState,\n ): ClientListContentTemplateContext {\n return {\n $implicit: table,\n table,\n };\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((sub) => sub.unsubscribe());\n this.subscriptions.clear();\n }\n\n private configureTables(configs: ClientListConfiguration[]): void {\n const previousTables = this.state.tablesByKey();\n const hasMultipleConfigs = (configs ?? []).length > 1;\n const normalized: ClientListTableState[] = (configs ?? []).map(\n (config, index) => {\n const mode = this.resolveMode(config.mode, config.columnKeys);\n const isPaginated = config.isPaginated ?? true;\n const take = isPaginated\n ? (config.take ?? this.defaultTake())\n : LOCAL_PAGE_SIZE_SOURCE;\n const collapseEnabled =\n (config.collapse?.enabled ?? true) && hasMultipleConfigs;\n const layout = this.resolveLayout(config);\n const key =\n config.key ??\n `${config.levelId ?? 'x'}-${config.levelDataId ?? 'x'}-${config.moduleId ?? 'x'}-${index}`;\n const current = previousTables[key];\n return {\n key,\n config: this.toNormalizedConfig(\n config,\n mode,\n isPaginated,\n take,\n collapseEnabled,\n layout,\n ),\n loading: false,\n error: null,\n title: config.title?.trim() || '',\n moduleKey: '',\n columns: [],\n rows: [],\n skip: current?.skip ?? 0,\n take,\n totalCount: 0,\n expanded: config.collapse?.expandedByDefault ?? true,\n };\n },\n );\n\n this.state.setConfigs(normalized);\n this.cleanupStaleResources(new Set(normalized.map((table) => table.key)));\n }\n\n private loadTable(\n key: string,\n config: NormalizedClientListConfiguration,\n skip: number,\n take: number,\n force = false,\n ): void {\n if (!this.hasValidIdentifiers(config)) {\n this.state.setLoading(key, false);\n this.state.setError(\n key,\n 'Missing identifiers: levelId, levelDataId and moduleId are required',\n );\n return;\n }\n\n const query = this.toQuery(config, skip, take);\n const requestSignature = this.createRequestSignature(config, query);\n\n if (force) {\n this.inFlightRequestSignatures.delete(key);\n this.fulfilledRequestSignatures.delete(key);\n } else if (\n this.inFlightRequestSignatures.get(key) === requestSignature ||\n this.fulfilledRequestSignatures.get(key) === requestSignature\n ) {\n return;\n }\n\n this.subscriptions.get(key)?.unsubscribe();\n this.inFlightRequestSignatures.set(key, requestSignature);\n this.state.setLoading(key, true);\n this.state.setError(key, null);\n\n const sub = this.api\n .getRows(config.levelId, config.levelDataId, config.moduleId, query)\n .subscribe({\n next: (response) => {\n if (response.data) {\n this.state.setRowsResult(\n key,\n response.data,\n config,\n query.skip,\n query.take,\n );\n this.fulfilledRequestSignatures.set(key, requestSignature);\n this.loaded.emit(key);\n } else {\n const message = response.message ?? 'Failed to load table rows';\n this.state.setError(key, message);\n this.errored.emit({ key, message });\n }\n this.state.setLoading(key, false);\n this.inFlightRequestSignatures.delete(key);\n },\n error: (error) => {\n const message =\n error?.error?.message ?? error?.message ?? 'Failed to load rows';\n this.state.setError(key, message);\n this.state.setLoading(key, false);\n this.inFlightRequestSignatures.delete(key);\n this.errored.emit({ key, message });\n },\n });\n\n this.subscriptions.set(key, sub);\n }\n\n private resolveMode(\n mode: ClientListMode | undefined,\n columnKeys: string[] | undefined,\n ): ClientListMode {\n if (mode !== 'override') return DEFAULT_MODE;\n return (columnKeys ?? []).length > 0 ? 'override' : DEFAULT_MODE;\n }\n\n private toNormalizedConfig(\n config: ClientListConfiguration,\n mode: ClientListMode,\n isPaginated: boolean,\n take: number,\n collapseEnabled: boolean,\n layout: Required<ClientListLayoutConfig>,\n ): NormalizedClientListConfiguration {\n return {\n levelId: config.levelId as number,\n levelDataId: config.levelDataId as number,\n moduleId: config.moduleId as number,\n mode,\n isPaginated,\n take,\n title: config.title,\n columnKeys: config.columnKeys ?? [],\n headerStart: config.headerStart,\n headerEnd: config.headerEnd,\n contentStart: config.contentStart,\n contentEnd: config.contentEnd,\n collapse: {\n enabled: collapseEnabled,\n expandedByDefault: config.collapse?.expandedByDefault ?? true,\n collapseIcon: config.collapse?.collapseIcon ?? DEFAULT_COLLAPSE_ICON,\n expandIcon: config.collapse?.expandIcon ?? DEFAULT_EXPAND_ICON,\n },\n layout,\n };\n }\n\n private resolveLayout(\n config: ClientListConfiguration,\n ): Required<ClientListLayoutConfig> {\n const hasStart = !!config.contentStart;\n const hasEnd = !!config.contentEnd;\n\n const startSpan = hasStart\n ? this.clampSpan(config.layout?.startSpan ?? DEFAULT_SIDE_CONTENT_SPAN)\n : 0;\n let endSpan = hasEnd\n ? this.clampSpan(config.layout?.endSpan ?? DEFAULT_SIDE_CONTENT_SPAN)\n : 0;\n\n if (startSpan + endSpan >= DEFAULT_GRID_COLUMNS) {\n endSpan = Math.max(0, DEFAULT_GRID_COLUMNS - startSpan - 1);\n }\n\n const availableForTable = Math.max(\n 1,\n DEFAULT_GRID_COLUMNS - startSpan - endSpan,\n );\n const tableSpan = this.clampSpan(\n config.layout?.tableSpan ?? availableForTable,\n 1,\n availableForTable,\n );\n\n return {\n startSpan,\n tableSpan,\n endSpan,\n };\n }\n\n private clampSpan(\n value: number | undefined,\n min = 0,\n max = DEFAULT_GRID_COLUMNS,\n ): number {\n const normalized = Number(value ?? min);\n if (!Number.isFinite(normalized)) return min;\n return Math.min(max, Math.max(min, Math.trunc(normalized)));\n }\n\n private cleanupStaleResources(activeKeys: Set<string>): void {\n for (const [key, sub] of this.subscriptions.entries()) {\n if (!activeKeys.has(key)) {\n sub.unsubscribe();\n this.subscriptions.delete(key);\n this.inFlightRequestSignatures.delete(key);\n this.fulfilledRequestSignatures.delete(key);\n }\n }\n }\n\n private toQuery(\n config: NormalizedClientListConfiguration,\n skip: number,\n take: number,\n ): ClientListQuery {\n return {\n mode: config.mode,\n columnKeys: config.mode === 'override' ? config.columnKeys : undefined,\n skip: config.isPaginated ? skip : 0,\n take: config.isPaginated ? take : LOCAL_PAGE_SIZE_SOURCE,\n };\n }\n\n private createRequestSignature(\n config: NormalizedClientListConfiguration,\n query: ClientListQuery,\n ): string {\n return [\n config.levelId,\n config.levelDataId,\n config.moduleId,\n query.mode,\n query.skip,\n query.take,\n ...(query.columnKeys ?? []),\n ].join('|');\n }\n\n private hasValidIdentifiers(config: NormalizedClientListConfiguration): boolean {\n return (\n Number.isFinite(config.levelId) &&\n config.levelId > 0 &&\n Number.isFinite(config.levelDataId) &&\n config.levelDataId > 0 &&\n Number.isFinite(config.moduleId) &&\n config.moduleId > 0\n );\n }\n}\n","<div class=\"flex flex-col gap-4\">\n @for (table of tables(); track table.key) {\n <section class=\"flex flex-col gap-4\">\n <div class=\"flex w-full items-center gap-2\">\n <div class=\"flex min-w-0 flex-1 items-center gap-2\">\n @if (table.config.collapse.enabled) {\n <mt-button\n variant=\"text\"\n severity=\"secondary\"\n [icon]=\"\n table.expanded\n ? table.config.collapse.collapseIcon\n : table.config.collapse.expandIcon\n \"\n (onClick)=\"toggleExpanded(table.key)\"\n />\n }\n <h3 class=\"m-0 text-lg font-bold\">\n {{ table.title || table.moduleKey || 'Table' }}\n </h3>\n @if (table.config.headerStart) {\n <div class=\"flex items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n @if (table.config.headerEnd) {\n <div class=\"ml-auto flex shrink-0 items-center gap-2\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.headerEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n\n @if (table.expanded || !table.config.collapse.enabled) {\n <div\n class=\"grid gap-4\"\n [style.gridTemplateColumns]=\"gridTemplateColumns\"\n >\n @if (table.config.contentStart) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.startSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentStart\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.tableSpan)\">\n <mt-card>\n @if (table.loading && table.rows.length === 0) {\n <div class=\"flex flex-col gap-3 py-3\">\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n <p-skeleton height=\"3rem\" />\n </div>\n } @else if (table.error) {\n <div\n class=\"p-3 rounded-lg bg-red-50 text-red-700 border border-red-200 text-sm\"\n >\n {{ table.error }}\n </div>\n } @else {\n <mt-table\n [data]=\"table.rows\"\n [columns]=\"table.columns\"\n [loading]=\"table.loading\"\n [lazy]=\"table.config.isPaginated\"\n [lazyTotalRecords]=\"table.totalCount\"\n [pageSize]=\"table.config.isPaginated ? table.take : 10\"\n (lazyLoad)=\"onLazyLoad(table.key, $event)\"\n />\n }\n </mt-card>\n </div>\n\n @if (table.config.contentEnd) {\n <div [style.gridColumn]=\"slotGridSpan(table.config.layout.endSpan)\">\n <ng-container\n [ngTemplateOutlet]=\"table.config.contentEnd\"\n [ngTemplateOutletContext]=\"templateContext(table)\"\n />\n </div>\n }\n </div>\n }\n </section>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAUa,oBAAoB,CAAA;AACd,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAA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AAA,EACjD,CAAC,sBAAsB,CAAC,EAAA,QAAA,EAAA,+8GAAA,EAAA;;;AExCrC;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -26,6 +26,8 @@ interface ClientListConfiguration {
|
|
|
26
26
|
take?: number;
|
|
27
27
|
collapse?: ClientListCollapseConfig;
|
|
28
28
|
layout?: ClientListLayoutConfig;
|
|
29
|
+
headerStart?: TemplateRef<ClientListContentTemplateContext>;
|
|
30
|
+
headerEnd?: TemplateRef<ClientListContentTemplateContext>;
|
|
29
31
|
contentStart?: TemplateRef<ClientListContentTemplateContext>;
|
|
30
32
|
contentEnd?: TemplateRef<ClientListContentTemplateContext>;
|
|
31
33
|
}
|
|
@@ -97,6 +99,8 @@ interface NormalizedClientListConfiguration {
|
|
|
97
99
|
columnKeys: string[];
|
|
98
100
|
collapse: Required<ClientListCollapseConfig>;
|
|
99
101
|
layout: Required<ClientListLayoutConfig>;
|
|
102
|
+
headerStart?: TemplateRef<ClientListContentTemplateContext>;
|
|
103
|
+
headerEnd?: TemplateRef<ClientListContentTemplateContext>;
|
|
100
104
|
contentStart?: TemplateRef<ClientListContentTemplateContext>;
|
|
101
105
|
contentEnd?: TemplateRef<ClientListContentTemplateContext>;
|
|
102
106
|
}
|
|
@@ -137,8 +141,12 @@ declare class ClientList implements OnDestroy {
|
|
|
137
141
|
protected readonly tables: _angular_core.Signal<ClientListTableState[]>;
|
|
138
142
|
protected readonly gridTemplateColumns = "repeat(12, minmax(0, 1fr))";
|
|
139
143
|
private readonly subscriptions;
|
|
144
|
+
private readonly inFlightRequestSignatures;
|
|
145
|
+
private readonly fulfilledRequestSignatures;
|
|
140
146
|
constructor();
|
|
141
147
|
onLazyLoad(tableKey: string, event: ClientListLazyLoadEvent): void;
|
|
148
|
+
reload(tableKey?: string): void;
|
|
149
|
+
reloadByKey(tableKey: string): void;
|
|
142
150
|
toggleExpanded(key: string): void;
|
|
143
151
|
slotGridSpan(span: number): string;
|
|
144
152
|
templateContext(table: ClientListTableState): ClientListContentTemplateContext;
|
|
@@ -149,6 +157,10 @@ declare class ClientList implements OnDestroy {
|
|
|
149
157
|
private toNormalizedConfig;
|
|
150
158
|
private resolveLayout;
|
|
151
159
|
private clampSpan;
|
|
160
|
+
private cleanupStaleResources;
|
|
161
|
+
private toQuery;
|
|
162
|
+
private createRequestSignature;
|
|
163
|
+
private hasValidIdentifiers;
|
|
152
164
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClientList, never>;
|
|
153
165
|
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>;
|
|
154
166
|
}
|