@dmytrokhylko/tb-cdu-ui 0.2.5 → 0.4.0
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 +18 -9
- package/core/index.d.ts +51 -15
- package/fesm2022/dmytrokhylko-tb-cdu-ui-core.mjs +54 -11
- package/fesm2022/dmytrokhylko-tb-cdu-ui-core.mjs.map +1 -1
- package/fesm2022/dmytrokhylko-tb-cdu-ui-widgets.mjs +153 -3
- package/fesm2022/dmytrokhylko-tb-cdu-ui-widgets.mjs.map +1 -1
- package/package.json +1 -1
- package/widgets/index.d.ts +53 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ ThingsBoard Custom Development Unit shared UI components library — base table,
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
yarn add @dmytrokhylko/tb-cdu-ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Package structure
|
|
@@ -30,6 +30,12 @@ import { BaseTableComponent } from '@dmytrokhylko/tb-cdu-ui/core';
|
|
|
30
30
|
| `LoadingOverlayComponent` | `<tb-cd-loading-overlay>` | — |
|
|
31
31
|
| `ActionButtonComponent` | `<tb-cd-action-button>` | — |
|
|
32
32
|
|
|
33
|
+
## Widgets
|
|
34
|
+
|
|
35
|
+
| Widget | Selector | Docs |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `TbCdEntitiesTableComponent` | `<tb-cd-entities-table>` | [widgets/entities-table](./widgets/entities-table/README.md) |
|
|
38
|
+
|
|
33
39
|
## Adapters
|
|
34
40
|
|
|
35
41
|
| Adapter | Description |
|
|
@@ -72,19 +78,22 @@ Secondary entry points are discovered automatically by ng-packagr from directori
|
|
|
72
78
|
## Development
|
|
73
79
|
|
|
74
80
|
```bash
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
yarn install # install dependencies
|
|
82
|
+
yarn build # production build → dist/tb-cdu-ui/
|
|
83
|
+
yarn watch # development build with watch
|
|
84
|
+
yarn format # format source files with Prettier
|
|
85
|
+
yarn format:check # check formatting without writing
|
|
86
|
+
yarn test # run unit tests
|
|
87
|
+
yarn lint # lint source files
|
|
81
88
|
```
|
|
82
89
|
|
|
83
90
|
### Publishing
|
|
84
91
|
|
|
85
|
-
|
|
92
|
+
Bump the version and publish in one step — CI handles the rest:
|
|
86
93
|
|
|
87
94
|
```bash
|
|
88
|
-
|
|
95
|
+
yarn version --patch # or --minor / --major
|
|
89
96
|
git push origin master --tags
|
|
90
97
|
```
|
|
98
|
+
|
|
99
|
+
Pushing a `v*` tag triggers the GitHub Actions workflow which builds and publishes to npm automatically.
|
package/core/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SelectionModel } from '@angular/cdk/collections';
|
|
|
4
4
|
import { FormControl } from '@angular/forms';
|
|
5
5
|
import { PageEvent } from '@angular/material/paginator';
|
|
6
6
|
import { SortDirection, Sort } from '@angular/material/sort';
|
|
7
|
-
import { Direction, PageLink, DataKeyType, EntityFilter, widgetType, KeyFilter, EntityId
|
|
7
|
+
import { DataEntry, Direction, PageLink, DataKeyType, EntityFilter, widgetType, KeyFilter, EntityId } from '@shared/public-api';
|
|
8
8
|
import { EntityColumn } from '@home/components/public-api';
|
|
9
9
|
import { ProgressSpinnerMode } from '@angular/material/progress-spinner';
|
|
10
10
|
import { IWidgetSubscription } from '@core/public-api';
|
|
@@ -23,15 +23,6 @@ declare class ActionButtonComponent {
|
|
|
23
23
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ActionButtonComponent, "tb-cd-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>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
interface EntityColumnExtended<T = unknown> extends EntityColumn {
|
|
27
|
-
nullDisplayValue?: string;
|
|
28
|
-
headerStyle?: Record<string, string>;
|
|
29
|
-
cellTemplate?: TemplateRef<{
|
|
30
|
-
$implicit: unknown;
|
|
31
|
-
entity: T;
|
|
32
|
-
}>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
26
|
declare enum LoadingPhase {
|
|
36
27
|
IDLE = "idle",
|
|
37
28
|
GENERATING = "generating",
|
|
@@ -56,6 +47,23 @@ declare const getLoadingState: {
|
|
|
56
47
|
fetching: () => LoadingState;
|
|
57
48
|
};
|
|
58
49
|
|
|
50
|
+
interface TbCdEntityColumn<T = unknown> extends EntityColumn {
|
|
51
|
+
nullDisplayValue?: string;
|
|
52
|
+
headerStyle?: Record<string, string>;
|
|
53
|
+
cellTemplate?: TemplateRef<{
|
|
54
|
+
$implicit: unknown;
|
|
55
|
+
entity: T;
|
|
56
|
+
}>;
|
|
57
|
+
parseValue?: (dataPoint: DataEntry | null) => unknown;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface TableRowMenuItem<T> {
|
|
61
|
+
id: string;
|
|
62
|
+
icon: string;
|
|
63
|
+
label?: string;
|
|
64
|
+
disabled?: (entity: T) => boolean;
|
|
65
|
+
handler: (entity: T) => void;
|
|
66
|
+
}
|
|
59
67
|
interface TableRowAction<T> {
|
|
60
68
|
id: string;
|
|
61
69
|
icon: string;
|
|
@@ -63,6 +71,14 @@ interface TableRowAction<T> {
|
|
|
63
71
|
visible?: (entity: T) => boolean;
|
|
64
72
|
disabled?: (entity: T) => boolean;
|
|
65
73
|
handler?: (entity: T) => void;
|
|
74
|
+
menuItems?: TableRowMenuItem<T>[];
|
|
75
|
+
}
|
|
76
|
+
interface TableHeaderMenuAction {
|
|
77
|
+
id: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
disabled?: () => boolean;
|
|
81
|
+
handler?: () => void;
|
|
66
82
|
}
|
|
67
83
|
interface TableHeaderAction {
|
|
68
84
|
id: string;
|
|
@@ -71,6 +87,14 @@ interface TableHeaderAction {
|
|
|
71
87
|
visible?: () => boolean;
|
|
72
88
|
disabled?: () => boolean;
|
|
73
89
|
handler?: () => void;
|
|
90
|
+
menuItems?: TableHeaderMenuAction[];
|
|
91
|
+
}
|
|
92
|
+
interface TableBulkMenuItem<T> {
|
|
93
|
+
id: string;
|
|
94
|
+
icon: string;
|
|
95
|
+
label?: string;
|
|
96
|
+
disabled?: (selected: T[]) => boolean;
|
|
97
|
+
handler: (selected: T[]) => void;
|
|
74
98
|
}
|
|
75
99
|
interface TableBulkAction<T> {
|
|
76
100
|
id: string;
|
|
@@ -79,6 +103,7 @@ interface TableBulkAction<T> {
|
|
|
79
103
|
visible?: () => boolean;
|
|
80
104
|
disabled?: (selected: T[]) => boolean;
|
|
81
105
|
handler?: (selected: T[]) => void;
|
|
106
|
+
menuItems?: TableBulkMenuItem<T>[];
|
|
82
107
|
}
|
|
83
108
|
interface TableState {
|
|
84
109
|
pageIndex: number;
|
|
@@ -90,11 +115,16 @@ interface TableState {
|
|
|
90
115
|
|
|
91
116
|
declare class BaseTableComponent<T> implements AfterViewInit {
|
|
92
117
|
dataSource: _angular_core.InputSignal<T[]>;
|
|
93
|
-
columns: _angular_core.InputSignal<
|
|
118
|
+
columns: _angular_core.InputSignal<TbCdEntityColumn<T>[]>;
|
|
94
119
|
displayedColumns: _angular_core.InputSignal<string[]>;
|
|
95
120
|
loadingState: _angular_core.InputSignal<LoadingState>;
|
|
96
121
|
widgetTitle: _angular_core.InputSignal<string>;
|
|
97
122
|
noDataMessage: _angular_core.InputSignal<string>;
|
|
123
|
+
titleStyle: _angular_core.InputSignal<Record<string, string>>;
|
|
124
|
+
columnHeaderStyle: _angular_core.InputSignal<Record<string, string>>;
|
|
125
|
+
backgroundColor: _angular_core.InputSignal<string | null>;
|
|
126
|
+
color: _angular_core.InputSignal<string | null>;
|
|
127
|
+
readonly tableColorStyle: _angular_core.Signal<Record<string, string>>;
|
|
98
128
|
totalElements: _angular_core.InputSignal<number>;
|
|
99
129
|
pageSizeOptions: _angular_core.InputSignal<number[]>;
|
|
100
130
|
selectionEnabled: _angular_core.InputSignal<boolean>;
|
|
@@ -114,7 +144,7 @@ declare class BaseTableComponent<T> implements AfterViewInit {
|
|
|
114
144
|
cellClick: _angular_core.OutputEmitterRef<{
|
|
115
145
|
event: Event;
|
|
116
146
|
entity: T;
|
|
117
|
-
column:
|
|
147
|
+
column: TbCdEntityColumn<T>;
|
|
118
148
|
}>;
|
|
119
149
|
actionClick: _angular_core.OutputEmitterRef<{
|
|
120
150
|
event: Event;
|
|
@@ -151,6 +181,11 @@ declare class BaseTableComponent<T> implements AfterViewInit {
|
|
|
151
181
|
protected readonly LoadingPhase: typeof LoadingPhase;
|
|
152
182
|
private injector;
|
|
153
183
|
private destroyRef;
|
|
184
|
+
private document;
|
|
185
|
+
private menuStyleEl;
|
|
186
|
+
readonly paginatorSelectConfig: {
|
|
187
|
+
panelClass: string;
|
|
188
|
+
};
|
|
154
189
|
constructor();
|
|
155
190
|
ngAfterViewInit(): void;
|
|
156
191
|
onPaginate(event: PageEvent): void;
|
|
@@ -162,7 +197,7 @@ declare class BaseTableComponent<T> implements AfterViewInit {
|
|
|
162
197
|
masterToggle(): void;
|
|
163
198
|
toggleRow(entity: T): void;
|
|
164
199
|
clearSelection(): void;
|
|
165
|
-
onCellClick(event: Event, entity: T, column:
|
|
200
|
+
onCellClick(event: Event, entity: T, column: TbCdEntityColumn<T>): void;
|
|
166
201
|
onRowClick(event: MouseEvent, entity: T): void;
|
|
167
202
|
isExpanded(entity: T): boolean;
|
|
168
203
|
readonly isExpandedRow: (_: number, row: T) => boolean;
|
|
@@ -175,9 +210,10 @@ declare class BaseTableComponent<T> implements AfterViewInit {
|
|
|
175
210
|
onActionClick(event: Event, entity: T, action: TableRowAction<T>): void;
|
|
176
211
|
onHeaderActionClick(event: Event, action: TableHeaderAction): void;
|
|
177
212
|
onBulkActionClick(event: Event, action: TableBulkAction<T>): void;
|
|
213
|
+
private updateMenuOverlayStyles;
|
|
178
214
|
private clone;
|
|
179
215
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseTableComponent<any>, never>;
|
|
180
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BaseTableComponent<any>, "tb-cd-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>;
|
|
216
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BaseTableComponent<any>, "tb-cd-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; }; "titleStyle": { "alias": "titleStyle"; "required": false; "isSignal": true; }; "columnHeaderStyle": { "alias": "columnHeaderStyle"; "required": false; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "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>;
|
|
181
217
|
}
|
|
182
218
|
|
|
183
219
|
declare class LoadingOverlayComponent {
|
|
@@ -251,4 +287,4 @@ declare function collectSubscriptionData<T extends {
|
|
|
251
287
|
}>(subscription: IWidgetSubscription, valueTransformer?: (keyName: string, dataPoint: DataEntry | null) => unknown): T[];
|
|
252
288
|
|
|
253
289
|
export { ActionButtonComponent, BaseTableComponent, DEFAULT_PAGE_LINK_PAGE_SIZE, DEFAULT_PAGE_SIZES, LoadingOverlayComponent, LoadingPhase, TbSubscriptionDatasource, TbSubscriptionDatasourcePaginated, collectSubscriptionData, getLoadingState };
|
|
254
|
-
export type {
|
|
290
|
+
export type { LoadingState, SubscriptionDataKey, TableBulkAction, TableBulkMenuItem, TableHeaderAction, TableHeaderMenuAction, TableRowAction, TableRowMenuItem, TableState, TbCdEntityColumn, TbSubscriptionDatasourceConfig, TbSubscriptionDatasourcePaginatedConfig };
|
|
@@ -8,7 +8,7 @@ import { SelectionModel } from '@angular/cdk/collections';
|
|
|
8
8
|
import * as i6 from '@angular/cdk/scrolling';
|
|
9
9
|
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
10
10
|
import * as i1$2 from '@angular/common';
|
|
11
|
-
import { CommonModule } from '@angular/common';
|
|
11
|
+
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
12
12
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
13
13
|
import * as i14 from '@angular/forms';
|
|
14
14
|
import { FormControl } from '@angular/forms';
|
|
@@ -60,13 +60,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
60
60
|
args: [{ standalone: true, imports: [MatButtonModule, MatIconModule], selector: 'tb-cd-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"] }]
|
|
61
61
|
}], 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"] }] } });
|
|
62
62
|
|
|
63
|
-
const DEFAULT_PAGE_LINK_PAGE_SIZE = 20;
|
|
64
|
-
const DEFAULT_PAGE_SIZES = [
|
|
65
|
-
DEFAULT_PAGE_LINK_PAGE_SIZE,
|
|
66
|
-
DEFAULT_PAGE_LINK_PAGE_SIZE * 5,
|
|
67
|
-
DEFAULT_PAGE_LINK_PAGE_SIZE * 10,
|
|
68
|
-
];
|
|
69
|
-
|
|
70
63
|
var LoadingPhase;
|
|
71
64
|
(function (LoadingPhase) {
|
|
72
65
|
LoadingPhase["IDLE"] = "idle";
|
|
@@ -121,6 +114,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImpo
|
|
|
121
114
|
args: [{ standalone: true, imports: [TranslateModule, MatProgressSpinnerModule], selector: 'tb-cd-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"] }]
|
|
122
115
|
}], 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 }] }] } });
|
|
123
116
|
|
|
117
|
+
const DEFAULT_PAGE_LINK_PAGE_SIZE = 20;
|
|
118
|
+
const DEFAULT_PAGE_SIZES = [
|
|
119
|
+
DEFAULT_PAGE_LINK_PAGE_SIZE,
|
|
120
|
+
DEFAULT_PAGE_LINK_PAGE_SIZE * 5,
|
|
121
|
+
DEFAULT_PAGE_LINK_PAGE_SIZE * 10,
|
|
122
|
+
];
|
|
123
|
+
|
|
124
124
|
class BaseTableComponent {
|
|
125
125
|
dataSource = input.required(...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
126
126
|
columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
@@ -128,6 +128,20 @@ class BaseTableComponent {
|
|
|
128
128
|
loadingState = input.required(...(ngDevMode ? [{ debugName: "loadingState" }] : []));
|
|
129
129
|
widgetTitle = input('widget.widget-title', ...(ngDevMode ? [{ debugName: "widgetTitle" }] : []));
|
|
130
130
|
noDataMessage = input('entity.no-data', ...(ngDevMode ? [{ debugName: "noDataMessage" }] : []));
|
|
131
|
+
titleStyle = input({}, ...(ngDevMode ? [{ debugName: "titleStyle" }] : []));
|
|
132
|
+
columnHeaderStyle = input({}, ...(ngDevMode ? [{ debugName: "columnHeaderStyle" }] : []));
|
|
133
|
+
backgroundColor = input(null, ...(ngDevMode ? [{ debugName: "backgroundColor" }] : []));
|
|
134
|
+
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
135
|
+
tableColorStyle = computed(() => {
|
|
136
|
+
const bg = this.backgroundColor();
|
|
137
|
+
const fg = this.color();
|
|
138
|
+
const style = {};
|
|
139
|
+
if (bg)
|
|
140
|
+
style['--tb-cdu-bg-color'] = bg;
|
|
141
|
+
if (fg)
|
|
142
|
+
style['--tb-cdu-fg-color'] = fg;
|
|
143
|
+
return style;
|
|
144
|
+
}, ...(ngDevMode ? [{ debugName: "tableColorStyle" }] : []));
|
|
131
145
|
totalElements = input(0, ...(ngDevMode ? [{ debugName: "totalElements" }] : []));
|
|
132
146
|
pageSizeOptions = input(DEFAULT_PAGE_SIZES, ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
133
147
|
selectionEnabled = input(false, ...(ngDevMode ? [{ debugName: "selectionEnabled" }] : []));
|
|
@@ -184,6 +198,9 @@ class BaseTableComponent {
|
|
|
184
198
|
LoadingPhase = LoadingPhase;
|
|
185
199
|
injector = inject(Injector);
|
|
186
200
|
destroyRef = inject(DestroyRef);
|
|
201
|
+
document = inject(DOCUMENT);
|
|
202
|
+
menuStyleEl = null;
|
|
203
|
+
paginatorSelectConfig = { panelClass: 'tb-cdu-paginator-select' };
|
|
187
204
|
constructor() {
|
|
188
205
|
effect(() => {
|
|
189
206
|
const data = this.dataSource();
|
|
@@ -205,6 +222,12 @@ class BaseTableComponent {
|
|
|
205
222
|
this.selectionCount.set(this.selection.selected.length);
|
|
206
223
|
this.selectionChange.emit(this.selection.selected);
|
|
207
224
|
});
|
|
225
|
+
effect(() => {
|
|
226
|
+
const bg = this.backgroundColor();
|
|
227
|
+
const fg = this.color();
|
|
228
|
+
this.updateMenuOverlayStyles(bg, fg);
|
|
229
|
+
});
|
|
230
|
+
this.destroyRef.onDestroy(() => this.menuStyleEl?.remove());
|
|
208
231
|
}
|
|
209
232
|
ngAfterViewInit() {
|
|
210
233
|
if (this.pageLink().textSearch) {
|
|
@@ -389,16 +412,36 @@ class BaseTableComponent {
|
|
|
389
412
|
this.bulkActionClick.emit({ event, action, selected: this.selection.selected });
|
|
390
413
|
}
|
|
391
414
|
}
|
|
415
|
+
updateMenuOverlayStyles(bg, fg) {
|
|
416
|
+
if (!bg && !fg) {
|
|
417
|
+
this.menuStyleEl?.remove();
|
|
418
|
+
this.menuStyleEl = null;
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if (!this.menuStyleEl) {
|
|
422
|
+
this.menuStyleEl = this.document.createElement('style');
|
|
423
|
+
this.document.head.appendChild(this.menuStyleEl);
|
|
424
|
+
}
|
|
425
|
+
const bgRule = bg ? `background-color: ${bg} !important;` : '';
|
|
426
|
+
const fgRule = fg ? `color: ${fg} !important;` : '';
|
|
427
|
+
this.menuStyleEl.textContent = `
|
|
428
|
+
.tb-cdu-actions-menu .mat-mdc-menu-content { ${bgRule} }
|
|
429
|
+
.tb-cdu-actions-menu .mat-mdc-menu-item { ${fgRule} }
|
|
430
|
+
.tb-cdu-actions-menu .mat-mdc-menu-item .mat-icon { ${fgRule} }
|
|
431
|
+
.tb-cdu-paginator-select.mat-mdc-select-panel { ${bgRule} }
|
|
432
|
+
.tb-cdu-paginator-select.mat-mdc-select-panel .mat-mdc-option { ${fgRule} }
|
|
433
|
+
`;
|
|
434
|
+
}
|
|
392
435
|
clone(link) {
|
|
393
436
|
return Object.assign(Object.create(Object.getPrototypeOf(link)), link);
|
|
394
437
|
}
|
|
395
438
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: BaseTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
396
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: BaseTableComponent, isStandalone: true, selector: "tb-cd-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> </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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-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$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: SharedModule }, { kind: "component", type: i1.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: i2.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-cd-loading-overlay", inputs: ["state", "mode", "generating", "processingDeterminate", "processingIndeterminate", "fetching"] }, { kind: "ngmodule", type: CdkScrollableModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
439
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.21", type: BaseTableComponent, isStandalone: true, selector: "tb-cd-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 }, titleStyle: { classPropertyName: "titleStyle", publicName: "titleStyle", isSignal: true, isRequired: false, transformFunction: null }, columnHeaderStyle: { classPropertyName: "columnHeaderStyle", publicName: "columnHeaderStyle", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", 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\" [style]=\"tableColorStyle()\">\n <div class=\"tb-absolute-fill flex flex-1 flex-col\">\n <mat-toolbar\n class=\"mat-mdc-table-toolbar\"\n [class.!hidden]=\"toolbarMode() !== 'default'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\n <span\n class=\"tb-entity-table-title\"\n [ngStyle]=\"titleStyle()\"\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled() : false\"\n [matMenuTriggerFor]=\"headerDropdown\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #headerDropdown=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled() : false\"\n (click)=\"item.handler && item.handler()\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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\n class=\"mat-mdc-table-toolbar\"\n [class.!hidden]=\"toolbarMode() !== 'search'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\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> </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\n class=\"mat-mdc-table-toolbar mat-mdc-table-toolbar--bulk\"\n [class.!hidden]=\"toolbarMode() !== 'bulk'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [disabled]=\"action.disabled ? action.disabled(selection.selected) : false\"\n [matMenuTriggerFor]=\"bulkActionMenu\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #bulkActionMenu=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(selection.selected) : false\"\n (click)=\"item.handler(selection.selected)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-loading-overlay>\n }\n\n <table\n mat-table\n [dataSource]=\"dataSource()\"\n [style.color]=\"color() || null\"\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 [ngStyle]=\"columnHeaderStyle()\"\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n [matMenuTriggerFor]=\"rowSubMenu\"\n (click)=\"$event.stopPropagation()\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #rowSubMenu=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(entity) : false\"\n (click)=\"item.handler(entity)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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\" class=\"tb-cdu-actions-menu\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n @if (action.menuItems?.length) {\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(entity) : false\"\n (click)=\"item.handler(entity)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n } @else {\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 }\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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-loading-overlay>\n }\n </div>\n <mat-divider></mat-divider>\n <mat-paginator\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\"\n [selectConfig]=\"paginatorSelectConfig\"\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 ::ng-deep .mat-mdc-icon-button,:host ::ng-deep .mat-mdc-icon-button .mat-icon{color:var(--tb-cdu-fg-color)!important}:host ::ng-deep .mat-mdc-table .mat-mdc-cell{color:var(--tb-cdu-fg-color)!important}:host ::ng-deep mat-paginator{--mat-paginator-enabled-icon-color: var(--tb-cdu-fg-color);--mat-paginator-disabled-icon-color: var(--tb-cdu-fg-color);--mat-paginator-container-text-color: var(--tb-cdu-fg-color);--mat-paginator-container-background-color: var(--tb-cdu-bg-color)}:host ::ng-deep mat-paginator .mat-mdc-select-value,:host ::ng-deep mat-paginator .mat-mdc-select-arrow,:host ::ng-deep mat-paginator .mat-mdc-select-trigger,:host ::ng-deep mat-paginator .mat-mdc-paginator-range-label,:host ::ng-deep mat-paginator .mat-mdc-paginator-page-size-label{color:var(--tb-cdu-fg-color)!important}:host .tb-table-widget .table-container{position:relative;background-color:var(--tb-cdu-bg-color, transparent)}:host .tb-table-widget .mat-mdc-table-toolbar{padding:0 12px}:host .tb-table-widget .mat-mdc-table-toolbar .tb-entity-table-title{color:var(--tb-cdu-fg-color, rgb(144, 144, 144));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:var(--tb-cdu-bg-color, #e8f0fe)}:host .tb-table-widget .mat-mdc-table-toolbar--bulk .tb-entity-table-title{color:var(--tb-cdu-fg-color, rgba(0, 0, 0, .5411764706))}:host .tb-table-widget .mat-mdc-table{background-color:var(--tb-cdu-bg-color, inherit)}:host .tb-table-widget .mat-mdc-table .column-header{color:var(--tb-cdu-fg-color, rgba(0, 0, 0, .5411764706));font-size:14px}:host .tb-table-widget .mat-mdc-table .mat-mdc-header-cell{background-color:var(--tb-cdu-bg-color, #ffffff)}:host .tb-table-widget .mat-mdc-table .mat-mdc-row{background-color:var(--tb-cdu-bg-color, inherit)}: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:var(--tb-cdu-bg-color, #ffffff);z-index:2!important}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover{background-color:color-mix(in srgb,var(--tb-cdu-bg-color, white) 92%,var(--tb-cdu-fg-color, #000000) 8%)}: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:color-mix(in srgb,var(--tb-cdu-bg-color, white) 92%,var(--tb-cdu-fg-color, #000000) 8%)}: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$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SharedModule }, { kind: "component", type: i1.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: i2.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-cd-loading-overlay", inputs: ["state", "mode", "generating", "processingDeterminate", "processingIndeterminate", "fetching"] }, { kind: "ngmodule", type: CdkScrollableModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
397
440
|
}
|
|
398
441
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.21", ngImport: i0, type: BaseTableComponent, decorators: [{
|
|
399
442
|
type: Component,
|
|
400
|
-
args: [{ standalone: true, imports: [CommonModule, SharedModule, LoadingOverlayComponent, CdkScrollableModule, MatCheckboxModule], selector: 'tb-cd-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> </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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-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"] }]
|
|
401
|
-
}], 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 }] }] } });
|
|
443
|
+
args: [{ standalone: true, imports: [CommonModule, SharedModule, LoadingOverlayComponent, CdkScrollableModule, MatCheckboxModule], selector: 'tb-cd-base-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"tb-table-widget tb-absolute-fill\" [style]=\"tableColorStyle()\">\n <div class=\"tb-absolute-fill flex flex-1 flex-col\">\n <mat-toolbar\n class=\"mat-mdc-table-toolbar\"\n [class.!hidden]=\"toolbarMode() !== 'default'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\n <span\n class=\"tb-entity-table-title\"\n [ngStyle]=\"titleStyle()\"\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled() : false\"\n [matMenuTriggerFor]=\"headerDropdown\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #headerDropdown=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled() : false\"\n (click)=\"item.handler && item.handler()\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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\n class=\"mat-mdc-table-toolbar\"\n [class.!hidden]=\"toolbarMode() !== 'search'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\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> </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\n class=\"mat-mdc-table-toolbar mat-mdc-table-toolbar--bulk\"\n [class.!hidden]=\"toolbarMode() !== 'bulk'\"\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\">\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [disabled]=\"action.disabled ? action.disabled(selection.selected) : false\"\n [matMenuTriggerFor]=\"bulkActionMenu\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #bulkActionMenu=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(selection.selected) : false\"\n (click)=\"item.handler(selection.selected)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-loading-overlay>\n }\n\n <table\n mat-table\n [dataSource]=\"dataSource()\"\n [style.color]=\"color() || null\"\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 [ngStyle]=\"columnHeaderStyle()\"\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 @if (action.menuItems?.length) {\n <button\n mat-icon-button\n [attr.data-testid]=\"action.id\"\n [disabled]=\"action.disabled ? action.disabled(entity) : false\"\n [matMenuTriggerFor]=\"rowSubMenu\"\n (click)=\"$event.stopPropagation()\"\n [matTooltip]=\"action.label ? (action.label | translate) : null\"\n matTooltipPosition=\"above\">\n <mat-icon>{{ action.icon }}</mat-icon>\n </button>\n <mat-menu #rowSubMenu=\"matMenu\" xPosition=\"before\" class=\"tb-cdu-actions-menu\">\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(entity) : false\"\n (click)=\"item.handler(entity)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n </mat-menu>\n } @else {\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 }\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\" class=\"tb-cdu-actions-menu\">\n @for (action of rowActions(); track action.id) {\n @if (!action.visible || action.visible(entity)) {\n @if (action.menuItems?.length) {\n @for (item of action.menuItems!; track item.id) {\n <button\n mat-menu-item\n [disabled]=\"item.disabled ? item.disabled(entity) : false\"\n (click)=\"item.handler(entity)\">\n <mat-icon>{{ item.icon }}</mat-icon>\n <span>{{ item.label ? (item.label | translate) : '' }}</span>\n </button>\n }\n } @else {\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 }\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-cd-loading-overlay [state]=\"loadingState()\"></tb-cd-loading-overlay>\n }\n </div>\n <mat-divider></mat-divider>\n <mat-paginator\n [style.background-color]=\"backgroundColor() || null\"\n [style.color]=\"color() || null\"\n [selectConfig]=\"paginatorSelectConfig\"\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 ::ng-deep .mat-mdc-icon-button,:host ::ng-deep .mat-mdc-icon-button .mat-icon{color:var(--tb-cdu-fg-color)!important}:host ::ng-deep .mat-mdc-table .mat-mdc-cell{color:var(--tb-cdu-fg-color)!important}:host ::ng-deep mat-paginator{--mat-paginator-enabled-icon-color: var(--tb-cdu-fg-color);--mat-paginator-disabled-icon-color: var(--tb-cdu-fg-color);--mat-paginator-container-text-color: var(--tb-cdu-fg-color);--mat-paginator-container-background-color: var(--tb-cdu-bg-color)}:host ::ng-deep mat-paginator .mat-mdc-select-value,:host ::ng-deep mat-paginator .mat-mdc-select-arrow,:host ::ng-deep mat-paginator .mat-mdc-select-trigger,:host ::ng-deep mat-paginator .mat-mdc-paginator-range-label,:host ::ng-deep mat-paginator .mat-mdc-paginator-page-size-label{color:var(--tb-cdu-fg-color)!important}:host .tb-table-widget .table-container{position:relative;background-color:var(--tb-cdu-bg-color, transparent)}:host .tb-table-widget .mat-mdc-table-toolbar{padding:0 12px}:host .tb-table-widget .mat-mdc-table-toolbar .tb-entity-table-title{color:var(--tb-cdu-fg-color, rgb(144, 144, 144));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:var(--tb-cdu-bg-color, #e8f0fe)}:host .tb-table-widget .mat-mdc-table-toolbar--bulk .tb-entity-table-title{color:var(--tb-cdu-fg-color, rgba(0, 0, 0, .5411764706))}:host .tb-table-widget .mat-mdc-table{background-color:var(--tb-cdu-bg-color, inherit)}:host .tb-table-widget .mat-mdc-table .column-header{color:var(--tb-cdu-fg-color, rgba(0, 0, 0, .5411764706));font-size:14px}:host .tb-table-widget .mat-mdc-table .mat-mdc-header-cell{background-color:var(--tb-cdu-bg-color, #ffffff)}:host .tb-table-widget .mat-mdc-table .mat-mdc-row{background-color:var(--tb-cdu-bg-color, inherit)}: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:var(--tb-cdu-bg-color, #ffffff);z-index:2!important}:host .tb-table-widget .mat-mdc-table .mat-mdc-row:hover{background-color:color-mix(in srgb,var(--tb-cdu-bg-color, white) 92%,var(--tb-cdu-fg-color, #000000) 8%)}: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:color-mix(in srgb,var(--tb-cdu-bg-color, white) 92%,var(--tb-cdu-fg-color, #000000) 8%)}: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"] }]
|
|
444
|
+
}], 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 }] }], titleStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleStyle", required: false }] }], columnHeaderStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnHeaderStyle", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", 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 }] }] } });
|
|
402
445
|
|
|
403
446
|
class TbSubscriptionDatasource {
|
|
404
447
|
config;
|