@dmytrokhylko/tb-cdu-ui 0.1.1

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/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # TbUi
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build tb-ui
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/tb-ui
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,586 @@
1
+ import { SelectionModel } from '@angular/cdk/collections';
2
+ import * as i6 from '@angular/cdk/scrolling';
3
+ import { CdkScrollableModule } from '@angular/cdk/scrolling';
4
+ import * as i1$1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i0 from '@angular/core';
7
+ import { input, computed, Component, model, output, signal, viewChild, inject, Injector, DestroyRef, effect, untracked, afterNextRender, ChangeDetectionStrategy } from '@angular/core';
8
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
9
+ import * as i14 from '@angular/forms';
10
+ import { FormControl } from '@angular/forms';
11
+ import * as i3 from '@angular/material/checkbox';
12
+ import { MatCheckboxModule } from '@angular/material/checkbox';
13
+ import * as i10 from '@angular/material/table';
14
+ import { MatTable } from '@angular/material/table';
15
+ import { PageLink, Direction, SharedModule, EntityKeyType } from '@shared/public-api';
16
+ import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
17
+ import * as i1 from '@angular/material/progress-spinner';
18
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
19
+ import * as i2 from '@ngx-translate/core';
20
+ import { TranslateModule } from '@ngx-translate/core';
21
+ import * as i2$1 from '@angular/material/button';
22
+ import { MatButtonModule } from '@angular/material/button';
23
+ import * as i4 from '@angular/material/icon';
24
+ import { MatIconModule } from '@angular/material/icon';
25
+ import * as i5 from '@angular/material/input';
26
+ import * as i7 from '@angular/material/toolbar';
27
+ import * as i8 from '@angular/material/menu';
28
+ import * as i9 from '@angular/material/tooltip';
29
+ import * as i11 from '@angular/material/paginator';
30
+ import * as i12 from '@angular/material/sort';
31
+ import * as i13 from '@angular/material/divider';
32
+ import { findEntityKeyByColumnDef } from '@home/components/public-api';
33
+
34
+ const DEFAULT_PAGE_LINK_PAGE_SIZE = 20;
35
+ const DEFAULT_PAGE_SIZES = [
36
+ DEFAULT_PAGE_LINK_PAGE_SIZE,
37
+ DEFAULT_PAGE_LINK_PAGE_SIZE * 5,
38
+ DEFAULT_PAGE_LINK_PAGE_SIZE * 10,
39
+ ];
40
+
41
+ var LoadingPhase;
42
+ (function (LoadingPhase) {
43
+ LoadingPhase["IDLE"] = "idle";
44
+ LoadingPhase["GENERATING"] = "generating";
45
+ LoadingPhase["POLLING"] = "polling";
46
+ LoadingPhase["FETCHING"] = "fetching";
47
+ })(LoadingPhase || (LoadingPhase = {}));
48
+ const getLoadingState = {
49
+ idle: () => ({ phase: LoadingPhase.IDLE }),
50
+ generating: () => ({ phase: LoadingPhase.GENERATING }),
51
+ polling: (processed, total) => ({
52
+ phase: LoadingPhase.POLLING,
53
+ processed,
54
+ total,
55
+ }),
56
+ fetching: () => ({ phase: LoadingPhase.FETCHING }),
57
+ };
58
+
59
+ class LoadingOverlayComponent {
60
+ state = input.required(...(ngDevMode ? [{ debugName: "state" }] : []));
61
+ mode = input('determinate', ...(ngDevMode ? [{ debugName: "mode" }] : []));
62
+ generating = input('loading.generating', ...(ngDevMode ? [{ debugName: "generating" }] : []));
63
+ processingDeterminate = input('loading.polling.determinate', ...(ngDevMode ? [{ debugName: "processingDeterminate" }] : []));
64
+ processingIndeterminate = input('loading.polling.indeterminate', ...(ngDevMode ? [{ debugName: "processingIndeterminate" }] : []));
65
+ fetching = input('loading.fetching', ...(ngDevMode ? [{ debugName: "fetching" }] : []));
66
+ LoadingPhase = LoadingPhase;
67
+ spinnerMode = computed(() => {
68
+ if (this.state().phase !== LoadingPhase.POLLING || this.mode() !== 'determinate') {
69
+ return 'indeterminate';
70
+ }
71
+ return this.percentage() > 0 ? 'determinate' : 'indeterminate';
72
+ }, ...(ngDevMode ? [{ debugName: "spinnerMode" }] : []));
73
+ percentage = computed(() => {
74
+ const state = this.state();
75
+ return state.phase === LoadingPhase.POLLING && state.total > 0
76
+ ? Math.floor((state.processed / state.total) * 100)
77
+ : 0;
78
+ }, ...(ngDevMode ? [{ debugName: "percentage" }] : []));
79
+ pollingProcessed = computed(() => {
80
+ const state = this.state();
81
+ return state.phase === LoadingPhase.POLLING ? state.processed : 0;
82
+ }, ...(ngDevMode ? [{ debugName: "pollingProcessed" }] : []));
83
+ pollingTotal = computed(() => {
84
+ const state = this.state();
85
+ return state.phase === LoadingPhase.POLLING ? state.total : 0;
86
+ }, ...(ngDevMode ? [{ debugName: "pollingTotal" }] : []));
87
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: LoadingOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
88
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: LoadingOverlayComponent, isStandalone: true, selector: "tb-loading-overlay", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, generating: { classPropertyName: "generating", publicName: "generating", isSignal: true, isRequired: false, transformFunction: null }, processingDeterminate: { classPropertyName: "processingDeterminate", publicName: "processingDeterminate", isSignal: true, isRequired: false, transformFunction: null }, processingIndeterminate: { classPropertyName: "processingIndeterminate", publicName: "processingIndeterminate", isSignal: true, isRequired: false, transformFunction: null }, fetching: { classPropertyName: "fetching", publicName: "fetching", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"loading-overlay\">\n <mat-spinner diameter=\"50\" [mode]=\"spinnerMode()\" [value]=\"percentage()\"></mat-spinner>\n <span class=\"loading-text\">\n @switch (state().phase) {\n @case (LoadingPhase.POLLING) {\n @if (spinnerMode() === 'determinate') {\n {{ processingDeterminate() | translate }} {{ pollingProcessed() }}/{{ pollingTotal() }}\n } @else {\n {{ processingIndeterminate() | translate }}\n }\n }\n @case (LoadingPhase.GENERATING) {\n {{ generating() | translate }}\n }\n @case (LoadingPhase.FETCHING) {\n {{ fetching() | translate }}\n }\n }\n </span>\n</div>\n", styles: [".loading-overlay{position:absolute;inset:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:#ffffffb3;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}.loading-text{margin-top:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:500}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] });
89
+ }
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: LoadingOverlayComponent, decorators: [{
91
+ type: Component,
92
+ args: [{ standalone: true, imports: [TranslateModule, MatProgressSpinnerModule], selector: 'tb-loading-overlay', template: "<div class=\"loading-overlay\">\n <mat-spinner diameter=\"50\" [mode]=\"spinnerMode()\" [value]=\"percentage()\"></mat-spinner>\n <span class=\"loading-text\">\n @switch (state().phase) {\n @case (LoadingPhase.POLLING) {\n @if (spinnerMode() === 'determinate') {\n {{ processingDeterminate() | translate }} {{ pollingProcessed() }}/{{ pollingTotal() }}\n } @else {\n {{ processingIndeterminate() | translate }}\n }\n }\n @case (LoadingPhase.GENERATING) {\n {{ generating() | translate }}\n }\n @case (LoadingPhase.FETCHING) {\n {{ fetching() | translate }}\n }\n }\n </span>\n</div>\n", styles: [".loading-overlay{position:absolute;inset:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;background-color:#ffffffb3;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}.loading-text{margin-top:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:500}\n"] }]
93
+ }], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], generating: [{ type: i0.Input, args: [{ isSignal: true, alias: "generating", required: false }] }], processingDeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "processingDeterminate", required: false }] }], processingIndeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "processingIndeterminate", required: false }] }], fetching: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetching", required: false }] }] } });
94
+
95
+ class BaseTableComponent {
96
+ dataSource = input.required(...(ngDevMode ? [{ debugName: "dataSource" }] : []));
97
+ columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : []));
98
+ displayedColumns = input.required(...(ngDevMode ? [{ debugName: "displayedColumns" }] : []));
99
+ loadingState = input.required(...(ngDevMode ? [{ debugName: "loadingState" }] : []));
100
+ widgetTitle = input('widget.widget-title', ...(ngDevMode ? [{ debugName: "widgetTitle" }] : []));
101
+ noDataMessage = input('entity.no-data', ...(ngDevMode ? [{ debugName: "noDataMessage" }] : []));
102
+ totalElements = input(0, ...(ngDevMode ? [{ debugName: "totalElements" }] : []));
103
+ pageSizeOptions = input(DEFAULT_PAGE_SIZES, ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
104
+ selectionEnabled = input(false, ...(ngDevMode ? [{ debugName: "selectionEnabled" }] : []));
105
+ rowActions = input([], ...(ngDevMode ? [{ debugName: "rowActions" }] : []));
106
+ headerActions = input([], ...(ngDevMode ? [{ debugName: "headerActions" }] : []));
107
+ bulkActions = input([], ...(ngDevMode ? [{ debugName: "bulkActions" }] : []));
108
+ expandable = input(false, ...(ngDevMode ? [{ debugName: "expandable" }] : []));
109
+ expandedRowTemplate = input(null, ...(ngDevMode ? [{ debugName: "expandedRowTemplate" }] : []));
110
+ expansionTrackBy = input((entity) => entity, ...(ngDevMode ? [{ debugName: "expansionTrackBy" }] : []));
111
+ selectionTrackBy = input((entity) => entity, ...(ngDevMode ? [{ debugName: "selectionTrackBy" }] : []));
112
+ clearSelectionTrigger = input(undefined, ...(ngDevMode ? [{ debugName: "clearSelectionTrigger" }] : []));
113
+ pageLink = model(new PageLink(this.pageSizeOptions()[0]), ...(ngDevMode ? [{ debugName: "pageLink" }] : []));
114
+ rowClick = output();
115
+ cellClick = output();
116
+ actionClick = output();
117
+ headerActionClick = output();
118
+ bulkActionClick = output();
119
+ selectionChange = output();
120
+ expansionChange = output();
121
+ textSearchMode = signal(false, ...(ngDevMode ? [{ debugName: "textSearchMode" }] : []));
122
+ selection = new SelectionModel(true, []);
123
+ expandedKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "expandedKeys" }] : []));
124
+ lastExpandedKey = signal(null, ...(ngDevMode ? [{ debugName: "lastExpandedKey" }] : []));
125
+ detailRowColumns = computed(() => ['expandedDetail'], ...(ngDevMode ? [{ debugName: "detailRowColumns" }] : []));
126
+ selectionCount = signal(0, ...(ngDevMode ? [{ debugName: "selectionCount" }] : []));
127
+ isLoadingState = computed(() => {
128
+ return this.loadingState().phase === LoadingPhase.GENERATING || this.loadingState().phase === LoadingPhase.POLLING;
129
+ }, ...(ngDevMode ? [{ debugName: "isLoadingState" }] : []));
130
+ toolbarMode = computed(() => {
131
+ if (this.selectionEnabled() && this.selectionCount() > 0)
132
+ return 'bulk';
133
+ if (this.textSearchMode())
134
+ return 'search';
135
+ return 'default';
136
+ }, ...(ngDevMode ? [{ debugName: "toolbarMode" }] : []));
137
+ effectiveDisplayedColumns = computed(() => {
138
+ const cols = [...this.displayedColumns()];
139
+ if (this.selectionEnabled())
140
+ cols.unshift('select');
141
+ if (this.rowActions().length > 0 || this.expandable())
142
+ cols.push('actions');
143
+ return cols;
144
+ }, ...(ngDevMode ? [{ debugName: "effectiveDisplayedColumns" }] : []));
145
+ visibleHeaderActions = computed(() => this.headerActions().filter((action) => !action.visible || action.visible()), ...(ngDevMode ? [{ debugName: "visibleHeaderActions" }] : []));
146
+ visibleBulkActions = computed(() => this.bulkActions().filter((action) => !action.visible || action.visible()), ...(ngDevMode ? [{ debugName: "visibleBulkActions" }] : []));
147
+ pageLinkSortDirection = computed(() => {
148
+ const order = this.pageLink().sortOrder;
149
+ return order && order.direction ? order.direction.toLowerCase() : '';
150
+ }, ...(ngDevMode ? [{ debugName: "pageLinkSortDirection" }] : []));
151
+ searchControl = new FormControl('', { nonNullable: true });
152
+ searchInputField = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInputField" }] : []));
153
+ table = viewChild((MatTable), ...(ngDevMode ? [{ debugName: "table" }] : []));
154
+ tableScrollContainer = viewChild('tableScrollContainer', ...(ngDevMode ? [{ debugName: "tableScrollContainer" }] : []));
155
+ LoadingPhase = LoadingPhase;
156
+ injector = inject(Injector);
157
+ destroyRef = inject(DestroyRef);
158
+ constructor() {
159
+ effect(() => {
160
+ const data = this.dataSource();
161
+ untracked(() => {
162
+ this.reconcileSelection(data);
163
+ this.reconcileExpansion(data);
164
+ });
165
+ });
166
+ let clearSelectionInitialized = false;
167
+ effect(() => {
168
+ this.clearSelectionTrigger();
169
+ if (!clearSelectionInitialized) {
170
+ clearSelectionInitialized = true;
171
+ return;
172
+ }
173
+ untracked(() => this.selection.clear());
174
+ });
175
+ this.selection.changed.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
176
+ this.selectionCount.set(this.selection.selected.length);
177
+ this.selectionChange.emit(this.selection.selected);
178
+ });
179
+ }
180
+ ngAfterViewInit() {
181
+ if (this.pageLink().textSearch) {
182
+ this.searchControl.patchValue(this.pageLink().textSearch, { emitEvent: false });
183
+ }
184
+ this.searchControl.valueChanges
185
+ .pipe(debounceTime(300), distinctUntilChanged((prev, current) => (this.pageLink().textSearch ?? '') === current.trim()), takeUntilDestroyed(this.destroyRef))
186
+ .subscribe((searchValue) => {
187
+ const current = this.clone(this.pageLink());
188
+ current.textSearch = searchValue.trim();
189
+ current.page = 0;
190
+ this.pageLink.set(current);
191
+ });
192
+ }
193
+ onPaginate(event) {
194
+ const current = this.clone(this.pageLink());
195
+ current.page = event.pageIndex;
196
+ current.pageSize = event.pageSize;
197
+ this.pageLink.set(current);
198
+ }
199
+ onSort(event) {
200
+ const current = this.clone(this.pageLink());
201
+ current.sortOrder = event.direction
202
+ ? { property: event.active, direction: Direction[event.direction.toUpperCase()] }
203
+ : undefined;
204
+ current.page = 0;
205
+ this.pageLink.set(current);
206
+ }
207
+ enterFilterMode() {
208
+ this.textSearchMode.set(true);
209
+ afterNextRender(() => {
210
+ const input = this.searchInputField()?.nativeElement;
211
+ if (input) {
212
+ input.focus();
213
+ input.setSelectionRange(0, 0);
214
+ }
215
+ }, { injector: this.injector });
216
+ }
217
+ exitFilterMode() {
218
+ this.textSearchMode.set(false);
219
+ this.searchControl.reset();
220
+ }
221
+ isAllSelected() {
222
+ return this.selection.selected.length === this.dataSource().length && this.dataSource().length > 0;
223
+ }
224
+ isIndeterminate() {
225
+ return this.selection.selected.length > 0 && !this.isAllSelected();
226
+ }
227
+ masterToggle() {
228
+ if (this.isAllSelected()) {
229
+ this.selection.clear();
230
+ }
231
+ else {
232
+ this.dataSource().forEach((row) => this.selection.select(row));
233
+ }
234
+ }
235
+ toggleRow(entity) {
236
+ this.selection.toggle(entity);
237
+ }
238
+ clearSelection() {
239
+ this.selection.clear();
240
+ }
241
+ onCellClick(event, entity, column) {
242
+ this.cellClick.emit({ event, entity, column });
243
+ }
244
+ onRowClick(event, entity) {
245
+ if (this.expandable()) {
246
+ this.toggleExpansion(entity, event.currentTarget);
247
+ return;
248
+ }
249
+ this.rowClick.emit(entity);
250
+ }
251
+ isExpanded(entity) {
252
+ return this.expandedKeys().has(this.expansionTrackBy()(entity));
253
+ }
254
+ isExpandedRow = (_, row) => this.isExpanded(row);
255
+ toggleExpansion(entity, rowElement) {
256
+ const key = this.expansionTrackBy()(entity);
257
+ const nextKeys = new Set(this.expandedKeys());
258
+ const wasExpanded = nextKeys.has(key);
259
+ if (wasExpanded) {
260
+ nextKeys.delete(key);
261
+ }
262
+ else {
263
+ nextKeys.add(key);
264
+ }
265
+ this.expandedKeys.set(nextKeys);
266
+ this.emitExpansionChange();
267
+ this.table()?.renderRows();
268
+ if (wasExpanded) {
269
+ return;
270
+ }
271
+ this.lastExpandedKey.set(key);
272
+ if (!rowElement) {
273
+ return;
274
+ }
275
+ afterNextRender(() => {
276
+ this.scrollExpandedRowUnderHeader(rowElement);
277
+ this.lastExpandedKey.set(null);
278
+ }, { injector: this.injector });
279
+ }
280
+ scrollExpandedRowUnderHeader(rowElement) {
281
+ const container = this.tableScrollContainer()?.nativeElement;
282
+ if (!container) {
283
+ return;
284
+ }
285
+ const headerRow = container.querySelector('.mat-mdc-header-row');
286
+ const headerHeight = headerRow?.offsetHeight ?? 0;
287
+ const containerRect = container.getBoundingClientRect();
288
+ const rowRect = rowElement.getBoundingClientRect();
289
+ const targetScrollTop = container.scrollTop + rowRect.top - containerRect.top - headerHeight;
290
+ container.scrollTo({ top: targetScrollTop, behavior: 'smooth' });
291
+ }
292
+ reconcileSelection(data) {
293
+ if (this.selection.isEmpty()) {
294
+ return;
295
+ }
296
+ const trackBy = this.selectionTrackBy();
297
+ const previousSelected = this.selection.selected;
298
+ const dataKeySet = new Set(data.map(trackBy));
299
+ const nextSelected = data.filter((entity) => {
300
+ const key = trackBy(entity);
301
+ return dataKeySet.has(key) && previousSelected.some((previous) => trackBy(previous) === key);
302
+ });
303
+ this.selection.clear();
304
+ if (nextSelected.length > 0) {
305
+ this.selection.select(...nextSelected);
306
+ }
307
+ }
308
+ reconcileExpansion(data) {
309
+ const previousKeys = this.expandedKeys();
310
+ if (previousKeys.size === 0) {
311
+ return;
312
+ }
313
+ const trackBy = this.expansionTrackBy();
314
+ const nextKeys = new Set();
315
+ for (const entity of data) {
316
+ const key = trackBy(entity);
317
+ if (previousKeys.has(key)) {
318
+ nextKeys.add(key);
319
+ }
320
+ }
321
+ if (nextKeys.size === previousKeys.size) {
322
+ return;
323
+ }
324
+ this.expandedKeys.set(nextKeys);
325
+ this.emitExpansionChange();
326
+ }
327
+ emitExpansionChange() {
328
+ const keys = this.expandedKeys();
329
+ const trackBy = this.expansionTrackBy();
330
+ const expandedEntities = this.dataSource().filter((entity) => keys.has(trackBy(entity)));
331
+ this.expansionChange.emit(expandedEntities);
332
+ }
333
+ onExpandToggleClick(event, entity) {
334
+ event.stopPropagation();
335
+ const rowElement = event.target.closest('mat-row');
336
+ this.toggleExpansion(entity, rowElement);
337
+ }
338
+ onActionClick(event, entity, action) {
339
+ event.stopPropagation();
340
+ if (action.handler) {
341
+ action.handler(entity);
342
+ }
343
+ else {
344
+ this.actionClick.emit({ event, entity, action });
345
+ }
346
+ }
347
+ onHeaderActionClick(event, action) {
348
+ if (action.handler) {
349
+ action.handler();
350
+ }
351
+ else {
352
+ this.headerActionClick.emit({ event, action });
353
+ }
354
+ }
355
+ onBulkActionClick(event, action) {
356
+ if (action.handler) {
357
+ action.handler(this.selection.selected);
358
+ }
359
+ else {
360
+ this.bulkActionClick.emit({ event, action, selected: this.selection.selected });
361
+ }
362
+ }
363
+ clone(link) {
364
+ return Object.assign(Object.create(Object.getPrototypeOf(link)), link);
365
+ }
366
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: BaseTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
367
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: BaseTableComponent, isStandalone: true, selector: "tb-base-table", inputs: { dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, displayedColumns: { classPropertyName: "displayedColumns", publicName: "displayedColumns", isSignal: true, isRequired: true, transformFunction: null }, loadingState: { classPropertyName: "loadingState", publicName: "loadingState", isSignal: true, isRequired: true, transformFunction: null }, widgetTitle: { classPropertyName: "widgetTitle", publicName: "widgetTitle", isSignal: true, isRequired: false, transformFunction: null }, noDataMessage: { classPropertyName: "noDataMessage", publicName: "noDataMessage", isSignal: true, isRequired: false, transformFunction: null }, totalElements: { classPropertyName: "totalElements", publicName: "totalElements", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, selectionEnabled: { classPropertyName: "selectionEnabled", publicName: "selectionEnabled", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, headerActions: { classPropertyName: "headerActions", publicName: "headerActions", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, expandable: { classPropertyName: "expandable", publicName: "expandable", isSignal: true, isRequired: false, transformFunction: null }, expandedRowTemplate: { classPropertyName: "expandedRowTemplate", publicName: "expandedRowTemplate", isSignal: true, isRequired: false, transformFunction: null }, expansionTrackBy: { classPropertyName: "expansionTrackBy", publicName: "expansionTrackBy", isSignal: true, isRequired: false, transformFunction: null }, selectionTrackBy: { classPropertyName: "selectionTrackBy", publicName: "selectionTrackBy", isSignal: true, isRequired: false, transformFunction: null }, clearSelectionTrigger: { classPropertyName: "clearSelectionTrigger", publicName: "clearSelectionTrigger", isSignal: true, isRequired: false, transformFunction: null }, pageLink: { classPropertyName: "pageLink", publicName: "pageLink", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageLink: "pageLinkChange", rowClick: "rowClick", cellClick: "cellClick", actionClick: "actionClick", headerActionClick: "headerActionClick", bulkActionClick: "bulkActionClick", selectionChange: "selectionChange", expansionChange: "expansionChange" }, viewQueries: [{ propertyName: "searchInputField", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "table", first: true, predicate: (MatTable), descendants: true, isSignal: true }, { propertyName: "tableScrollContainer", first: true, predicate: ["tableScrollContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"tb-table-widget tb-absolute-fill\">\n <div class=\"tb-absolute-fill flex flex-1 flex-col\">\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'default'\">\n <span\n class=\"tb-entity-table-title\"\n [matTooltip]=\"widgetTitle() | translate\"\n matTooltipPosition=\"above\"\n [matTooltipShowDelay]=\"500\"\n [matTooltipHideDelay]=\"200\">\n {{ widgetTitle() | translate }}\n </span>\n <span class=\"flex-1\"></span>\n @for (action of visibleHeaderActions(); track action.id) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled() : false\"\n (click)=\"onHeaderActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n [disabled]=\"loadingState().phase !== LoadingPhase.IDLE\"\n (click)=\"enterFilterMode()\"\n matTooltip=\"{{ 'action.search' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n </mat-toolbar>\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'search'\">\n <div class=\"mat-toolbar-tools\">\n <button mat-icon-button matTooltip=\"{{ 'action.search' | translate }}\" matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n <mat-form-field class=\"flex-1\">\n <mat-label>&nbsp;</mat-label>\n <input #searchInput matInput [formControl]=\"searchControl\" placeholder=\"{{ 'entity.search' | translate }}\" />\n </mat-form-field>\n <button\n mat-icon-button\n (click)=\"exitFilterMode()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </mat-toolbar>\n @if (selectionEnabled()) {\n <mat-toolbar class=\"mat-mdc-table-toolbar mat-mdc-table-toolbar--bulk\" [class.!hidden]=\"toolbarMode() !== 'bulk'\">\n <span class=\"tb-entity-table-title\"\n >{{ selection.selected.length }} {{ 'widgets.segmented-button.selected' | translate }}</span\n >\n <span class=\"flex-1\"></span>\n @for (action of visibleBulkActions(); track action.id) {\n <button\n mat-icon-button\n [disabled]=\"action.disabled ? action.disabled(selection.selected) : false\"\n (click)=\"onBulkActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n (click)=\"clearSelection()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar>\n }\n <div\n #tableScrollContainer\n cdkScrollable\n class=\"table-container flex-1 relative\"\n [style.overflow]=\"loadingState().phase !== LoadingPhase.IDLE ? 'hidden' : 'auto'\">\n @if (loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n\n <table\n mat-table\n [dataSource]=\"dataSource()\"\n [multiTemplateDataRows]=\"true\"\n matSort\n [matSortActive]=\"pageLink().sortOrder?.property || ''\"\n [matSortDirection]=\"pageLinkSortDirection()\"\n (matSortChange)=\"onSort($event)\">\n @if (selectionEnabled()) {\n <ng-container matColumnDef=\"select\" sticky>\n <mat-header-cell *matHeaderCellDef class=\"select-cell\">\n <mat-checkbox [checked]=\"isAllSelected()\" [indeterminate]=\"isIndeterminate()\" (change)=\"masterToggle()\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"select-cell\">\n <mat-checkbox\n [checked]=\"selection.isSelected(entity)\"\n (change)=\"toggleRow(entity)\"\n (click)=\"$event.stopPropagation()\">\n </mat-checkbox>\n </mat-cell>\n </ng-container>\n }\n @for (column of columns(); track column.def) {\n <ng-container [matColumnDef]=\"column.def\">\n <mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [disabled]=\"!column.sortable\"\n [style]=\"column.headerStyle\"\n class=\"column-header\">\n {{ column.title | translate }}\n </mat-header-cell>\n\n <mat-cell\n *matCellDef=\"let entity; let row = index\"\n [style]=\"entity[column.def + '_style']\"\n (click)=\"onCellClick($event, entity, column)\">\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: entity[column.name], entity: entity }\"></ng-container>\n } @else {\n {{ entity[column.name] ?? (column.nullDisplayValue ? (column.nullDisplayValue | translate) : '') }}\n }\n </mat-cell>\n </ng-container>\n }\n @if (rowActions().length > 0 || expandable()) {\n <ng-container matColumnDef=\"actions\" stickyEnd>\n <mat-header-cell *matHeaderCellDef class=\"actions-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"actions-cell\">\n <div class=\"actions-cell-inner\">\n <div class=\"actions-buttons-full\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-icon-button data-testid=\"expand-row\" (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n }\n </div>\n <div class=\"actions-buttons-menu\">\n <button\n mat-icon-button\n [matMenuTriggerFor]=\"actionsMenu\"\n (click)=\"$event.stopPropagation()\"\n matTooltip=\"{{ 'action.actions' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #actionsMenu=\"matMenu\" xPosition=\"before\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-menu-item\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\">\n <mat-icon>{{ action.icon }}</mat-icon>\n <span>{{ action.label || '' | translate }}</span>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-menu-item (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n <span>{{ (isExpanded(entity) ? 'action.collapse' : 'action.expand') | translate }}</span>\n </button>\n }\n </mat-menu>\n </div>\n </div>\n </mat-cell>\n </ng-container>\n }\n @if (expandable()) {\n <ng-container matColumnDef=\"expandedDetail\">\n <td\n mat-cell\n *matCellDef=\"let entity\"\n class=\"expanded-detail-cell\"\n [attr.colspan]=\"effectiveDisplayedColumns().length\"\n [attr.data-expand-key]=\"expansionTrackBy()(entity)\">\n @if (isExpanded(entity) && expandedRowTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"expandedRowTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entity, entity: entity }\"></ng-container>\n }\n </td>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"effectiveDisplayedColumns(); sticky: true\"></mat-header-row>\n <mat-row\n [class.invisible]=\"isLoadingState()\"\n [class.tb-expandable]=\"expandable()\"\n *matRowDef=\"let entity; columns: effectiveDisplayedColumns(); let row = index\"\n (click)=\"onRowClick($event, entity)\"></mat-row>\n @if (expandable()) {\n <tr\n mat-row\n *matRowDef=\"let entity; when: isExpandedRow; columns: detailRowColumns()\"\n class=\"detail-row\"\n [class.invisible]=\"\n loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\n \"></tr>\n }\n </table>\n @if (loadingState().phase === LoadingPhase.IDLE && dataSource().length === 0) {\n <span class=\"no-data-found flex items-center justify-center\">\n {{ noDataMessage() | translate }}\n </span>\n }\n @if (loadingState().phase === LoadingPhase.FETCHING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n </div>\n <mat-divider></mat-divider>\n <mat-paginator\n [disabled]=\"loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\"\n [length]=\"totalElements()\"\n [pageIndex]=\"pageLink().page\"\n [pageSize]=\"pageLink().pageSize\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n (page)=\"onPaginate($event)\"\n showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [":host{width:100%;height:100%;display:block;position:relative}:host .mat-mdc-icon-button{--mat-icon-button-state-layer-color: transparent;--mat-icon-button-ripple-color: transparent}:host .tb-table-widget .table-container{position:relative}:host .tb-table-widget .mat-mdc-table-toolbar{padding:0 12px}:host .tb-table-widget .mat-mdc-table-toolbar .tb-entity-table-title{color:#909090;font-size:16px;font-weight:700;letter-spacing:normal;padding:5px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tb-table-widget .mat-mdc-table-toolbar--bulk{background-color:#e8f0fe}:host .tb-table-widget .mat-mdc-table-toolbar--bulk .tb-entity-table-title{color:#0000008a}:host .tb-table-widget .mat-mdc-table .column-header{color:#0000008a;font-size:14px}:host .tb-table-widget .mat-mdc-table .mat-mdc-header-cell{background-color:#fff}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.invisible{visibility:hidden}:host .tb-table-widget .mat-mdc-table .select-cell{flex:0 0 48px;padding-right:0}:host .tb-table-widget .mat-mdc-table .actions-cell{white-space:nowrap;padding:0}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner{display:flex;justify-content:flex-end;align-items:center}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-menu{display:none}@media(max-width:599px){:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-full{display:none}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-menu{display:flex}}:host .tb-table-widget .mat-mdc-table .mat-mdc-row .mat-mdc-cell.select-cell,:host .tb-table-widget .mat-mdc-table .mat-mdc-row .mat-mdc-cell.actions-cell{background-color:#fff;z-index:2!important}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover{background-color:#f5f5f5}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover .mat-mdc-cell.select-cell,:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover .mat-mdc-cell.actions-cell{background-color:#f5f5f5}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.tb-expandable{cursor:pointer}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row{min-height:0;cursor:default}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row:hover{background-color:inherit}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row .expanded-detail-cell{padding:0;overflow:hidden}:host .tb-table-widget span.no-data-found{position:absolute;inset:60px 0 0}\n", ":host .tb-table-widget .mat-mdc-table,:host .tb-table-widget .mat-mdc-paginator,:host .tb-table-widget mat-toolbar.mat-mdc-table-toolbar:not([color=primary]){background:transparent}:host .tb-table-widget mat-toolbar{height:39px;max-height:39px}:host .tb-table-widget mat-toolbar .mat-toolbar-tools{height:39px;max-height:39px}:host .tb-table-widget .table-container{overflow:auto}:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-footer-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-header-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-footer-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-header-cell:nth-child(n+2):nth-last-child(n+2){padding:0 5px}:host .tb-table-widget .mat-mdc-row.mat-row-select mat-cell:nth-child(2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-footer-cell:nth-child(2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-header-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-footer-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-header-cell:nth-child(2){padding:0 5px}:host .tb-table-widget .mat-mdc-row.mat-row-select mat-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-footer-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-header-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-footer-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-header-cell:nth-child(n+3):nth-last-child(n+2){padding:0 5px}:host .tb-table-widget .mat-mdc-tab-header-pagination-disabled .mat-mdc-tab-header-pagination-chevron{border-color:var(--mat-tab-header-pagination-disabled-icon-color)}:host .mat-mdc-input-element::placeholder{color:var(--mat-table-header-headline-color)}:host .mat-mdc-table .mat-mdc-header-row{background-color:var(--tb-orig-background-color)}:host .mat-mdc-table .mat-mdc-cell.mat-mdc-table-sticky,:host .mat-mdc-table .mat-mdc-header-cell.mat-mdc-table-sticky{background-color:var(--tb-orig-background-color)}:host .mat-mdc-table .mat-mdc-row{background-color:#0000}:host .mat-mdc-table .mat-mdc-row.tb-current-entity{background-color:var(--tb-current-entity-color)}:host .mat-mdc-table .mat-mdc-row.tb-current-entity .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-current-entity-sticky-color)}:host .mat-mdc-table .mat-mdc-row:hover:not(.tb-current-entity){background-color:var(--tb-hover-color)}:host .mat-mdc-table .mat-mdc-row:hover:not(.tb-current-entity) .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-hover-sticky-color)}:host .mat-mdc-table .mat-mdc-row.mat-row-select.mat-selected:not(.tb-current-entity){background-color:var(--tb-selected-color)}:host .mat-mdc-table .mat-mdc-row.mat-row-select.mat-selected:not(.tb-current-entity) .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-selected-sticky-color)}:host .mat-mdc-table .mat-mdc-row,:host .mat-mdc-table .mat-mdc-row .mat-mdc-cell.mat-mdc-table-sticky{transition:background-color .2s;background-color:var(--tb-orig-background-color)}:host-context(.tb-has-timewindow) .tb-table-widget mat-toolbar{height:65px;max-height:65px}:host-context(.tb-has-timewindow) .tb-table-widget mat-toolbar .mat-toolbar-tools{height:65px;max-height:65px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SharedModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: i7.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i10.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i10.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i10.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i10.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i10.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i10.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i10.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i10.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i10.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i10.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i11.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i12.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i12.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i13.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i14.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i14.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i14.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: LoadingOverlayComponent, selector: "tb-loading-overlay", inputs: ["state", "mode", "generating", "processingDeterminate", "processingIndeterminate", "fetching"] }, { kind: "ngmodule", type: CdkScrollableModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
368
+ }
369
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: BaseTableComponent, decorators: [{
370
+ type: Component,
371
+ args: [{ standalone: true, imports: [CommonModule, SharedModule, LoadingOverlayComponent, CdkScrollableModule, MatCheckboxModule], selector: 'tb-base-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"tb-table-widget tb-absolute-fill\">\n <div class=\"tb-absolute-fill flex flex-1 flex-col\">\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'default'\">\n <span\n class=\"tb-entity-table-title\"\n [matTooltip]=\"widgetTitle() | translate\"\n matTooltipPosition=\"above\"\n [matTooltipShowDelay]=\"500\"\n [matTooltipHideDelay]=\"200\">\n {{ widgetTitle() | translate }}\n </span>\n <span class=\"flex-1\"></span>\n @for (action of visibleHeaderActions(); track action.id) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled() : false\"\n (click)=\"onHeaderActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n [disabled]=\"loadingState().phase !== LoadingPhase.IDLE\"\n (click)=\"enterFilterMode()\"\n matTooltip=\"{{ 'action.search' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n </mat-toolbar>\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'search'\">\n <div class=\"mat-toolbar-tools\">\n <button mat-icon-button matTooltip=\"{{ 'action.search' | translate }}\" matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n <mat-form-field class=\"flex-1\">\n <mat-label>&nbsp;</mat-label>\n <input #searchInput matInput [formControl]=\"searchControl\" placeholder=\"{{ 'entity.search' | translate }}\" />\n </mat-form-field>\n <button\n mat-icon-button\n (click)=\"exitFilterMode()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </mat-toolbar>\n @if (selectionEnabled()) {\n <mat-toolbar class=\"mat-mdc-table-toolbar mat-mdc-table-toolbar--bulk\" [class.!hidden]=\"toolbarMode() !== 'bulk'\">\n <span class=\"tb-entity-table-title\"\n >{{ selection.selected.length }} {{ 'widgets.segmented-button.selected' | translate }}</span\n >\n <span class=\"flex-1\"></span>\n @for (action of visibleBulkActions(); track action.id) {\n <button\n mat-icon-button\n [disabled]=\"action.disabled ? action.disabled(selection.selected) : false\"\n (click)=\"onBulkActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n (click)=\"clearSelection()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar>\n }\n <div\n #tableScrollContainer\n cdkScrollable\n class=\"table-container flex-1 relative\"\n [style.overflow]=\"loadingState().phase !== LoadingPhase.IDLE ? 'hidden' : 'auto'\">\n @if (loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n\n <table\n mat-table\n [dataSource]=\"dataSource()\"\n [multiTemplateDataRows]=\"true\"\n matSort\n [matSortActive]=\"pageLink().sortOrder?.property || ''\"\n [matSortDirection]=\"pageLinkSortDirection()\"\n (matSortChange)=\"onSort($event)\">\n @if (selectionEnabled()) {\n <ng-container matColumnDef=\"select\" sticky>\n <mat-header-cell *matHeaderCellDef class=\"select-cell\">\n <mat-checkbox [checked]=\"isAllSelected()\" [indeterminate]=\"isIndeterminate()\" (change)=\"masterToggle()\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"select-cell\">\n <mat-checkbox\n [checked]=\"selection.isSelected(entity)\"\n (change)=\"toggleRow(entity)\"\n (click)=\"$event.stopPropagation()\">\n </mat-checkbox>\n </mat-cell>\n </ng-container>\n }\n @for (column of columns(); track column.def) {\n <ng-container [matColumnDef]=\"column.def\">\n <mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [disabled]=\"!column.sortable\"\n [style]=\"column.headerStyle\"\n class=\"column-header\">\n {{ column.title | translate }}\n </mat-header-cell>\n\n <mat-cell\n *matCellDef=\"let entity; let row = index\"\n [style]=\"entity[column.def + '_style']\"\n (click)=\"onCellClick($event, entity, column)\">\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: entity[column.name], entity: entity }\"></ng-container>\n } @else {\n {{ entity[column.name] ?? (column.nullDisplayValue ? (column.nullDisplayValue | translate) : '') }}\n }\n </mat-cell>\n </ng-container>\n }\n @if (rowActions().length > 0 || expandable()) {\n <ng-container matColumnDef=\"actions\" stickyEnd>\n <mat-header-cell *matHeaderCellDef class=\"actions-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"actions-cell\">\n <div class=\"actions-cell-inner\">\n <div class=\"actions-buttons-full\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-icon-button data-testid=\"expand-row\" (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n }\n </div>\n <div class=\"actions-buttons-menu\">\n <button\n mat-icon-button\n [matMenuTriggerFor]=\"actionsMenu\"\n (click)=\"$event.stopPropagation()\"\n matTooltip=\"{{ 'action.actions' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #actionsMenu=\"matMenu\" xPosition=\"before\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-menu-item\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\">\n <mat-icon>{{ action.icon }}</mat-icon>\n <span>{{ action.label || '' | translate }}</span>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-menu-item (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n <span>{{ (isExpanded(entity) ? 'action.collapse' : 'action.expand') | translate }}</span>\n </button>\n }\n </mat-menu>\n </div>\n </div>\n </mat-cell>\n </ng-container>\n }\n @if (expandable()) {\n <ng-container matColumnDef=\"expandedDetail\">\n <td\n mat-cell\n *matCellDef=\"let entity\"\n class=\"expanded-detail-cell\"\n [attr.colspan]=\"effectiveDisplayedColumns().length\"\n [attr.data-expand-key]=\"expansionTrackBy()(entity)\">\n @if (isExpanded(entity) && expandedRowTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"expandedRowTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entity, entity: entity }\"></ng-container>\n }\n </td>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"effectiveDisplayedColumns(); sticky: true\"></mat-header-row>\n <mat-row\n [class.invisible]=\"isLoadingState()\"\n [class.tb-expandable]=\"expandable()\"\n *matRowDef=\"let entity; columns: effectiveDisplayedColumns(); let row = index\"\n (click)=\"onRowClick($event, entity)\"></mat-row>\n @if (expandable()) {\n <tr\n mat-row\n *matRowDef=\"let entity; when: isExpandedRow; columns: detailRowColumns()\"\n class=\"detail-row\"\n [class.invisible]=\"\n loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\n \"></tr>\n }\n </table>\n @if (loadingState().phase === LoadingPhase.IDLE && dataSource().length === 0) {\n <span class=\"no-data-found flex items-center justify-center\">\n {{ noDataMessage() | translate }}\n </span>\n }\n @if (loadingState().phase === LoadingPhase.FETCHING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n </div>\n <mat-divider></mat-divider>\n <mat-paginator\n [disabled]=\"loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\"\n [length]=\"totalElements()\"\n [pageIndex]=\"pageLink().page\"\n [pageSize]=\"pageLink().pageSize\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n (page)=\"onPaginate($event)\"\n showFirstLastButtons></mat-paginator>\n </div>\n</div>\n", styles: [":host{width:100%;height:100%;display:block;position:relative}:host .mat-mdc-icon-button{--mat-icon-button-state-layer-color: transparent;--mat-icon-button-ripple-color: transparent}:host .tb-table-widget .table-container{position:relative}:host .tb-table-widget .mat-mdc-table-toolbar{padding:0 12px}:host .tb-table-widget .mat-mdc-table-toolbar .tb-entity-table-title{color:#909090;font-size:16px;font-weight:700;letter-spacing:normal;padding:5px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .tb-table-widget .mat-mdc-table-toolbar--bulk{background-color:#e8f0fe}:host .tb-table-widget .mat-mdc-table-toolbar--bulk .tb-entity-table-title{color:#0000008a}:host .tb-table-widget .mat-mdc-table .column-header{color:#0000008a;font-size:14px}:host .tb-table-widget .mat-mdc-table .mat-mdc-header-cell{background-color:#fff}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.invisible{visibility:hidden}:host .tb-table-widget .mat-mdc-table .select-cell{flex:0 0 48px;padding-right:0}:host .tb-table-widget .mat-mdc-table .actions-cell{white-space:nowrap;padding:0}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner{display:flex;justify-content:flex-end;align-items:center}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-menu{display:none}@media(max-width:599px){:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-full{display:none}:host .tb-table-widget .mat-mdc-table .actions-cell .actions-cell-inner .actions-buttons-menu{display:flex}}:host .tb-table-widget .mat-mdc-table .mat-mdc-row .mat-mdc-cell.select-cell,:host .tb-table-widget .mat-mdc-table .mat-mdc-row .mat-mdc-cell.actions-cell{background-color:#fff;z-index:2!important}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover{background-color:#f5f5f5}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover .mat-mdc-cell.select-cell,:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover .mat-mdc-cell.actions-cell{background-color:#f5f5f5}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.tb-expandable{cursor:pointer}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row{min-height:0;cursor:default}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row:hover{background-color:inherit}:host .tb-table-widget .mat-mdc-table .mat-mdc-row.detail-row .expanded-detail-cell{padding:0;overflow:hidden}:host .tb-table-widget span.no-data-found{position:absolute;inset:60px 0 0}\n", ":host .tb-table-widget .mat-mdc-table,:host .tb-table-widget .mat-mdc-paginator,:host .tb-table-widget mat-toolbar.mat-mdc-table-toolbar:not([color=primary]){background:transparent}:host .tb-table-widget mat-toolbar{height:39px;max-height:39px}:host .tb-table-widget mat-toolbar .mat-toolbar-tools{height:39px;max-height:39px}:host .tb-table-widget .table-container{overflow:auto}:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-footer-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row:not(.mat-row-select) mat-header-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-footer-cell:nth-child(n+2):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row:not(.mat-row-select) mat-header-cell:nth-child(n+2):nth-last-child(n+2){padding:0 5px}:host .tb-table-widget .mat-mdc-row.mat-row-select mat-cell:nth-child(2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-footer-cell:nth-child(2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-header-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-footer-cell:nth-child(2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-header-cell:nth-child(2){padding:0 5px}:host .tb-table-widget .mat-mdc-row.mat-row-select mat-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-footer-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-row.mat-row-select mat-header-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-footer-cell:nth-child(n+3):nth-last-child(n+2),:host .tb-table-widget .mat-mdc-header-row.mat-row-select mat-header-cell:nth-child(n+3):nth-last-child(n+2){padding:0 5px}:host .tb-table-widget .mat-mdc-tab-header-pagination-disabled .mat-mdc-tab-header-pagination-chevron{border-color:var(--mat-tab-header-pagination-disabled-icon-color)}:host .mat-mdc-input-element::placeholder{color:var(--mat-table-header-headline-color)}:host .mat-mdc-table .mat-mdc-header-row{background-color:var(--tb-orig-background-color)}:host .mat-mdc-table .mat-mdc-cell.mat-mdc-table-sticky,:host .mat-mdc-table .mat-mdc-header-cell.mat-mdc-table-sticky{background-color:var(--tb-orig-background-color)}:host .mat-mdc-table .mat-mdc-row{background-color:#0000}:host .mat-mdc-table .mat-mdc-row.tb-current-entity{background-color:var(--tb-current-entity-color)}:host .mat-mdc-table .mat-mdc-row.tb-current-entity .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-current-entity-sticky-color)}:host .mat-mdc-table .mat-mdc-row:hover:not(.tb-current-entity){background-color:var(--tb-hover-color)}:host .mat-mdc-table .mat-mdc-row:hover:not(.tb-current-entity) .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-hover-sticky-color)}:host .mat-mdc-table .mat-mdc-row.mat-row-select.mat-selected:not(.tb-current-entity){background-color:var(--tb-selected-color)}:host .mat-mdc-table .mat-mdc-row.mat-row-select.mat-selected:not(.tb-current-entity) .mat-mdc-cell.mat-mdc-table-sticky{background-color:var(--tb-selected-sticky-color)}:host .mat-mdc-table .mat-mdc-row,:host .mat-mdc-table .mat-mdc-row .mat-mdc-cell.mat-mdc-table-sticky{transition:background-color .2s;background-color:var(--tb-orig-background-color)}:host-context(.tb-has-timewindow) .tb-table-widget mat-toolbar{height:65px;max-height:65px}:host-context(.tb-has-timewindow) .tb-table-widget mat-toolbar .mat-toolbar-tools{height:65px;max-height:65px}\n"] }]
372
+ }], ctorParameters: () => [], propDecorators: { dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: true }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], displayedColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayedColumns", required: true }] }], loadingState: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingState", required: true }] }], widgetTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetTitle", required: false }] }], noDataMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "noDataMessage", required: false }] }], totalElements: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalElements", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], selectionEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionEnabled", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], headerActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerActions", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], expandable: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandable", required: false }] }], expandedRowTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRowTemplate", required: false }] }], expansionTrackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "expansionTrackBy", required: false }] }], selectionTrackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionTrackBy", required: false }] }], clearSelectionTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearSelectionTrigger", required: false }] }], pageLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLink", required: false }] }, { type: i0.Output, args: ["pageLinkChange"] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], cellClick: [{ type: i0.Output, args: ["cellClick"] }], actionClick: [{ type: i0.Output, args: ["actionClick"] }], headerActionClick: [{ type: i0.Output, args: ["headerActionClick"] }], bulkActionClick: [{ type: i0.Output, args: ["bulkActionClick"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], expansionChange: [{ type: i0.Output, args: ["expansionChange"] }], searchInputField: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTable), { isSignal: true }] }], tableScrollContainer: [{ type: i0.ViewChild, args: ['tableScrollContainer', { isSignal: true }] }] } });
373
+
374
+ class ActionButtonComponent {
375
+ icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : []));
376
+ label = input(null, ...(ngDevMode ? [{ debugName: "label" }] : []));
377
+ backgroundColor = input(null, ...(ngDevMode ? [{ debugName: "backgroundColor" }] : []));
378
+ textColor = input(null, ...(ngDevMode ? [{ debugName: "textColor" }] : []));
379
+ clicked = output();
380
+ resolvedBackgroundColor = computed(() => {
381
+ const bg = this.backgroundColor();
382
+ if (!bg)
383
+ return null;
384
+ return bg.startsWith('--') ? `var(${bg})` : bg;
385
+ }, ...(ngDevMode ? [{ debugName: "resolvedBackgroundColor" }] : []));
386
+ resolvedTextColor = computed(() => {
387
+ const color = this.textColor();
388
+ if (!color)
389
+ return null;
390
+ return color.startsWith('--') ? `var(${color})` : color;
391
+ }, ...(ngDevMode ? [{ debugName: "resolvedTextColor" }] : []));
392
+ handleClick() {
393
+ this.clicked.emit();
394
+ }
395
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
396
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: ActionButtonComponent, isStandalone: true, selector: "tb-action-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n mat-flat-button\n class=\"action-button\"\n [style.--mat-button-filled-container-color]=\"resolvedBackgroundColor()\"\n [style.--mat-button-filled-label-text-color]=\"resolvedTextColor()\"\n (click)=\"handleClick()\">\n @if (icon()) {\n <mat-icon>{{ icon() }}</mat-icon>\n }\n @if (label()) {\n <span class=\"action-button__label\">{{ label() }}</span>\n }\n</button>\n", styles: [":host{display:inline-flex}.action-button{display:inline-flex;align-items:center;gap:6px;border-radius:4px;min-width:unset}.action-button mat-icon{font-size:18px;width:18px;height:18px;flex-shrink:0}.action-button__label{font-size:14px;font-weight:500;line-height:1}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
397
+ }
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: ActionButtonComponent, decorators: [{
399
+ type: Component,
400
+ args: [{ standalone: true, imports: [MatButtonModule, MatIconModule], selector: 'tb-action-button', template: "<button\n mat-flat-button\n class=\"action-button\"\n [style.--mat-button-filled-container-color]=\"resolvedBackgroundColor()\"\n [style.--mat-button-filled-label-text-color]=\"resolvedTextColor()\"\n (click)=\"handleClick()\">\n @if (icon()) {\n <mat-icon>{{ icon() }}</mat-icon>\n }\n @if (label()) {\n <span class=\"action-button__label\">{{ label() }}</span>\n }\n</button>\n", styles: [":host{display:inline-flex}.action-button{display:inline-flex;align-items:center;gap:6px;border-radius:4px;min-width:unset}.action-button mat-icon{font-size:18px;width:18px;height:18px;flex-shrink:0}.action-button__label{font-size:14px;font-weight:500;line-height:1}\n"] }]
401
+ }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
402
+
403
+ class TbSubscriptionDatasource {
404
+ config;
405
+ data = signal([], ...(ngDevMode ? [{ debugName: "data" }] : []));
406
+ loadingState = signal(getLoadingState.fetching(), ...(ngDevMode ? [{ debugName: "loadingState" }] : []));
407
+ subscription = null;
408
+ subscriptionSub = null;
409
+ constructor(config) {
410
+ this.config = config;
411
+ const injector = config.injector;
412
+ effect(() => {
413
+ const entityFilter = config.entityFilter();
414
+ untracked(() => this.recreateSubscription(entityFilter, config.widgetType));
415
+ }, { injector });
416
+ injector.get(DestroyRef).onDestroy(() => this.cleanup());
417
+ }
418
+ refresh() {
419
+ this.recreateSubscription(this.config.entityFilter(), this.config.widgetType);
420
+ }
421
+ recreateSubscription(entityFilter, widgetType) {
422
+ this.cleanup();
423
+ this.loadingState.set(getLoadingState.fetching());
424
+ const options = {
425
+ type: widgetType,
426
+ datasources: [
427
+ {
428
+ type: 'entity',
429
+ dataKeys: this.config.dataKeys,
430
+ entityFilter,
431
+ },
432
+ ],
433
+ hasDataPageLink: false,
434
+ useDashboardTimewindow: true,
435
+ callbacks: {
436
+ onDataUpdated: () => this.onDataUpdated(),
437
+ },
438
+ };
439
+ this.subscriptionSub = this.config.ctx.subscriptionApi
440
+ .createSubscription(options, true)
441
+ .subscribe((subscription) => {
442
+ this.subscription = subscription;
443
+ });
444
+ }
445
+ onDataUpdated() {
446
+ if (!this.subscription) {
447
+ return;
448
+ }
449
+ this.data.set(this.config.dataMapper(this.subscription));
450
+ this.loadingState.set(getLoadingState.idle());
451
+ this.config.ctx.detectChanges();
452
+ }
453
+ cleanup() {
454
+ this.subscriptionSub?.unsubscribe();
455
+ this.subscriptionSub = null;
456
+ this.subscription?.destroy();
457
+ this.subscription = null;
458
+ }
459
+ }
460
+ class TbSubscriptionDatasourcePaginated {
461
+ config;
462
+ data = signal([], ...(ngDevMode ? [{ debugName: "data" }] : []));
463
+ totalElements = signal(0, ...(ngDevMode ? [{ debugName: "totalElements" }] : []));
464
+ loadingState = signal(getLoadingState.fetching(), ...(ngDevMode ? [{ debugName: "loadingState" }] : []));
465
+ subscription = null;
466
+ subscriptionSub = null;
467
+ constructor(config) {
468
+ this.config = config;
469
+ const injector = config.injector;
470
+ effect(() => {
471
+ const entityFilter = config.entityFilter();
472
+ const pageLink = untracked(() => config.pageLink());
473
+ untracked(() => this.recreateSubscription(entityFilter, pageLink, config.widgetType));
474
+ }, { injector });
475
+ effect(() => {
476
+ const pageLink = config.pageLink();
477
+ untracked(() => {
478
+ if (this.subscription) {
479
+ this.subscription.subscribeForPaginatedData(0, this.toEntityPageLink(pageLink), config.keyFilters ?? []);
480
+ }
481
+ });
482
+ }, { injector });
483
+ injector.get(DestroyRef).onDestroy(() => this.cleanup());
484
+ }
485
+ refresh() {
486
+ if (this.subscription) {
487
+ this.subscription.subscribeForPaginatedData(0, this.toEntityPageLink(untracked(() => this.config.pageLink())), this.config.keyFilters ?? []);
488
+ }
489
+ }
490
+ recreateSubscription(entityFilter, pageLink, widgetType) {
491
+ this.cleanup();
492
+ this.loadingState.set(getLoadingState.fetching());
493
+ const options = {
494
+ type: widgetType,
495
+ datasources: [
496
+ {
497
+ type: 'entity',
498
+ dataKeys: this.config.dataKeys,
499
+ entityFilter,
500
+ },
501
+ ],
502
+ hasDataPageLink: true,
503
+ useDashboardTimewindow: true,
504
+ callbacks: {
505
+ onDataUpdated: () => this.onDataUpdated(),
506
+ },
507
+ };
508
+ this.subscriptionSub = this.config.ctx.subscriptionApi
509
+ .createSubscription(options, true)
510
+ .subscribe((subscription) => {
511
+ this.subscription = subscription;
512
+ subscription.subscribeForPaginatedData(0, this.toEntityPageLink(pageLink), this.config.keyFilters ?? []);
513
+ });
514
+ }
515
+ onDataUpdated() {
516
+ if (!this.subscription) {
517
+ return;
518
+ }
519
+ this.data.set(this.config.dataMapper(this.subscription));
520
+ this.totalElements.set(this.subscription.datasourcePages?.[0]?.totalElements ?? 0);
521
+ this.loadingState.set(getLoadingState.idle());
522
+ this.config.ctx.detectChanges();
523
+ }
524
+ toEntityPageLink(pageLink) {
525
+ const entityPageLink = {
526
+ page: pageLink.page,
527
+ pageSize: pageLink.pageSize,
528
+ textSearch: pageLink.textSearch,
529
+ dynamic: true,
530
+ };
531
+ if (pageLink.sortOrder) {
532
+ const entityKey = findEntityKeyByColumnDef(pageLink.sortOrder.property, this.config.columns);
533
+ if (entityKey) {
534
+ entityPageLink.sortOrder = {
535
+ key: entityKey,
536
+ direction: pageLink.sortOrder.direction,
537
+ };
538
+ }
539
+ }
540
+ else {
541
+ entityPageLink.sortOrder = {
542
+ key: { key: 'createdTime', type: EntityKeyType.ENTITY_FIELD },
543
+ direction: Direction.DESC,
544
+ };
545
+ }
546
+ return entityPageLink;
547
+ }
548
+ cleanup() {
549
+ this.subscriptionSub?.unsubscribe();
550
+ this.subscriptionSub = null;
551
+ this.subscription?.destroy();
552
+ this.subscription = null;
553
+ }
554
+ }
555
+ function collectSubscriptionData(subscription, valueTransformer) {
556
+ const itemMap = {};
557
+ for (const datasource of subscription.datasources ?? []) {
558
+ itemMap[datasource.name] = {
559
+ id: datasource.entity.id,
560
+ name: datasource.name,
561
+ };
562
+ }
563
+ for (const datasourceData of subscription.data ?? []) {
564
+ const item = itemMap[datasourceData.datasource.name];
565
+ if (!item) {
566
+ continue;
567
+ }
568
+ const rawValue = datasourceData.data[0]?.[1] ?? null;
569
+ item[datasourceData.dataKey.name] = valueTransformer
570
+ ? valueTransformer(datasourceData.dataKey.name, datasourceData.data[0])
571
+ : rawValue;
572
+ }
573
+ return Object.values(itemMap);
574
+ }
575
+
576
+ /*
577
+ * Public API Surface of @dmytrokhylko/tb-cdu-ui
578
+ */
579
+ // Components
580
+
581
+ /**
582
+ * Generated bundle index. Do not edit.
583
+ */
584
+
585
+ export { ActionButtonComponent, BaseTableComponent, DEFAULT_PAGE_LINK_PAGE_SIZE, DEFAULT_PAGE_SIZES, LoadingOverlayComponent, LoadingPhase, TbSubscriptionDatasource, TbSubscriptionDatasourcePaginated, collectSubscriptionData, getLoadingState };
586
+ //# sourceMappingURL=dmytrokhylko-tb-cdu-ui.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dmytrokhylko-tb-cdu-ui.mjs","sources":["../../../projects/tb-ui/src/lib/models/constants.ts","../../../projects/tb-ui/src/lib/loading-overlay/loading-overlay.models.ts","../../../projects/tb-ui/src/lib/loading-overlay/loading-overlay.component.ts","../../../projects/tb-ui/src/lib/loading-overlay/loading-overlay.component.html","../../../projects/tb-ui/src/lib/base-table/base-table.component.ts","../../../projects/tb-ui/src/lib/base-table/base-table.component.html","../../../projects/tb-ui/src/lib/action-button/action-button.component.ts","../../../projects/tb-ui/src/lib/action-button/action-button.component.html","../../../projects/tb-ui/src/lib/base-table/tb-subscription-datasource.ts","../../../projects/tb-ui/src/public-api.ts","../../../projects/tb-ui/src/dmytrokhylko-tb-cdu-ui.ts"],"sourcesContent":["export const DEFAULT_PAGE_LINK_PAGE_SIZE = 20;\nexport const DEFAULT_PAGE_SIZES = [\n DEFAULT_PAGE_LINK_PAGE_SIZE,\n DEFAULT_PAGE_LINK_PAGE_SIZE * 5,\n DEFAULT_PAGE_LINK_PAGE_SIZE * 10,\n];\n","export enum LoadingPhase {\n IDLE = 'idle',\n GENERATING = 'generating',\n POLLING = 'polling',\n FETCHING = 'fetching',\n}\n\nexport type LoadingState =\n | { phase: LoadingPhase.IDLE }\n | { phase: LoadingPhase.GENERATING }\n | { phase: LoadingPhase.POLLING; processed: number; total: number }\n | { phase: LoadingPhase.FETCHING };\n\nexport const getLoadingState = {\n idle: (): LoadingState => ({ phase: LoadingPhase.IDLE }),\n generating: (): LoadingState => ({ phase: LoadingPhase.GENERATING }),\n polling: (processed: number, total: number): LoadingState => ({\n phase: LoadingPhase.POLLING,\n processed,\n total,\n }),\n fetching: (): LoadingState => ({ phase: LoadingPhase.FETCHING }),\n};\n","import { Component, computed, input } from '@angular/core';\nimport { MatProgressSpinnerModule, ProgressSpinnerMode } from '@angular/material/progress-spinner';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { LoadingPhase, LoadingState } from './loading-overlay.models';\n\n@Component({\n standalone: true,\n imports: [TranslateModule, MatProgressSpinnerModule],\n selector: 'tb-loading-overlay',\n templateUrl: './loading-overlay.component.html',\n styleUrls: ['./loading-overlay.component.scss'],\n})\nexport class LoadingOverlayComponent {\n state = input.required<LoadingState>();\n mode = input<ProgressSpinnerMode>('determinate');\n\n generating = input('loading.generating');\n processingDeterminate = input('loading.polling.determinate');\n processingIndeterminate = input('loading.polling.indeterminate');\n fetching = input('loading.fetching');\n\n protected readonly LoadingPhase = LoadingPhase;\n\n spinnerMode = computed((): ProgressSpinnerMode => {\n if (this.state().phase !== LoadingPhase.POLLING || this.mode() !== 'determinate') {\n return 'indeterminate';\n }\n return this.percentage() > 0 ? 'determinate' : 'indeterminate';\n });\n percentage = computed(() => {\n const state = this.state();\n return state.phase === LoadingPhase.POLLING && state.total > 0\n ? Math.floor((state.processed / state.total) * 100)\n : 0;\n });\n\n pollingProcessed = computed(() => {\n const state = this.state();\n return state.phase === LoadingPhase.POLLING ? state.processed : 0;\n });\n\n pollingTotal = computed(() => {\n const state = this.state();\n return state.phase === LoadingPhase.POLLING ? state.total : 0;\n });\n}\n","<div class=\"loading-overlay\">\n <mat-spinner diameter=\"50\" [mode]=\"spinnerMode()\" [value]=\"percentage()\"></mat-spinner>\n <span class=\"loading-text\">\n @switch (state().phase) {\n @case (LoadingPhase.POLLING) {\n @if (spinnerMode() === 'determinate') {\n {{ processingDeterminate() | translate }} {{ pollingProcessed() }}/{{ pollingTotal() }}\n } @else {\n {{ processingIndeterminate() | translate }}\n }\n }\n @case (LoadingPhase.GENERATING) {\n {{ generating() | translate }}\n }\n @case (LoadingPhase.FETCHING) {\n {{ fetching() | translate }}\n }\n }\n </span>\n</div>\n","import { SelectionModel } from '@angular/cdk/collections';\nimport { CdkScrollableModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport {\n afterNextRender,\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl } from '@angular/forms';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { PageEvent } from '@angular/material/paginator';\nimport { Sort, SortDirection } from '@angular/material/sort';\nimport { MatTable } from '@angular/material/table';\nimport { Direction, PageLink, SharedModule } from '@shared/public-api';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\nimport { DEFAULT_PAGE_SIZES } from '../models/constants';\nimport { EntityColumnExtended } from '../models/entity-column.models';\nimport { LoadingOverlayComponent } from '../loading-overlay/loading-overlay.component';\nimport { LoadingPhase, LoadingState } from '../loading-overlay/loading-overlay.models';\nimport { TableBulkAction, TableHeaderAction, TableRowAction } from './base-table.models';\n\n@Component({\n standalone: true,\n imports: [CommonModule, SharedModule, LoadingOverlayComponent, CdkScrollableModule, MatCheckboxModule],\n selector: 'tb-base-table',\n templateUrl: './base-table.component.html',\n styleUrls: ['./base-table.component.scss', '../styles/table-widget.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BaseTableComponent<T> implements AfterViewInit {\n dataSource = input.required<T[]>();\n columns = input.required<EntityColumnExtended<T>[]>();\n displayedColumns = input.required<string[]>();\n loadingState = input.required<LoadingState>();\n\n widgetTitle = input<string>('widget.widget-title');\n noDataMessage = input<string>('entity.no-data');\n\n totalElements = input<number>(0);\n pageSizeOptions = input<number[]>(DEFAULT_PAGE_SIZES);\n\n selectionEnabled = input<boolean>(false);\n\n rowActions = input<TableRowAction<T>[]>([]);\n headerActions = input<TableHeaderAction[]>([]);\n bulkActions = input<TableBulkAction<T>[]>([]);\n\n expandable = input<boolean>(false);\n expandedRowTemplate = input<TemplateRef<{ $implicit: T; entity: T }> | null>(null);\n expansionTrackBy = input<(entity: T) => unknown>((entity) => entity);\n selectionTrackBy = input<(entity: T) => unknown>((entity) => entity);\n clearSelectionTrigger = input<unknown>(undefined);\n\n pageLink = model<PageLink>(new PageLink(this.pageSizeOptions()[0]));\n\n rowClick = output<T>();\n cellClick = output<{ event: Event; entity: T; column: EntityColumnExtended<T> }>();\n actionClick = output<{ event: Event; entity: T; action: TableRowAction<T> }>();\n headerActionClick = output<{ event: Event; action: TableHeaderAction }>();\n bulkActionClick = output<{ event: Event; action: TableBulkAction<T>; selected: T[] }>();\n\n selectionChange = output<T[]>();\n expansionChange = output<T[]>();\n\n textSearchMode = signal(false);\n readonly selection = new SelectionModel<T>(true, []);\n readonly expandedKeys = signal<Set<unknown>>(new Set());\n readonly lastExpandedKey = signal<unknown | null>(null);\n\n readonly detailRowColumns = computed(() => ['expandedDetail']);\n\n private readonly selectionCount = signal(0);\n\n readonly isLoadingState = computed(() => {\n return this.loadingState().phase === LoadingPhase.GENERATING || this.loadingState().phase === LoadingPhase.POLLING;\n });\n\n readonly toolbarMode = computed((): 'default' | 'search' | 'bulk' => {\n if (this.selectionEnabled() && this.selectionCount() > 0) return 'bulk';\n if (this.textSearchMode()) return 'search';\n return 'default';\n });\n\n readonly effectiveDisplayedColumns = computed(() => {\n const cols = [...this.displayedColumns()];\n if (this.selectionEnabled()) cols.unshift('select');\n if (this.rowActions().length > 0 || this.expandable()) cols.push('actions');\n return cols;\n });\n\n readonly visibleHeaderActions = computed(() =>\n this.headerActions().filter((action) => !action.visible || action.visible()),\n );\n\n readonly visibleBulkActions = computed(() =>\n this.bulkActions().filter((action) => !action.visible || action.visible()),\n );\n\n pageLinkSortDirection = computed((): SortDirection => {\n const order = this.pageLink().sortOrder;\n return order && order.direction ? (order.direction.toLowerCase() as SortDirection) : '';\n });\n\n searchControl = new FormControl<string>('', { nonNullable: true });\n searchInputField = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n private readonly table = viewChild(MatTable<T>);\n private readonly tableScrollContainer = viewChild<ElementRef<HTMLElement>>('tableScrollContainer');\n\n protected readonly LoadingPhase = LoadingPhase;\n\n private injector = inject(Injector);\n private destroyRef = inject(DestroyRef);\n\n constructor() {\n effect(() => {\n const data = this.dataSource();\n untracked(() => {\n this.reconcileSelection(data);\n this.reconcileExpansion(data);\n });\n });\n\n let clearSelectionInitialized = false;\n effect(() => {\n this.clearSelectionTrigger();\n if (!clearSelectionInitialized) {\n clearSelectionInitialized = true;\n return;\n }\n untracked(() => this.selection.clear());\n });\n\n this.selection.changed.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.selectionCount.set(this.selection.selected.length);\n this.selectionChange.emit(this.selection.selected);\n });\n }\n\n ngAfterViewInit(): void {\n if (this.pageLink().textSearch) {\n this.searchControl.patchValue(this.pageLink().textSearch, { emitEvent: false });\n }\n\n this.searchControl.valueChanges\n .pipe(\n debounceTime(300),\n distinctUntilChanged((prev, current) => (this.pageLink().textSearch ?? '') === current.trim()),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((searchValue: string) => {\n const current = this.clone(this.pageLink());\n current.textSearch = searchValue.trim();\n current.page = 0;\n this.pageLink.set(current);\n });\n }\n\n onPaginate(event: PageEvent) {\n const current = this.clone(this.pageLink());\n current.page = event.pageIndex;\n current.pageSize = event.pageSize;\n this.pageLink.set(current);\n }\n\n onSort(event: Sort) {\n const current = this.clone(this.pageLink());\n current.sortOrder = event.direction\n ? { property: event.active, direction: Direction[event.direction.toUpperCase() as keyof typeof Direction] }\n : undefined!;\n current.page = 0;\n this.pageLink.set(current);\n }\n\n enterFilterMode() {\n this.textSearchMode.set(true);\n afterNextRender(\n () => {\n const input = this.searchInputField()?.nativeElement;\n if (input) {\n input.focus();\n input.setSelectionRange(0, 0);\n }\n },\n { injector: this.injector },\n );\n }\n\n exitFilterMode() {\n this.textSearchMode.set(false);\n this.searchControl.reset();\n }\n\n isAllSelected(): boolean {\n return this.selection.selected.length === this.dataSource().length && this.dataSource().length > 0;\n }\n\n isIndeterminate(): boolean {\n return this.selection.selected.length > 0 && !this.isAllSelected();\n }\n\n masterToggle(): void {\n if (this.isAllSelected()) {\n this.selection.clear();\n } else {\n this.dataSource().forEach((row) => this.selection.select(row));\n }\n }\n\n toggleRow(entity: T): void {\n this.selection.toggle(entity);\n }\n\n clearSelection(): void {\n this.selection.clear();\n }\n\n onCellClick(event: Event, entity: T, column: EntityColumnExtended<T>) {\n this.cellClick.emit({ event, entity, column });\n }\n\n onRowClick(event: MouseEvent, entity: T): void {\n if (this.expandable()) {\n this.toggleExpansion(entity, event.currentTarget as HTMLElement);\n return;\n }\n this.rowClick.emit(entity);\n }\n\n isExpanded(entity: T): boolean {\n return this.expandedKeys().has(this.expansionTrackBy()(entity));\n }\n\n readonly isExpandedRow = (_: number, row: T): boolean => this.isExpanded(row);\n\n toggleExpansion(entity: T, rowElement?: HTMLElement): void {\n const key = this.expansionTrackBy()(entity);\n const nextKeys = new Set(this.expandedKeys());\n const wasExpanded = nextKeys.has(key);\n if (wasExpanded) {\n nextKeys.delete(key);\n } else {\n nextKeys.add(key);\n }\n this.expandedKeys.set(nextKeys);\n this.emitExpansionChange();\n this.table()?.renderRows();\n\n if (wasExpanded) {\n return;\n }\n\n this.lastExpandedKey.set(key);\n\n if (!rowElement) {\n return;\n }\n\n afterNextRender(\n () => {\n this.scrollExpandedRowUnderHeader(rowElement);\n this.lastExpandedKey.set(null);\n },\n { injector: this.injector },\n );\n }\n\n private scrollExpandedRowUnderHeader(rowElement: HTMLElement): void {\n const container = this.tableScrollContainer()?.nativeElement;\n if (!container) {\n return;\n }\n const headerRow = container.querySelector<HTMLElement>('.mat-mdc-header-row');\n const headerHeight = headerRow?.offsetHeight ?? 0;\n const containerRect = container.getBoundingClientRect();\n const rowRect = rowElement.getBoundingClientRect();\n const targetScrollTop = container.scrollTop + rowRect.top - containerRect.top - headerHeight;\n container.scrollTo({ top: targetScrollTop, behavior: 'smooth' });\n }\n\n private reconcileSelection(data: T[]): void {\n if (this.selection.isEmpty()) {\n return;\n }\n const trackBy = this.selectionTrackBy();\n const previousSelected = this.selection.selected;\n const dataKeySet = new Set(data.map(trackBy));\n const nextSelected = data.filter((entity) => {\n const key = trackBy(entity);\n return dataKeySet.has(key) && previousSelected.some((previous) => trackBy(previous) === key);\n });\n this.selection.clear();\n if (nextSelected.length > 0) {\n this.selection.select(...nextSelected);\n }\n }\n\n private reconcileExpansion(data: T[]): void {\n const previousKeys = this.expandedKeys();\n if (previousKeys.size === 0) {\n return;\n }\n const trackBy = this.expansionTrackBy();\n const nextKeys = new Set<unknown>();\n for (const entity of data) {\n const key = trackBy(entity);\n if (previousKeys.has(key)) {\n nextKeys.add(key);\n }\n }\n if (nextKeys.size === previousKeys.size) {\n return;\n }\n this.expandedKeys.set(nextKeys);\n this.emitExpansionChange();\n }\n\n private emitExpansionChange(): void {\n const keys = this.expandedKeys();\n const trackBy = this.expansionTrackBy();\n const expandedEntities = this.dataSource().filter((entity) => keys.has(trackBy(entity)));\n this.expansionChange.emit(expandedEntities);\n }\n\n onExpandToggleClick(event: Event, entity: T): void {\n event.stopPropagation();\n const rowElement = (event.target as HTMLElement).closest('mat-row') as HTMLElement;\n this.toggleExpansion(entity, rowElement);\n }\n\n onActionClick(event: Event, entity: T, action: TableRowAction<T>) {\n event.stopPropagation();\n if (action.handler) {\n action.handler(entity);\n } else {\n this.actionClick.emit({ event, entity, action });\n }\n }\n\n onHeaderActionClick(event: Event, action: TableHeaderAction) {\n if (action.handler) {\n action.handler();\n } else {\n this.headerActionClick.emit({ event, action });\n }\n }\n\n onBulkActionClick(event: Event, action: TableBulkAction<T>) {\n if (action.handler) {\n action.handler(this.selection.selected);\n } else {\n this.bulkActionClick.emit({ event, action, selected: this.selection.selected });\n }\n }\n\n private clone(link: PageLink): PageLink {\n return Object.assign(Object.create(Object.getPrototypeOf(link)), link);\n }\n}\n","<div class=\"tb-table-widget tb-absolute-fill\">\n <div class=\"tb-absolute-fill flex flex-1 flex-col\">\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'default'\">\n <span\n class=\"tb-entity-table-title\"\n [matTooltip]=\"widgetTitle() | translate\"\n matTooltipPosition=\"above\"\n [matTooltipShowDelay]=\"500\"\n [matTooltipHideDelay]=\"200\">\n {{ widgetTitle() | translate }}\n </span>\n <span class=\"flex-1\"></span>\n @for (action of visibleHeaderActions(); track action.id) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled() : false\"\n (click)=\"onHeaderActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n [disabled]=\"loadingState().phase !== LoadingPhase.IDLE\"\n (click)=\"enterFilterMode()\"\n matTooltip=\"{{ 'action.search' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n </mat-toolbar>\n <mat-toolbar class=\"mat-mdc-table-toolbar\" [class.!hidden]=\"toolbarMode() !== 'search'\">\n <div class=\"mat-toolbar-tools\">\n <button mat-icon-button matTooltip=\"{{ 'action.search' | translate }}\" matTooltipPosition=\"above\">\n <mat-icon>search</mat-icon>\n </button>\n <mat-form-field class=\"flex-1\">\n <mat-label>&nbsp;</mat-label>\n <input #searchInput matInput [formControl]=\"searchControl\" placeholder=\"{{ 'entity.search' | translate }}\" />\n </mat-form-field>\n <button\n mat-icon-button\n (click)=\"exitFilterMode()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </mat-toolbar>\n @if (selectionEnabled()) {\n <mat-toolbar class=\"mat-mdc-table-toolbar mat-mdc-table-toolbar--bulk\" [class.!hidden]=\"toolbarMode() !== 'bulk'\">\n <span class=\"tb-entity-table-title\"\n >{{ selection.selected.length }} {{ 'widgets.segmented-button.selected' | translate }}</span\n >\n <span class=\"flex-1\"></span>\n @for (action of visibleBulkActions(); track action.id) {\n <button\n mat-icon-button\n [disabled]=\"action.disabled ? action.disabled(selection.selected) : false\"\n (click)=\"onBulkActionClick($event, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n <button\n mat-icon-button\n (click)=\"clearSelection()\"\n matTooltip=\"{{ 'action.close' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar>\n }\n <div\n #tableScrollContainer\n cdkScrollable\n class=\"table-container flex-1 relative\"\n [style.overflow]=\"loadingState().phase !== LoadingPhase.IDLE ? 'hidden' : 'auto'\">\n @if (loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n\n <table\n mat-table\n [dataSource]=\"dataSource()\"\n [multiTemplateDataRows]=\"true\"\n matSort\n [matSortActive]=\"pageLink().sortOrder?.property || ''\"\n [matSortDirection]=\"pageLinkSortDirection()\"\n (matSortChange)=\"onSort($event)\">\n @if (selectionEnabled()) {\n <ng-container matColumnDef=\"select\" sticky>\n <mat-header-cell *matHeaderCellDef class=\"select-cell\">\n <mat-checkbox [checked]=\"isAllSelected()\" [indeterminate]=\"isIndeterminate()\" (change)=\"masterToggle()\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"select-cell\">\n <mat-checkbox\n [checked]=\"selection.isSelected(entity)\"\n (change)=\"toggleRow(entity)\"\n (click)=\"$event.stopPropagation()\">\n </mat-checkbox>\n </mat-cell>\n </ng-container>\n }\n @for (column of columns(); track column.def) {\n <ng-container [matColumnDef]=\"column.def\">\n <mat-header-cell\n *matHeaderCellDef\n mat-sort-header\n [disabled]=\"!column.sortable\"\n [style]=\"column.headerStyle\"\n class=\"column-header\">\n {{ column.title | translate }}\n </mat-header-cell>\n\n <mat-cell\n *matCellDef=\"let entity; let row = index\"\n [style]=\"entity[column.def + '_style']\"\n (click)=\"onCellClick($event, entity, column)\">\n @if (column.cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column.cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: entity[column.name], entity: entity }\"></ng-container>\n } @else {\n {{ entity[column.name] ?? (column.nullDisplayValue ? (column.nullDisplayValue | translate) : '') }}\n }\n </mat-cell>\n </ng-container>\n }\n @if (rowActions().length > 0 || expandable()) {\n <ng-container matColumnDef=\"actions\" stickyEnd>\n <mat-header-cell *matHeaderCellDef class=\"actions-cell\"></mat-header-cell>\n <mat-cell *matCellDef=\"let entity\" class=\"actions-cell\">\n <div class=\"actions-cell-inner\">\n <div class=\"actions-buttons-full\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-icon-button data-testid=\"expand-row\" (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n </button>\n }\n </div>\n <div class=\"actions-buttons-menu\">\n <button\n mat-icon-button\n [matMenuTriggerFor]=\"actionsMenu\"\n (click)=\"$event.stopPropagation()\"\n matTooltip=\"{{ 'action.actions' | translate }}\"\n matTooltipPosition=\"above\">\n <mat-icon>more_vert</mat-icon>\n </button>\n <mat-menu #actionsMenu=\"matMenu\" xPosition=\"before\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n <button\n mat-menu-item\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n (click)=\"onActionClick($event, entity, action)\">\n <mat-icon>{{ action.icon }}</mat-icon>\n <span>{{ action.label || '' | translate }}</span>\n </button>\n }\n }\n @if (expandable()) {\n <button mat-menu-item (click)=\"onExpandToggleClick($event, entity)\">\n <mat-icon>{{ isExpanded(entity) ? 'expand_less' : 'expand_more' }}</mat-icon>\n <span>{{ (isExpanded(entity) ? 'action.collapse' : 'action.expand') | translate }}</span>\n </button>\n }\n </mat-menu>\n </div>\n </div>\n </mat-cell>\n </ng-container>\n }\n @if (expandable()) {\n <ng-container matColumnDef=\"expandedDetail\">\n <td\n mat-cell\n *matCellDef=\"let entity\"\n class=\"expanded-detail-cell\"\n [attr.colspan]=\"effectiveDisplayedColumns().length\"\n [attr.data-expand-key]=\"expansionTrackBy()(entity)\">\n @if (isExpanded(entity) && expandedRowTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"expandedRowTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entity, entity: entity }\"></ng-container>\n }\n </td>\n </ng-container>\n }\n <mat-header-row *matHeaderRowDef=\"effectiveDisplayedColumns(); sticky: true\"></mat-header-row>\n <mat-row\n [class.invisible]=\"isLoadingState()\"\n [class.tb-expandable]=\"expandable()\"\n *matRowDef=\"let entity; columns: effectiveDisplayedColumns(); let row = index\"\n (click)=\"onRowClick($event, entity)\"></mat-row>\n @if (expandable()) {\n <tr\n mat-row\n *matRowDef=\"let entity; when: isExpandedRow; columns: detailRowColumns()\"\n class=\"detail-row\"\n [class.invisible]=\"\n loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\n \"></tr>\n }\n </table>\n @if (loadingState().phase === LoadingPhase.IDLE && dataSource().length === 0) {\n <span class=\"no-data-found flex items-center justify-center\">\n {{ noDataMessage() | translate }}\n </span>\n }\n @if (loadingState().phase === LoadingPhase.FETCHING) {\n <tb-loading-overlay [state]=\"loadingState()\"></tb-loading-overlay>\n }\n </div>\n <mat-divider></mat-divider>\n <mat-paginator\n [disabled]=\"loadingState().phase === LoadingPhase.GENERATING || loadingState().phase === LoadingPhase.POLLING\"\n [length]=\"totalElements()\"\n [pageIndex]=\"pageLink().page\"\n [pageSize]=\"pageLink().pageSize\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n (page)=\"onPaginate($event)\"\n showFirstLastButtons></mat-paginator>\n </div>\n</div>\n","import { Component, computed, input, output } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\n@Component({\n standalone: true,\n imports: [MatButtonModule, MatIconModule],\n selector: 'tb-action-button',\n templateUrl: './action-button.component.html',\n styleUrls: ['./action-button.component.scss'],\n})\nexport class ActionButtonComponent {\n icon = input<string | null>(null);\n label = input<string | null>(null);\n backgroundColor = input<string | null>(null);\n textColor = input<string | null>(null);\n\n clicked = output<void>();\n\n protected readonly resolvedBackgroundColor = computed(() => {\n const bg = this.backgroundColor();\n if (!bg) return null;\n return bg.startsWith('--') ? `var(${bg})` : bg;\n });\n\n protected readonly resolvedTextColor = computed(() => {\n const color = this.textColor();\n if (!color) return null;\n return color.startsWith('--') ? `var(${color})` : color;\n });\n\n protected handleClick(): void {\n this.clicked.emit();\n }\n}\n","<button\n mat-flat-button\n class=\"action-button\"\n [style.--mat-button-filled-container-color]=\"resolvedBackgroundColor()\"\n [style.--mat-button-filled-label-text-color]=\"resolvedTextColor()\"\n (click)=\"handleClick()\">\n @if (icon()) {\n <mat-icon>{{ icon() }}</mat-icon>\n }\n @if (label()) {\n <span class=\"action-button__label\">{{ label() }}</span>\n }\n</button>\n","import { DestroyRef, effect, Injector, signal, Signal, untracked } from '@angular/core';\nimport { IWidgetSubscription, WidgetSubscriptionOptions } from '@core/public-api';\nimport { EntityColumn, findEntityKeyByColumnDef } from '@home/components/public-api';\nimport { WidgetContext } from '@home/models/widget-component.models';\nimport {\n DataEntry,\n DataKeyType,\n Direction,\n EntityDataPageLink,\n EntityFilter,\n EntityId,\n EntityKeyType,\n KeyFilter,\n PageLink,\n widgetType,\n} from '@shared/public-api';\nimport { Subscription } from 'rxjs';\nimport { getLoadingState, LoadingState } from '../loading-overlay/loading-overlay.models';\n\nexport interface SubscriptionDataKey {\n name: string;\n type: DataKeyType;\n label?: string;\n decimals?: number;\n settings?: Record<string, unknown>;\n}\n\nexport interface TbSubscriptionDatasourceConfig<T> {\n ctx: WidgetContext;\n entityFilter: Signal<EntityFilter>;\n dataKeys: SubscriptionDataKey[];\n widgetType: widgetType;\n keyFilters?: KeyFilter[];\n dataMapper: (subscription: IWidgetSubscription) => T[];\n injector: Injector;\n}\n\nexport interface TbSubscriptionDatasourcePaginatedConfig<T> extends TbSubscriptionDatasourceConfig<T> {\n columns: EntityColumn[];\n pageLink: Signal<PageLink>;\n}\n\nexport class TbSubscriptionDatasource<T> {\n readonly data = signal<T[]>([]);\n readonly loadingState = signal<LoadingState>(getLoadingState.fetching());\n\n private subscription: IWidgetSubscription | null = null;\n private subscriptionSub: Subscription | null = null;\n\n constructor(private readonly config: TbSubscriptionDatasourceConfig<T>) {\n const injector = config.injector;\n\n effect(\n () => {\n const entityFilter = config.entityFilter();\n untracked(() => this.recreateSubscription(entityFilter, config.widgetType));\n },\n { injector },\n );\n\n injector.get(DestroyRef).onDestroy(() => this.cleanup());\n }\n\n refresh(): void {\n this.recreateSubscription(this.config.entityFilter(), this.config.widgetType);\n }\n\n private recreateSubscription(entityFilter: EntityFilter, widgetType: widgetType): void {\n this.cleanup();\n this.loadingState.set(getLoadingState.fetching());\n\n const options: WidgetSubscriptionOptions = {\n type: widgetType,\n datasources: [\n {\n type: 'entity',\n dataKeys: this.config.dataKeys,\n entityFilter,\n },\n ],\n hasDataPageLink: false,\n useDashboardTimewindow: true,\n callbacks: {\n onDataUpdated: () => this.onDataUpdated(),\n },\n };\n\n this.subscriptionSub = this.config.ctx.subscriptionApi!\n .createSubscription(options, true)\n .subscribe((subscription: IWidgetSubscription) => {\n this.subscription = subscription;\n });\n }\n\n private onDataUpdated(): void {\n if (!this.subscription) {\n return;\n }\n this.data.set(this.config.dataMapper(this.subscription));\n this.loadingState.set(getLoadingState.idle());\n this.config.ctx.detectChanges();\n }\n\n private cleanup(): void {\n this.subscriptionSub?.unsubscribe();\n this.subscriptionSub = null;\n this.subscription?.destroy();\n this.subscription = null;\n }\n}\n\nexport class TbSubscriptionDatasourcePaginated<T> {\n readonly data = signal<T[]>([]);\n readonly totalElements = signal<number>(0);\n readonly loadingState = signal<LoadingState>(getLoadingState.fetching());\n\n private subscription: IWidgetSubscription | null = null;\n private subscriptionSub: Subscription | null = null;\n\n constructor(private readonly config: TbSubscriptionDatasourcePaginatedConfig<T>) {\n const injector = config.injector;\n\n effect(\n () => {\n const entityFilter = config.entityFilter();\n const pageLink = untracked(() => config.pageLink());\n untracked(() => this.recreateSubscription(entityFilter, pageLink, config.widgetType));\n },\n { injector },\n );\n\n effect(\n () => {\n const pageLink = config.pageLink();\n untracked(() => {\n if (this.subscription) {\n this.subscription.subscribeForPaginatedData(0, this.toEntityPageLink(pageLink), config.keyFilters ?? []);\n }\n });\n },\n { injector },\n );\n\n injector.get(DestroyRef).onDestroy(() => this.cleanup());\n }\n\n refresh(): void {\n if (this.subscription) {\n this.subscription.subscribeForPaginatedData(\n 0,\n this.toEntityPageLink(untracked(() => this.config.pageLink())),\n this.config.keyFilters ?? [],\n );\n }\n }\n\n private recreateSubscription(entityFilter: EntityFilter, pageLink: PageLink, widgetType: widgetType): void {\n this.cleanup();\n this.loadingState.set(getLoadingState.fetching());\n\n const options: WidgetSubscriptionOptions = {\n type: widgetType,\n datasources: [\n {\n type: 'entity',\n dataKeys: this.config.dataKeys,\n entityFilter,\n },\n ],\n hasDataPageLink: true,\n useDashboardTimewindow: true,\n callbacks: {\n onDataUpdated: () => this.onDataUpdated(),\n },\n };\n\n this.subscriptionSub = this.config.ctx.subscriptionApi!\n .createSubscription(options, true)\n .subscribe((subscription: IWidgetSubscription) => {\n this.subscription = subscription;\n subscription.subscribeForPaginatedData(0, this.toEntityPageLink(pageLink), this.config.keyFilters ?? []);\n });\n }\n\n private onDataUpdated(): void {\n if (!this.subscription) {\n return;\n }\n this.data.set(this.config.dataMapper(this.subscription));\n this.totalElements.set(this.subscription.datasourcePages?.[0]?.totalElements ?? 0);\n this.loadingState.set(getLoadingState.idle());\n this.config.ctx.detectChanges();\n }\n\n private toEntityPageLink(pageLink: PageLink): EntityDataPageLink {\n const entityPageLink: EntityDataPageLink = {\n page: pageLink.page,\n pageSize: pageLink.pageSize,\n textSearch: pageLink.textSearch,\n dynamic: true,\n };\n\n if (pageLink.sortOrder) {\n const entityKey = findEntityKeyByColumnDef(pageLink.sortOrder.property, this.config.columns);\n if (entityKey) {\n entityPageLink.sortOrder = {\n key: entityKey,\n direction: pageLink.sortOrder.direction,\n };\n }\n } else {\n entityPageLink.sortOrder = {\n key: { key: 'createdTime', type: EntityKeyType.ENTITY_FIELD },\n direction: Direction.DESC,\n };\n }\n\n return entityPageLink;\n }\n\n private cleanup(): void {\n this.subscriptionSub?.unsubscribe();\n this.subscriptionSub = null;\n this.subscription?.destroy();\n this.subscription = null;\n }\n}\n\nexport function collectSubscriptionData<T extends { id: EntityId; name: string }>(\n subscription: IWidgetSubscription,\n valueTransformer?: (keyName: string, dataPoint: DataEntry | null) => unknown,\n): T[] {\n const itemMap: Record<string, Record<string, unknown>> = {};\n\n for (const datasource of subscription.datasources ?? []) {\n itemMap[datasource.name!] = {\n id: datasource.entity!.id,\n name: datasource.name,\n };\n }\n\n for (const datasourceData of subscription.data ?? []) {\n const item = itemMap[datasourceData.datasource.name!];\n if (!item) {\n continue;\n }\n const rawValue: string | null = datasourceData.data[0]?.[1] ?? null;\n item[datasourceData.dataKey.name] = valueTransformer\n ? valueTransformer(datasourceData.dataKey.name, datasourceData.data[0])\n : rawValue;\n }\n\n return Object.values(itemMap) as T[];\n}\n","/*\n * Public API Surface of @dmytrokhylko/tb-cdu-ui\n */\n\n// Components\nexport { BaseTableComponent } from './lib/base-table/base-table.component';\nexport { LoadingOverlayComponent } from './lib/loading-overlay/loading-overlay.component';\nexport { ActionButtonComponent } from './lib/action-button/action-button.component';\n\n// Base Table Models & Types\nexport type { TableRowAction, TableHeaderAction, TableBulkAction, TableState } from './lib/base-table/base-table.models';\n\n// Loading Overlay Models\nexport { LoadingPhase, getLoadingState } from './lib/loading-overlay/loading-overlay.models';\nexport type { LoadingState } from './lib/loading-overlay/loading-overlay.models';\n\n// Entity Column Models\nexport type { EntityColumnExtended } from './lib/models/entity-column.models';\n\n// Constants\nexport { DEFAULT_PAGE_SIZES, DEFAULT_PAGE_LINK_PAGE_SIZE } from './lib/models/constants';\n\n// Data Source Utilities\nexport {\n TbSubscriptionDatasource,\n TbSubscriptionDatasourcePaginated,\n collectSubscriptionData,\n} from './lib/base-table/tb-subscription-datasource';\nexport type {\n TbSubscriptionDatasourceConfig,\n TbSubscriptionDatasourcePaginatedConfig,\n SubscriptionDataKey,\n} from './lib/base-table/tb-subscription-datasource';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i15"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO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,EAAE;QACpD,MAAM,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,IAAK,CAAC;QACrD,IAAI,CAAC,IAAI,EAAE;YACT;QACF;AACA,QAAA,MAAM,QAAQ,GAAkB,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI;QACnE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG;AAClC,cAAE,gBAAgB,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;cACpE,QAAQ;IACd;AAEA,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAQ;AACtC;;AC7PA;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,254 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef, AfterViewInit, ElementRef, Signal, Injector } from '@angular/core';
3
+ import { SelectionModel } from '@angular/cdk/collections';
4
+ import { FormControl } from '@angular/forms';
5
+ import { PageEvent } from '@angular/material/paginator';
6
+ import { SortDirection, Sort } from '@angular/material/sort';
7
+ import { Direction, PageLink, DataKeyType, EntityFilter, widgetType, KeyFilter, EntityId, DataEntry } from '@shared/public-api';
8
+ import { EntityColumn } from '@home/components/public-api';
9
+ import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
10
+ import { IWidgetSubscription } from '@core/public-api';
11
+ import { WidgetContext } from '@home/models/widget-component.models';
12
+
13
+ interface EntityColumnExtended<T = unknown> extends EntityColumn {
14
+ nullDisplayValue?: string;
15
+ headerStyle?: Record<string, string>;
16
+ cellTemplate?: TemplateRef<{
17
+ $implicit: unknown;
18
+ entity: T;
19
+ }>;
20
+ }
21
+
22
+ declare enum LoadingPhase {
23
+ IDLE = "idle",
24
+ GENERATING = "generating",
25
+ POLLING = "polling",
26
+ FETCHING = "fetching"
27
+ }
28
+ type LoadingState = {
29
+ phase: LoadingPhase.IDLE;
30
+ } | {
31
+ phase: LoadingPhase.GENERATING;
32
+ } | {
33
+ phase: LoadingPhase.POLLING;
34
+ processed: number;
35
+ total: number;
36
+ } | {
37
+ phase: LoadingPhase.FETCHING;
38
+ };
39
+ declare const getLoadingState: {
40
+ idle: () => LoadingState;
41
+ generating: () => LoadingState;
42
+ polling: (processed: number, total: number) => LoadingState;
43
+ fetching: () => LoadingState;
44
+ };
45
+
46
+ interface TableRowAction<T> {
47
+ id: string;
48
+ icon: string;
49
+ label?: string;
50
+ visible?: (entity: T) => boolean;
51
+ disabled?: (entity: T) => boolean;
52
+ handler?: (entity: T) => void;
53
+ }
54
+ interface TableHeaderAction {
55
+ id: string;
56
+ icon: string;
57
+ label?: string;
58
+ visible?: () => boolean;
59
+ disabled?: () => boolean;
60
+ handler?: () => void;
61
+ }
62
+ interface TableBulkAction<T> {
63
+ id: string;
64
+ icon: string;
65
+ label?: string;
66
+ visible?: () => boolean;
67
+ disabled?: (selected: T[]) => boolean;
68
+ handler?: (selected: T[]) => void;
69
+ }
70
+ interface TableState {
71
+ pageIndex: number;
72
+ pageSize: number;
73
+ sortProperty: string;
74
+ sortDirection: Direction | null;
75
+ textSearch: string;
76
+ }
77
+
78
+ declare class BaseTableComponent<T> implements AfterViewInit {
79
+ dataSource: _angular_core.InputSignal<T[]>;
80
+ columns: _angular_core.InputSignal<EntityColumnExtended<T>[]>;
81
+ displayedColumns: _angular_core.InputSignal<string[]>;
82
+ loadingState: _angular_core.InputSignal<LoadingState>;
83
+ widgetTitle: _angular_core.InputSignal<string>;
84
+ noDataMessage: _angular_core.InputSignal<string>;
85
+ totalElements: _angular_core.InputSignal<number>;
86
+ pageSizeOptions: _angular_core.InputSignal<number[]>;
87
+ selectionEnabled: _angular_core.InputSignal<boolean>;
88
+ rowActions: _angular_core.InputSignal<TableRowAction<T>[]>;
89
+ headerActions: _angular_core.InputSignal<TableHeaderAction[]>;
90
+ bulkActions: _angular_core.InputSignal<TableBulkAction<T>[]>;
91
+ expandable: _angular_core.InputSignal<boolean>;
92
+ expandedRowTemplate: _angular_core.InputSignal<TemplateRef<{
93
+ $implicit: T;
94
+ entity: T;
95
+ }> | null>;
96
+ expansionTrackBy: _angular_core.InputSignal<(entity: T) => unknown>;
97
+ selectionTrackBy: _angular_core.InputSignal<(entity: T) => unknown>;
98
+ clearSelectionTrigger: _angular_core.InputSignal<unknown>;
99
+ pageLink: _angular_core.ModelSignal<PageLink>;
100
+ rowClick: _angular_core.OutputEmitterRef<T>;
101
+ cellClick: _angular_core.OutputEmitterRef<{
102
+ event: Event;
103
+ entity: T;
104
+ column: EntityColumnExtended<T>;
105
+ }>;
106
+ actionClick: _angular_core.OutputEmitterRef<{
107
+ event: Event;
108
+ entity: T;
109
+ action: TableRowAction<T>;
110
+ }>;
111
+ headerActionClick: _angular_core.OutputEmitterRef<{
112
+ event: Event;
113
+ action: TableHeaderAction;
114
+ }>;
115
+ bulkActionClick: _angular_core.OutputEmitterRef<{
116
+ event: Event;
117
+ action: TableBulkAction<T>;
118
+ selected: T[];
119
+ }>;
120
+ selectionChange: _angular_core.OutputEmitterRef<T[]>;
121
+ expansionChange: _angular_core.OutputEmitterRef<T[]>;
122
+ textSearchMode: _angular_core.WritableSignal<boolean>;
123
+ readonly selection: SelectionModel<T>;
124
+ readonly expandedKeys: _angular_core.WritableSignal<Set<unknown>>;
125
+ readonly lastExpandedKey: _angular_core.WritableSignal<unknown>;
126
+ readonly detailRowColumns: _angular_core.Signal<string[]>;
127
+ private readonly selectionCount;
128
+ readonly isLoadingState: _angular_core.Signal<boolean>;
129
+ readonly toolbarMode: _angular_core.Signal<"default" | "search" | "bulk">;
130
+ readonly effectiveDisplayedColumns: _angular_core.Signal<string[]>;
131
+ readonly visibleHeaderActions: _angular_core.Signal<TableHeaderAction[]>;
132
+ readonly visibleBulkActions: _angular_core.Signal<TableBulkAction<T>[]>;
133
+ pageLinkSortDirection: _angular_core.Signal<SortDirection>;
134
+ searchControl: FormControl<string>;
135
+ searchInputField: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
136
+ private readonly table;
137
+ private readonly tableScrollContainer;
138
+ protected readonly LoadingPhase: typeof LoadingPhase;
139
+ private injector;
140
+ private destroyRef;
141
+ constructor();
142
+ ngAfterViewInit(): void;
143
+ onPaginate(event: PageEvent): void;
144
+ onSort(event: Sort): void;
145
+ enterFilterMode(): void;
146
+ exitFilterMode(): void;
147
+ isAllSelected(): boolean;
148
+ isIndeterminate(): boolean;
149
+ masterToggle(): void;
150
+ toggleRow(entity: T): void;
151
+ clearSelection(): void;
152
+ onCellClick(event: Event, entity: T, column: EntityColumnExtended<T>): void;
153
+ onRowClick(event: MouseEvent, entity: T): void;
154
+ isExpanded(entity: T): boolean;
155
+ readonly isExpandedRow: (_: number, row: T) => boolean;
156
+ toggleExpansion(entity: T, rowElement?: HTMLElement): void;
157
+ private scrollExpandedRowUnderHeader;
158
+ private reconcileSelection;
159
+ private reconcileExpansion;
160
+ private emitExpansionChange;
161
+ onExpandToggleClick(event: Event, entity: T): void;
162
+ onActionClick(event: Event, entity: T, action: TableRowAction<T>): void;
163
+ onHeaderActionClick(event: Event, action: TableHeaderAction): void;
164
+ onBulkActionClick(event: Event, action: TableBulkAction<T>): void;
165
+ private clone;
166
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseTableComponent<any>, never>;
167
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BaseTableComponent<any>, "tb-base-table", never, { "dataSource": { "alias": "dataSource"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "displayedColumns": { "alias": "displayedColumns"; "required": true; "isSignal": true; }; "loadingState": { "alias": "loadingState"; "required": true; "isSignal": true; }; "widgetTitle": { "alias": "widgetTitle"; "required": false; "isSignal": true; }; "noDataMessage": { "alias": "noDataMessage"; "required": false; "isSignal": true; }; "totalElements": { "alias": "totalElements"; "required": false; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; "selectionEnabled": { "alias": "selectionEnabled"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "headerActions": { "alias": "headerActions"; "required": false; "isSignal": true; }; "bulkActions": { "alias": "bulkActions"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "expandedRowTemplate": { "alias": "expandedRowTemplate"; "required": false; "isSignal": true; }; "expansionTrackBy": { "alias": "expansionTrackBy"; "required": false; "isSignal": true; }; "selectionTrackBy": { "alias": "selectionTrackBy"; "required": false; "isSignal": true; }; "clearSelectionTrigger": { "alias": "clearSelectionTrigger"; "required": false; "isSignal": true; }; "pageLink": { "alias": "pageLink"; "required": false; "isSignal": true; }; }, { "pageLink": "pageLinkChange"; "rowClick": "rowClick"; "cellClick": "cellClick"; "actionClick": "actionClick"; "headerActionClick": "headerActionClick"; "bulkActionClick": "bulkActionClick"; "selectionChange": "selectionChange"; "expansionChange": "expansionChange"; }, never, never, true, never>;
168
+ }
169
+
170
+ declare class LoadingOverlayComponent {
171
+ state: _angular_core.InputSignal<LoadingState>;
172
+ mode: _angular_core.InputSignal<ProgressSpinnerMode>;
173
+ generating: _angular_core.InputSignal<string>;
174
+ processingDeterminate: _angular_core.InputSignal<string>;
175
+ processingIndeterminate: _angular_core.InputSignal<string>;
176
+ fetching: _angular_core.InputSignal<string>;
177
+ protected readonly LoadingPhase: typeof LoadingPhase;
178
+ spinnerMode: _angular_core.Signal<ProgressSpinnerMode>;
179
+ percentage: _angular_core.Signal<number>;
180
+ pollingProcessed: _angular_core.Signal<number>;
181
+ pollingTotal: _angular_core.Signal<number>;
182
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LoadingOverlayComponent, never>;
183
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LoadingOverlayComponent, "tb-loading-overlay", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "generating": { "alias": "generating"; "required": false; "isSignal": true; }; "processingDeterminate": { "alias": "processingDeterminate"; "required": false; "isSignal": true; }; "processingIndeterminate": { "alias": "processingIndeterminate"; "required": false; "isSignal": true; }; "fetching": { "alias": "fetching"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
184
+ }
185
+
186
+ declare class ActionButtonComponent {
187
+ icon: _angular_core.InputSignal<string | null>;
188
+ label: _angular_core.InputSignal<string | null>;
189
+ backgroundColor: _angular_core.InputSignal<string | null>;
190
+ textColor: _angular_core.InputSignal<string | null>;
191
+ clicked: _angular_core.OutputEmitterRef<void>;
192
+ protected readonly resolvedBackgroundColor: _angular_core.Signal<string | null>;
193
+ protected readonly resolvedTextColor: _angular_core.Signal<string | null>;
194
+ protected handleClick(): void;
195
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ActionButtonComponent, never>;
196
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ActionButtonComponent, "tb-action-button", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "textColor": { "alias": "textColor"; "required": false; "isSignal": true; }; }, { "clicked": "clicked"; }, never, never, true, never>;
197
+ }
198
+
199
+ declare const DEFAULT_PAGE_LINK_PAGE_SIZE = 20;
200
+ declare const DEFAULT_PAGE_SIZES: number[];
201
+
202
+ interface SubscriptionDataKey {
203
+ name: string;
204
+ type: DataKeyType;
205
+ label?: string;
206
+ decimals?: number;
207
+ settings?: Record<string, unknown>;
208
+ }
209
+ interface TbSubscriptionDatasourceConfig<T> {
210
+ ctx: WidgetContext;
211
+ entityFilter: Signal<EntityFilter>;
212
+ dataKeys: SubscriptionDataKey[];
213
+ widgetType: widgetType;
214
+ keyFilters?: KeyFilter[];
215
+ dataMapper: (subscription: IWidgetSubscription) => T[];
216
+ injector: Injector;
217
+ }
218
+ interface TbSubscriptionDatasourcePaginatedConfig<T> extends TbSubscriptionDatasourceConfig<T> {
219
+ columns: EntityColumn[];
220
+ pageLink: Signal<PageLink>;
221
+ }
222
+ declare class TbSubscriptionDatasource<T> {
223
+ private readonly config;
224
+ readonly data: _angular_core.WritableSignal<T[]>;
225
+ readonly loadingState: _angular_core.WritableSignal<LoadingState>;
226
+ private subscription;
227
+ private subscriptionSub;
228
+ constructor(config: TbSubscriptionDatasourceConfig<T>);
229
+ refresh(): void;
230
+ private recreateSubscription;
231
+ private onDataUpdated;
232
+ private cleanup;
233
+ }
234
+ declare class TbSubscriptionDatasourcePaginated<T> {
235
+ private readonly config;
236
+ readonly data: _angular_core.WritableSignal<T[]>;
237
+ readonly totalElements: _angular_core.WritableSignal<number>;
238
+ readonly loadingState: _angular_core.WritableSignal<LoadingState>;
239
+ private subscription;
240
+ private subscriptionSub;
241
+ constructor(config: TbSubscriptionDatasourcePaginatedConfig<T>);
242
+ refresh(): void;
243
+ private recreateSubscription;
244
+ private onDataUpdated;
245
+ private toEntityPageLink;
246
+ private cleanup;
247
+ }
248
+ declare function collectSubscriptionData<T extends {
249
+ id: EntityId;
250
+ name: string;
251
+ }>(subscription: IWidgetSubscription, valueTransformer?: (keyName: string, dataPoint: DataEntry | null) => unknown): T[];
252
+
253
+ export { ActionButtonComponent, BaseTableComponent, DEFAULT_PAGE_LINK_PAGE_SIZE, DEFAULT_PAGE_SIZES, LoadingOverlayComponent, LoadingPhase, TbSubscriptionDatasource, TbSubscriptionDatasourcePaginated, collectSubscriptionData, getLoadingState };
254
+ export type { EntityColumnExtended, LoadingState, SubscriptionDataKey, TableBulkAction, TableHeaderAction, TableRowAction, TableState, TbSubscriptionDatasourceConfig, TbSubscriptionDatasourcePaginatedConfig };
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@dmytrokhylko/tb-cdu-ui",
3
+ "version": "0.1.1",
4
+ "description": "ThingsBoard shared UI components library - base table, loading overlay, action button, and data source utilities",
5
+ "peerDependencies": {
6
+ "@angular/common": "^20.0.0",
7
+ "@angular/core": "^20.0.0",
8
+ "@angular/forms": "^20.0.0",
9
+ "@angular/cdk": "^20.0.0",
10
+ "@angular/material": "^20.0.0",
11
+ "@ngx-translate/core": "^17.0.0",
12
+ "thingsboard": "^4.0.0",
13
+ "rxjs": "^7.8.0"
14
+ },
15
+ "dependencies": {
16
+ "tslib": "^2.3.0"
17
+ },
18
+ "sideEffects": false,
19
+ "publishConfig": {
20
+ "registry": "https://registry.npmjs.org",
21
+ "access": "public"
22
+ },
23
+ "module": "fesm2022/dmytrokhylko-tb-cdu-ui.mjs",
24
+ "typings": "index.d.ts",
25
+ "exports": {
26
+ "./package.json": {
27
+ "default": "./package.json"
28
+ },
29
+ ".": {
30
+ "types": "./index.d.ts",
31
+ "default": "./fesm2022/dmytrokhylko-tb-cdu-ui.mjs"
32
+ }
33
+ }
34
+ }