@rxap/material-table-system 16.0.0-dev.3 → 16.0.0-dev.31

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +187 -0
  2. package/LICENSE +621 -0
  3. package/LICENSE.md +621 -0
  4. package/README.md +1 -1
  5. package/esm2022/index.mjs +79 -52
  6. package/esm2022/lib/cells/tree-control-cell/tree-control-cell.component.mjs +52 -0
  7. package/esm2022/lib/expand-row/expand-controls-cell/expand-controls-cell.component.mjs +5 -10
  8. package/esm2022/lib/expand-row/expand-row-container/expand-row-container.component.mjs +3 -8
  9. package/esm2022/lib/expand-row/expand-row.directive.mjs +3 -8
  10. package/esm2022/lib/select-row/checkbox-cell/checkbox-cell.component.mjs +3 -8
  11. package/esm2022/lib/select-row/select-row.module.mjs +31 -0
  12. package/esm2022/lib/select-row/select-row.service.mjs +2 -2
  13. package/esm2022/lib/table-column-menu/table-column-menu.component.mjs +25 -9
  14. package/esm2022/lib/table-column-menu/table-column-menu.module.mjs +31 -0
  15. package/esm2022/lib/table-column-menu/table-column-option/table-column-option.component.mjs +4 -8
  16. package/esm2022/lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component.mjs +35 -11
  17. package/esm2022/lib/table-create-button/table-create-button.directive.mjs +8 -11
  18. package/esm2022/lib/table-data-source.directive.mjs +25 -23
  19. package/esm2022/lib/table-filter/table-filter.module.mjs +25 -0
  20. package/esm2022/lib/table-header-button/decorators.mjs +15 -0
  21. package/esm2022/lib/table-header-button/table-header-button-action-status.mjs +8 -0
  22. package/esm2022/lib/table-header-button/table-header-button.directive.mjs +187 -0
  23. package/esm2022/lib/table-header-button/tokens.mjs +3 -0
  24. package/esm2022/lib/table-row-actions/abstract-table-row-action.mjs +251 -0
  25. package/esm2022/lib/table-row-actions/decorators.mjs +1 -1
  26. package/esm2022/lib/table-row-actions/table-row-action.directive.mjs +14 -227
  27. package/esm2022/lib/table-row-actions/table-row-actions.module.mjs +60 -0
  28. package/esm2022/lib/table-row-actions/table-row-header-action.directive.mjs +26 -20
  29. package/esm2022/lib/table-row-actions/types.mjs +1 -1
  30. package/esm2022/lib/table-row-metadata.mjs +8 -2
  31. package/fesm2022/rxap-material-table-system.mjs +1589 -1355
  32. package/fesm2022/rxap-material-table-system.mjs.map +1 -1
  33. package/index.d.ts +43 -34
  34. package/lib/cells/tree-control-cell/tree-control-cell.component.d.ts +16 -0
  35. package/lib/expand-row/expand-controls-cell/expand-controls-cell.component.d.ts +1 -1
  36. package/lib/expand-row/expand-row-container/expand-row-container.component.d.ts +1 -1
  37. package/lib/expand-row/expand-row.directive.d.ts +1 -1
  38. package/lib/select-row/checkbox-cell/checkbox-cell.component.d.ts +1 -1
  39. package/lib/select-row/select-row.module.d.ts +9 -0
  40. package/lib/select-row/select-row.service.d.ts +1 -1
  41. package/lib/table-column-menu/table-column-menu.component.d.ts +8 -1
  42. package/lib/table-column-menu/table-column-menu.module.d.ts +9 -0
  43. package/lib/table-column-menu/table-column-option/table-column-option.component.d.ts +1 -1
  44. package/lib/table-column-menu/table-show-archived-slide/table-show-archived-slide.component.d.ts +8 -4
  45. package/lib/table-create-button/table-create-button.directive.d.ts +4 -4
  46. package/lib/table-data-source.directive.d.ts +7 -10
  47. package/lib/table-filter/table-filter.module.d.ts +8 -0
  48. package/lib/table-header-button/decorators.d.ts +26 -0
  49. package/lib/table-header-button/table-header-button-action-status.d.ts +6 -0
  50. package/lib/table-header-button/table-header-button.directive.d.ts +55 -0
  51. package/lib/table-header-button/tokens.d.ts +3 -0
  52. package/lib/table-row-actions/abstract-table-row-action.d.ts +76 -0
  53. package/lib/table-row-actions/decorators.d.ts +8 -3
  54. package/lib/table-row-actions/table-row-action.directive.d.ts +5 -68
  55. package/lib/table-row-actions/table-row-actions.module.d.ts +16 -0
  56. package/lib/table-row-actions/table-row-header-action.directive.d.ts +10 -9
  57. package/lib/table-row-actions/types.d.ts +4 -4
  58. package/lib/table-row-metadata.d.ts +21 -0
  59. package/package.json +61 -58
  60. package/theme.css +1 -0
  61. package/esm2022/lib/table-row-controls/row-controls-cell/row-controls-cell.component.mjs +0 -119
  62. package/esm2022/lib/table-row-controls/row-controls-header-cell/row-controls-header-cell.component.mjs +0 -114
  63. package/esm2022/lib/table-row-controls/tokens.mjs +0 -9
  64. package/lib/table-row-controls/row-controls-cell/row-controls-cell.component.d.ts +0 -47
  65. package/lib/table-row-controls/row-controls-header-cell/row-controls-header-cell.component.d.ts +0 -31
  66. package/lib/table-row-controls/tokens.d.ts +0 -16
@@ -1,236 +1,52 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Directive, Inject, HostListener, Input, NgModule, TemplateRef, ViewContainerRef, Component, ChangeDetectionStrategy, ContentChild, InjectionToken, Optional, ChangeDetectorRef, forwardRef, Pipe, ElementRef, ContentChildren, HostBinding, Renderer2, isDevMode } from '@angular/core';
3
- import { BehaviorSubject, Subject, EMPTY, ReplaySubject, Subscription, isObservable, of } from 'rxjs';
4
- import { map, filter, tap, distinctUntilChanged, debounceTime, delay, startWith } from 'rxjs/operators';
5
- import { __decorate, __metadata } from 'tslib';
6
- import { Required, clone, DeleteEmptyProperties, equals, coerceBoolean, coerceArray } from '@rxap/utilities';
7
- import * as i1 from '@angular/cdk/portal';
8
- import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
9
- import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
10
- import { AsyncPipe, NgIf, NgFor, NgClass, DatePipe, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
11
- import * as i5 from '@angular/material/icon';
12
- import { MatIconModule } from '@angular/material/icon';
13
- import * as i3 from '@angular/material/button';
14
- import { MatButtonModule, MatButton } from '@angular/material/button';
15
- import * as i1$1 from '@angular/material/checkbox';
16
- import { MatCheckboxModule } from '@angular/material/checkbox';
17
- import * as i3$1 from '@angular/cdk/table';
2
+ import { InjectionToken, Injectable, Optional, Inject, Component, ChangeDetectionStrategy, Directive, Input, isDevMode, Renderer2, ElementRef, ChangeDetectorRef, ViewContainerRef, INJECTOR, ContentChild, HostListener, Pipe, NgModule, forwardRef, ContentChildren, HostBinding, TemplateRef } from '@angular/core';
3
+ import { RXAP_WINDOW_REF } from '@rxap/window-system';
4
+ import { map, tap, filter, debounceTime, delay, startWith, distinctUntilChanged } from 'rxjs/operators';
5
+ import { Subject, ReplaySubject, Subscription, isObservable, EMPTY, BehaviorSubject } from 'rxjs';
6
+ import { AsyncPipe, CommonModule, NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault, NgClass, DatePipe } from '@angular/common';
7
+ import * as i4 from '@angular/material/button';
8
+ import { MatButtonModule, MatIconButton, MatButton, MatMiniFabButton } from '@angular/material/button';
9
+ import * as i2 from '@angular/flex-layout/flex';
10
+ import { FlexModule } from '@angular/flex-layout/flex';
11
+ import * as i1$1 from '@angular/cdk/overlay';
12
+ import { Overlay } from '@angular/cdk/overlay';
13
+ import * as i3$1 from '@angular/material/snack-bar';
14
+ import { MatSnackBar } from '@angular/material/snack-bar';
15
+ import * as i5 from '@angular/material/tooltip';
16
+ import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
17
+ import { ConfirmDirective, ConfirmModule, CopyToClipboardComponent } from '@rxap/components';
18
+ import { clone, DeleteEmptyProperties, equals, coerceArray, coerceBoolean, dasherize } from '@rxap/utilities';
19
+ import * as i1 from '@angular/cdk/table';
18
20
  import { CdkTable } from '@angular/cdk/table';
19
- import * as i2 from '@angular/material/sort';
21
+ import * as i3 from '@angular/material/sort';
20
22
  import { MatSort } from '@angular/material/sort';
23
+ import { pipeDataSource } from '@rxap/data-source';
24
+ import * as i2$1 from '@rxap/data-source/table';
21
25
  import { RXAP_TABLE_METHOD, DynamicTableDataSource } from '@rxap/data-source/table';
22
26
  export { RXAP_TABLE_METHOD } from '@rxap/data-source/table';
23
27
  import { ToggleSubject } from '@rxap/rxjs';
24
- import { pipeDataSource } from '@rxap/data-source';
25
- import * as i1$2 from '@angular/material/paginator';
28
+ import { setMetadata, getMetadata, hasMetadata } from '@rxap/reflect-metadata';
29
+ import * as i3$2 from '@angular/material/icon';
30
+ import { MatIconModule } from '@angular/material/icon';
31
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
26
32
  import { FormDirective } from '@rxap/forms';
27
33
  import { ControlContainer } from '@angular/forms';
28
- import * as i1$3 from '@angular/router';
29
- import * as i4 from '@angular/flex-layout/extended';
30
- import { ExtendedModule } from '@angular/flex-layout/extended';
34
+ import * as i1$5 from '@angular/material/paginator';
35
+ import * as i1$3 from '@angular/material/slide-toggle';
36
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
31
37
  import { StopPropagationDirective, BackgroundSizeOptions, BackgroundRepeatOptions, BackgroundPositionOptions, BackgroundImageDirective } from '@rxap/directives';
32
- import * as i2$1 from '@angular/material/menu';
38
+ import * as i4$1 from '@angular/flex-layout/extended';
39
+ import { ExtendedModule } from '@angular/flex-layout/extended';
40
+ import * as i5$1 from '@angular/material/checkbox';
41
+ import { MatCheckboxModule } from '@angular/material/checkbox';
42
+ import * as i2$2 from '@angular/material/menu';
33
43
  import { MatMenuModule } from '@angular/material/menu';
34
- import * as i3$2 from '@angular/material/slide-toggle';
35
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
36
- import { ConfirmDirective, CopyToClipboardComponent } from '@rxap/components';
37
- import * as i4$1 from '@angular/material/tooltip';
38
- import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
39
- import * as i2$2 from '@angular/flex-layout/flex';
40
- import { FlexModule } from '@angular/flex-layout/flex';
41
- import { RXAP_WINDOW_REF } from '@rxap/window-system';
44
+ import * as i1$2 from '@angular/router';
45
+ import * as i1$4 from '@angular/cdk/portal';
46
+ import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
47
+ import { trigger, state, style, transition, animate, sequence } from '@angular/animations';
42
48
  import { IconDirective } from '@rxap/material-directives/icon';
43
49
  import { MatOption } from '@angular/material/core';
44
- import { setMetadata, getMetadata, hasMetadata } from '@rxap/reflect-metadata';
45
- import * as i3$3 from '@angular/material/snack-bar';
46
- import { MatSnackBar } from '@angular/material/snack-bar';
47
- import * as i1$4 from '@angular/cdk/overlay';
48
- import { Overlay } from '@angular/cdk/overlay';
49
-
50
- class ExpandRowService {
51
- constructor() {
52
- this.expandedRow = new BehaviorSubject(null);
53
- }
54
- toggleRow(row) {
55
- if (this.expandedRow.value === row) {
56
- this.expandedRow.next(null);
57
- }
58
- else {
59
- this.expandedRow.next(row);
60
- }
61
- }
62
- isExpanded(row) {
63
- return this.expandedRow.value === row;
64
- }
65
- isExpanded$(row) {
66
- return this.expandedRow.pipe(map((expandedRow) => expandedRow === row));
67
- }
68
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
69
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService }); }
70
- }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService, decorators: [{
72
- type: Injectable
73
- }] });
74
-
75
- class ExpandRowDirective {
76
- get isExpanded() {
77
- return this.expandCell.isExpanded(this.element);
78
- }
79
- constructor(expandCell) {
80
- this.expandCell = expandCell;
81
- }
82
- onClick() {
83
- this.expandCell.toggleRow(this.element);
84
- }
85
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowDirective, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
86
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowDirective, isStandalone: true, selector: "tr[rxapExpandRow]", inputs: { element: "element" }, host: { listeners: { "expanded-row": "isExpanded()", "click": "onClick()" } }, ngImport: i0 }); }
87
- }
88
- __decorate([
89
- Required,
90
- __metadata("design:type", Object)
91
- ], ExpandRowDirective.prototype, "element", void 0);
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowDirective, decorators: [{
93
- type: Directive,
94
- args: [{
95
- selector: 'tr[rxapExpandRow]',
96
- standalone: true,
97
- }]
98
- }], ctorParameters: function () { return [{ type: ExpandRowService, decorators: [{
99
- type: Inject,
100
- args: [ExpandRowService]
101
- }] }]; }, propDecorators: { isExpanded: [{
102
- type: HostListener,
103
- args: ['expanded-row']
104
- }], element: [{
105
- type: Input
106
- }], onClick: [{
107
- type: HostListener,
108
- args: ['click']
109
- }] } });
110
-
111
- class ExpandRowModule {
112
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
113
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, imports: [ExpandRowDirective], exports: [ExpandRowDirective] }); }
114
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, providers: [
115
- ExpandRowService,
116
- ] }); }
117
- }
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, decorators: [{
119
- type: NgModule,
120
- args: [{
121
- imports: [ExpandRowDirective],
122
- exports: [
123
- ExpandRowDirective,
124
- ],
125
- providers: [
126
- ExpandRowService,
127
- ],
128
- }]
129
- }] });
130
-
131
- class ExpandRowContentDirective {
132
- static ngTemplateContextGuard(dir, ctx) {
133
- return true;
134
- }
135
- constructor(template) {
136
- this.template = template;
137
- }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContentDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
139
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowContentDirective, isStandalone: true, selector: "[rxapExpandRowContent]", ngImport: i0 }); }
140
- }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContentDirective, decorators: [{
142
- type: Directive,
143
- args: [{
144
- selector: '[rxapExpandRowContent]',
145
- standalone: true,
146
- }]
147
- }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
148
- type: Inject,
149
- args: [TemplateRef]
150
- }] }]; } });
151
-
152
- class ExpandRowContainerComponent {
153
- constructor(viewContainerRef, expandCell) {
154
- this.viewContainerRef = viewContainerRef;
155
- this.expandCell = expandCell;
156
- this.portal = null;
157
- }
158
- ngOnDestroy() {
159
- this._subscription?.unsubscribe();
160
- }
161
- ngAfterContentInit() {
162
- if (this.expandCellContent) {
163
- this._subscription = this.expandCell.isExpanded$(this.element).pipe(filter(Boolean), tap(() => {
164
- if (!this.portal) {
165
- this.portal =
166
- new TemplatePortal(this.expandCellContent.template, this.viewContainerRef, { $implicit: this.element });
167
- }
168
- })).subscribe();
169
- }
170
- }
171
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContainerComponent, deps: [{ token: ViewContainerRef }, { token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
172
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowContainerComponent, isStandalone: true, selector: "td[rxap-expand-row]", inputs: { element: "element" }, queries: [{ propertyName: "expandCellContent", first: true, predicate: ExpandRowContentDirective, descendants: true }], ngImport: i0, template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], animations: [
173
- trigger('detailExpand', [
174
- state('collapsed', style({
175
- height: '0px',
176
- minHeight: '0',
177
- })),
178
- state('expanded', style({ height: '*' })),
179
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
180
- ]),
181
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
182
- }
183
- __decorate([
184
- Required,
185
- __metadata("design:type", Object)
186
- ], ExpandRowContainerComponent.prototype, "element", void 0);
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContainerComponent, decorators: [{
188
- type: Component,
189
- args: [{ selector: 'td[rxap-expand-row]', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
190
- trigger('detailExpand', [
191
- state('collapsed', style({
192
- height: '0px',
193
- minHeight: '0',
194
- })),
195
- state('expanded', style({ height: '*' })),
196
- transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
197
- ]),
198
- ], standalone: true, imports: [PortalModule, AsyncPipe], template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"] }]
199
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef, decorators: [{
200
- type: Inject,
201
- args: [ViewContainerRef]
202
- }] }, { type: ExpandRowService, decorators: [{
203
- type: Inject,
204
- args: [ExpandRowService]
205
- }] }]; }, propDecorators: { element: [{
206
- type: Input
207
- }], expandCellContent: [{
208
- type: ContentChild,
209
- args: [ExpandRowContentDirective]
210
- }] } });
211
-
212
- class ExpandControlsCellComponent {
213
- constructor(expandCell) {
214
- this.expandCell = expandCell;
215
- }
216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandControlsCellComponent, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ExpandControlsCellComponent, isStandalone: true, selector: "td[rxap-expand-controls-cell]", inputs: { element: "element" }, ngImport: i0, template: "<button mat-icon-button>\n <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n <ng-template #notExpanded>\n <mat-icon>keyboard_arrow_right</mat-icon>\n </ng-template>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
218
- }
219
- __decorate([
220
- Required,
221
- __metadata("design:type", Object)
222
- ], ExpandControlsCellComponent.prototype, "element", void 0);
223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandControlsCellComponent, decorators: [{
224
- type: Component,
225
- args: [{ selector: 'td[rxap-expand-controls-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButtonModule, NgIf, MatIconModule, AsyncPipe], template: "<button mat-icon-button>\n <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n <ng-template #notExpanded>\n <mat-icon>keyboard_arrow_right</mat-icon>\n </ng-template>\n</button>\n" }]
226
- }], ctorParameters: function () { return [{ type: ExpandRowService, decorators: [{
227
- type: Inject,
228
- args: [ExpandRowService]
229
- }] }]; }, propDecorators: { element: [{
230
- type: Input
231
- }] } });
232
-
233
- const RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS = new InjectionToken('rxap-material/table-system/select-row/options');
234
50
 
235
51
  /**
236
52
  * @license
@@ -449,6 +265,8 @@ function getMultipleValuesInSingleSelectionError() {
449
265
  return Error('Cannot pass multiple values into SelectionModel with single-value mode.');
450
266
  }
451
267
 
268
+ const RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS = new InjectionToken('rxap-material/table-system/select-row/options');
269
+
452
270
  class SelectRowService {
453
271
  get selectedRows() {
454
272
  return this.selectionModel.selected;
@@ -470,140 +288,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
470
288
  args: [RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS]
471
289
  }] }]; } });
472
290
 
473
- class CheckboxCellComponent {
474
- constructor(selectRow) {
475
- this.selectRow = selectRow;
476
- }
477
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxCellComponent, deps: [{ token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
478
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CheckboxCellComponent, isStandalone: true, selector: "td[rxap-checkbox-cell]", inputs: { element: "element" }, ngImport: i0, template: "<mat-checkbox\n (change)=\"selectRow.selectionModel.toggle(element)\"\n [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
479
- }
480
- __decorate([
481
- Required,
482
- __metadata("design:type", Object)
483
- ], CheckboxCellComponent.prototype, "element", void 0);
484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxCellComponent, decorators: [{
485
- type: Component,
486
- args: [{ selector: 'td[rxap-checkbox-cell]', changeDetection: ChangeDetectionStrategy.Default, standalone: true, imports: [MatCheckboxModule], template: "<mat-checkbox\n (change)=\"selectRow.selectionModel.toggle(element)\"\n [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n" }]
487
- }], ctorParameters: function () { return [{ type: SelectRowService, decorators: [{
488
- type: Inject,
489
- args: [SelectRowService]
490
- }] }]; }, propDecorators: { element: [{
491
- type: Input
492
- }] } });
493
-
494
- class CheckboxHeaderCellComponent {
495
- constructor(cdkTable, selectRow) {
496
- this.cdkTable = cdkTable;
497
- this.selectRow = selectRow;
498
- this.indeterminate$ = EMPTY;
499
- this.checked$ = EMPTY;
500
- this.isMultipleSelection = false;
501
- this.isMultipleSelection =
502
- this.selectRow.selectionModel.isMultipleSelection();
291
+ class TableSelectControlsComponent {
292
+ constructor(selectRows, windowRef) {
293
+ this.selectRows = selectRows;
294
+ this.windowRef = windowRef;
295
+ this.hasNotSelected$ = this.selectRows.selectedRows$.pipe(map((selected) => selected.length === 0));
503
296
  }
504
- ngOnInit() {
505
- this.indeterminate$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
506
- this.cdkTable['_data'].length !== selectedRows.length));
507
- this.checked$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
508
- this.cdkTable['_data'].length === selectedRows.length));
297
+ cancel() {
298
+ this.windowRef.close();
509
299
  }
510
- onChange($event) {
511
- if ($event.checked) {
512
- this.selectRow.selectionModel.select(...this.cdkTable['_data']);
513
- }
514
- else {
515
- this.selectRow.selectionModel.clear();
516
- }
300
+ select() {
301
+ this.windowRef.close(this.selectRows.selectedRows);
517
302
  }
518
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxHeaderCellComponent, deps: [{ token: CdkTable }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
519
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CheckboxHeaderCellComponent, isStandalone: true, selector: "th[rxap-checkbox-header-cell]", ngImport: i0, template: "<mat-checkbox\n (change)=\"onChange($event)\"\n *ngIf=\"isMultipleSelection\"\n [checked]=\"(checked$ | async) ?? false\"\n [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableSelectControlsComponent, deps: [{ token: SelectRowService }, { token: RXAP_WINDOW_REF }], target: i0.ɵɵFactoryTarget.Component }); }
304
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableSelectControlsComponent, isStandalone: true, selector: "rxap-table-select-controls", ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button (click)=\"cancel()\" fxFlex=\"nogrow\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" fxFlex=\"nogrow\" mat-raised-button type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
520
305
  }
521
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxHeaderCellComponent, decorators: [{
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableSelectControlsComponent, decorators: [{
522
307
  type: Component,
523
- args: [{ selector: 'th[rxap-checkbox-header-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
524
- NgIf,
525
- MatCheckboxModule,
308
+ args: [{ selector: 'rxap-table-select-controls', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
309
+ FlexModule,
310
+ MatButtonModule,
526
311
  AsyncPipe,
527
- ], template: "<mat-checkbox\n (change)=\"onChange($event)\"\n *ngIf=\"isMultipleSelection\"\n [checked]=\"(checked$ | async) ?? false\"\n [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n" }]
528
- }], ctorParameters: function () { return [{ type: i3$1.CdkTable, decorators: [{
312
+ ], template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button (click)=\"cancel()\" fxFlex=\"nogrow\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" fxFlex=\"nogrow\" mat-raised-button type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n" }]
313
+ }], ctorParameters: function () { return [{ type: SelectRowService }, { type: undefined, decorators: [{
529
314
  type: Inject,
530
- args: [CdkTable]
531
- }] }, { type: SelectRowService }]; } });
532
-
533
- class SelectedRowsDirective {
534
- constructor(template, viewContainerRef, cdr, selectRowService) {
535
- this.template = template;
536
- this.viewContainerRef = viewContainerRef;
537
- this.cdr = cdr;
538
- this.selectRowService = selectRowService;
539
- }
540
- ngOnDestroy() {
541
- this._subscription?.unsubscribe();
542
- }
543
- ngOnInit() {
544
- this._subscription = this.selectRowService.selectedRows$.pipe(distinctUntilChanged(), tap(selectedAllRows => {
545
- this.viewContainerRef.clear();
546
- if (selectedAllRows) {
547
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: this.selectRowService.selectedRows });
548
- }
549
- this.cdr.detectChanges();
550
- })).subscribe();
551
- }
552
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectedRowsDirective, deps: [{ token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
553
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: SelectedRowsDirective, isStandalone: true, selector: "[rxapSelectedRows]", ngImport: i0 }); }
554
- }
555
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectedRowsDirective, decorators: [{
556
- type: Directive,
557
- args: [{
558
- selector: '[rxapSelectedRows]',
559
- standalone: true,
560
- }]
561
- }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
562
- type: Inject,
563
- args: [TemplateRef]
564
- }] }, { type: i0.ViewContainerRef, decorators: [{
565
- type: Inject,
566
- args: [ViewContainerRef]
567
- }] }, { type: i0.ChangeDetectorRef, decorators: [{
568
- type: Inject,
569
- args: [ChangeDetectorRef]
570
- }] }, { type: SelectRowService, decorators: [{
571
- type: Inject,
572
- args: [SelectRowService]
315
+ args: [RXAP_WINDOW_REF]
573
316
  }] }]; } });
574
317
 
575
- const offset = '50';
576
- const RowAnimation = trigger('rowsAnimation', [
577
- transition('void => *', [
578
- style({
579
- height: '*',
580
- opacity: '0',
581
- transform: 'translateY(' + (-offset).toString() + 'px)',
582
- 'box-shadow': 'none',
583
- }),
584
- sequence([
585
- animate('.2s ease', style({
586
- height: '*',
587
- opacity: '.2',
588
- transform: 'translateX(0)',
589
- 'box-shadow': 'none',
590
- })),
591
- animate('.35s ease', style({
592
- height: '*',
593
- opacity: 1,
594
- transform: 'translateX(0)',
595
- })),
596
- ]),
597
- ]),
598
- transition('* => void', [
599
- style({
600
- height: '0',
601
- opacity: '0',
602
- 'box-shadow': 'none',
603
- }),
604
- ]),
605
- ]);
606
-
607
318
  class TableFilterService {
608
319
  constructor() {
609
320
  this.change = new ReplaySubject(1);
@@ -714,7 +425,7 @@ class TableDataSourceDirective {
714
425
  this.dataSource = new DynamicTableDataSource(this.method, this.paginator, this.matSort, tableFilter, this.parameters, this.method.metadata ?? { id: this.id });
715
426
  }
716
427
  if (!this.dataSource) {
717
- throw new Error('The TABLE_DATA_SOURCE and TABLE_METHOD token are not defined!');
428
+ throw new Error('The TABLE_DATA_SOURCE and RXAP_TABLE_METHOD token are not defined!');
718
429
  }
719
430
  }
720
431
  this.dataSource.paginator = this.paginator;
@@ -736,9 +447,15 @@ class TableDataSourceDirective {
736
447
  // on connect the data source can then use the correct paginator/matSort/tableFilter/parameters instance
737
448
  // to create the TableEvent objects
738
449
  Reflect.set(this.matTable, 'id', this.id);
739
- this.matTable.dataSource = pipeDataSource(this.dataSource, tap(rowList => rowList.forEach((element) => {
740
- element.__metadata__ = { loading$: new ToggleSubject() };
741
- })));
450
+ this.matTable.dataSource = pipeDataSource(this.dataSource, tap(rowList => {
451
+ if (rowList.some((element) => !element.__metadata__)) {
452
+ console.debug('Ensure to use the NormalizeTableRow function to normalize the table row!');
453
+ rowList.forEach((element) => {
454
+ element.__metadata__ ??= { loading$: new ToggleSubject() };
455
+ element.__metadata__.loading$ ??= new ToggleSubject();
456
+ });
457
+ }
458
+ }));
742
459
  // TODO : remove hack to trigger change detection after data source refresh (machine-definition -> physical unit)
743
460
  this._subscription.add(this.loading$
744
461
  .pipe(filter((loading) => !loading), debounceTime(2000), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500), tap(() => this.cdr.detectChanges()), tap(() => this.cdr.markForCheck()), delay(500))
@@ -756,10 +473,6 @@ class TableDataSourceDirective {
756
473
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableDataSourceDirective, deps: [{ token: CdkTable }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_METHOD, optional: true }, { token: TABLE_DATA_SOURCE, optional: true }, { token: TABLE_REMOTE_METHOD_ADAPTER_FACTORY, optional: true }, { token: MatSort, optional: true }, { token: TableFilterService, optional: true }, { token: RXAP_TABLE_FILTER, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
757
474
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableDataSourceDirective, isStandalone: true, selector: "table[mat-table][rxapTableDataSource],mat-table[rxapTableDataSource]", inputs: { setDataSource: ["rxapTableDataSource", "setDataSource"], paginator: "paginator", id: "id", parameters: "parameters", dataSource: "dataSource" }, exportAs: ["rxapTableDataSource"], ngImport: i0 }); }
758
475
  }
759
- __decorate([
760
- Required,
761
- __metadata("design:type", String)
762
- ], TableDataSourceDirective.prototype, "id", void 0);
763
476
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableDataSourceDirective, decorators: [{
764
477
  type: Directive,
765
478
  args: [{
@@ -767,7 +480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
767
480
  exportAs: 'rxapTableDataSource',
768
481
  standalone: true,
769
482
  }]
770
- }], ctorParameters: function () { return [{ type: i3$1.CdkTable, decorators: [{
483
+ }], ctorParameters: function () { return [{ type: i1.CdkTable, decorators: [{
771
484
  type: Inject,
772
485
  args: [CdkTable]
773
486
  }] }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
@@ -775,7 +488,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
775
488
  }, {
776
489
  type: Inject,
777
490
  args: [RXAP_TABLE_METHOD]
778
- }] }, { type: undefined, decorators: [{
491
+ }] }, { type: i2$1.AbstractTableDataSource, decorators: [{
779
492
  type: Optional
780
493
  }, {
781
494
  type: Inject,
@@ -785,7 +498,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
785
498
  }, {
786
499
  type: Inject,
787
500
  args: [TABLE_REMOTE_METHOD_ADAPTER_FACTORY]
788
- }] }, { type: i2.MatSort, decorators: [{
501
+ }] }, { type: i3.MatSort, decorators: [{
789
502
  type: Optional
790
503
  }, {
791
504
  type: Inject,
@@ -806,1182 +519,1703 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImpor
806
519
  }], paginator: [{
807
520
  type: Input
808
521
  }], id: [{
809
- type: Input
522
+ type: Input,
523
+ args: [{ required: true }]
810
524
  }], parameters: [{
811
525
  type: Input
812
526
  }], dataSource: [{
813
527
  type: Input
814
528
  }] } });
815
529
 
816
- class PersistentPaginatorDirective {
817
- constructor(matPaginator) {
818
- this.matPaginator = matPaginator;
819
- }
820
- ngOnInit() {
821
- const config = this.restoreConfig();
822
- if (config) {
823
- this.matPaginator.pageSize = config.pageSize;
824
- }
825
- this._subscription = this.matPaginator.page.pipe(tap(() => this.storeConfig())).subscribe();
826
- }
827
- ngOnDestroy() {
828
- this._subscription?.unsubscribe();
829
- }
830
- getKey() {
831
- return 'rxap_mat-paginator-persistent' + this.id;
530
+ class TableRowActionExecutingDirective {
531
+ constructor(templateRef, vcr) {
532
+ this.templateRef = templateRef;
533
+ this.vcr = vcr;
832
534
  }
833
- storeConfig() {
834
- const pageSize = this.matPaginator.pageSize;
835
- localStorage.setItem(this.getKey(), JSON.stringify({ pageSize }));
535
+ show() {
536
+ this.vcr.createEmbeddedView(this.templateRef);
836
537
  }
837
- restoreConfig() {
838
- const configStorage = localStorage.getItem(this.getKey());
839
- if (configStorage) {
840
- try {
841
- return JSON.parse(configStorage);
842
- }
843
- catch (e) {
844
- console.warn(`Could not parse mat paginator persistent config: ${e.message}`);
845
- }
846
- }
847
- return null;
538
+ hide() {
539
+ this.vcr.clear();
848
540
  }
849
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PersistentPaginatorDirective, deps: [{ token: i1$2.MatPaginator }], target: i0.ɵɵFactoryTarget.Directive }); }
850
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: PersistentPaginatorDirective, isStandalone: true, selector: "mat-paginator[rxapPersistent]", inputs: { id: "id" }, ngImport: i0 }); }
541
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionExecutingDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
542
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowActionExecutingDirective, isStandalone: true, selector: "[rxapTableRowActionExecuting]", ngImport: i0 }); }
851
543
  }
852
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PersistentPaginatorDirective, decorators: [{
544
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionExecutingDirective, decorators: [{
853
545
  type: Directive,
854
546
  args: [{
855
- selector: 'mat-paginator[rxapPersistent]',
547
+ selector: '[rxapTableRowActionExecuting]',
856
548
  standalone: true,
857
549
  }]
858
- }], ctorParameters: function () { return [{ type: i1$2.MatPaginator }]; }, propDecorators: { id: [{
859
- type: Input
860
- }] } });
550
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
861
551
 
862
- const RXAP_TABLE_FILTER_FORM_DEFINITION = new InjectionToken('rxap/form-table-system/filter-form-definition');
552
+ var TableRowActionStatus;
553
+ (function (TableRowActionStatus) {
554
+ TableRowActionStatus["EXECUTING"] = "executing";
555
+ TableRowActionStatus["DONE"] = "done";
556
+ TableRowActionStatus["ERROR"] = "error";
557
+ TableRowActionStatus["SUCCESS"] = "success";
558
+ })(TableRowActionStatus || (TableRowActionStatus = {}));
863
559
 
864
- class FilterHeaderRowDirective extends FormDirective {
865
- set useFormDefinition(value) {
866
- if (value) {
867
- this._formDefinition = value;
868
- this.form = value.rxapFormGroup;
869
- }
870
- }
871
- constructor(tableFilter, cdr, formDefinition) {
872
- super(cdr, formDefinition);
873
- this.tableFilter = tableFilter;
874
- }
875
- ngOnInit() {
876
- super.ngOnInit();
877
- this._subscription = this.form.value$
878
- .pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
879
- .subscribe();
560
+ /**
561
+ * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
562
+ */
563
+ const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = 'rxap-table-action-method-type-metadata';
564
+ const RXAP_TABLE_ACTION_METHOD_METADATA = 'rxap-table-action-method-metadata';
565
+ /**
566
+ * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
567
+ */
568
+ const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = 'rxap-table-action-method-check-function-metadata';
569
+ function TableActionMethod(typeOrOptions, checkFunction) {
570
+ let type;
571
+ let options;
572
+ if (typeof typeOrOptions === 'string') {
573
+ type = typeOrOptions;
574
+ options = {
575
+ type,
576
+ checkFunction,
577
+ };
880
578
  }
881
- ngOnDestroy() {
882
- super.ngOnDestroy();
883
- this._subscription?.unsubscribe();
579
+ else {
580
+ options = typeOrOptions;
581
+ type = options.type;
582
+ checkFunction = options.checkFunction;
884
583
  }
885
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FilterHeaderRowDirective, deps: [{ token: TableFilterService }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_FILTER_FORM_DEFINITION, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
886
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: FilterHeaderRowDirective, isStandalone: true, selector: "table[rxap-filter-header-row]", inputs: { useFormDefinition: ["rxap-filter-header-row", "useFormDefinition"] }, providers: [
887
- {
888
- provide: ControlContainer,
889
- // ignore coverage
890
- useExisting: forwardRef(() => FilterHeaderRowDirective),
891
- },
892
- ], usesInheritance: true, ngImport: i0 }); }
584
+ return function (target) {
585
+ setMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, options, target);
586
+ if (type) {
587
+ setMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, type, target);
588
+ }
589
+ if (checkFunction) {
590
+ setMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, checkFunction, target);
591
+ }
592
+ };
893
593
  }
894
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FilterHeaderRowDirective, decorators: [{
895
- type: Directive,
896
- args: [{
897
- // eslint-disable-next-line @angular-eslint/directive-selector
898
- selector: 'table[rxap-filter-header-row]',
899
- providers: [
900
- {
901
- provide: ControlContainer,
902
- // ignore coverage
903
- useExisting: forwardRef(() => FilterHeaderRowDirective),
904
- },
905
- ],
906
- standalone: true,
907
- }]
908
- }], ctorParameters: function () { return [{ type: TableFilterService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
909
- type: Optional
910
- }, {
911
- type: Inject,
912
- args: [RXAP_TABLE_FILTER_FORM_DEFINITION]
913
- }] }]; }, propDecorators: { useFormDefinition: [{
914
- type: Input,
915
- args: ['rxap-filter-header-row']
916
- }] } });
917
594
 
918
- class ToFilterColumnNamesPipe {
919
- transform(columns) {
920
- return columns.map(column => 'filter_' + column);
595
+ function IsTableRowActionTypeSwitchMethod(method) {
596
+ return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === undefined;
597
+ }
598
+ function IsTableRowActionTypeMethod(type) {
599
+ return (method) => {
600
+ return (getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === type);
601
+ };
602
+ }
603
+ function HasTableRowActionCheckFunction(method) {
604
+ return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction !== undefined;
605
+ }
606
+ function GetTableRowActionCheckFunction(method) {
607
+ const checkFunction = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction;
608
+ if (!checkFunction) {
609
+ throw new Error(`Extracted check function from '${method.constructor.name}' is empty`);
921
610
  }
922
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
923
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, isStandalone: true, name: "toFilterColumnNames" }); }
611
+ return checkFunction;
612
+ }
613
+ function HasTableRowActionMetadata(method) {
614
+ return hasMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
615
+ }
616
+ function GetTableRowActionMetadata(method) {
617
+ const metadata = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
618
+ if (!metadata) {
619
+ throw new Error(`Extracted metadata from '${method.constructor.name}' is empty`);
620
+ }
621
+ return metadata;
924
622
  }
925
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, decorators: [{
926
- type: Pipe,
927
- args: [{
928
- name: 'toFilterColumnNames',
929
- standalone: true,
930
- }]
931
- }] });
932
623
 
933
- class TableColumnOptionComponent {
934
- /**
935
- * The displayed value of the option. It is necessary to show the selected option in the
936
- * select's trigger.
937
- */
938
- get display() {
939
- return (this._element.nativeElement.textContent || '').trim();
940
- }
941
- set inactive(value) {
942
- this.active = !coerceBoolean(value);
943
- }
944
- set hidden(value) {
945
- this._hidden = coerceBoolean(value);
624
+ const RXAP_TABLE_ROW_ACTION_METHOD = new InjectionToken('rxap-table-row-action-method');
625
+
626
+ class AbstractTableRowAction extends ConfirmDirective {
627
+ constructor(renderer, overlay, elementRef, actionMethodList, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector) {
628
+ super(overlay, elementRef);
629
+ this.renderer = renderer;
630
+ this.cdr = cdr;
631
+ this.vcr = vcr;
632
+ this.tableDataSourceDirective = tableDataSourceDirective;
633
+ this.snackBar = snackBar;
634
+ this.matButton = matButton;
635
+ this.matTooltip = matTooltip;
636
+ this.injector = injector;
637
+ this.isHeader = false;
638
+ this.options = null;
639
+ this._currentStatus = TableRowActionStatus.DONE;
640
+ this._actionDisabled = false;
641
+ this._hasConfirmDirective = false;
642
+ this.actionMethodList = coerceArray(actionMethodList);
946
643
  }
947
- get hidden() {
948
- return this._hidden;
644
+ // eslint-disable-next-line @angular-eslint/no-input-rename
645
+ set hasConfirmDirective(value) {
646
+ this._hasConfirmDirective = coerceBoolean(value);
949
647
  }
950
- set show(value) {
951
- this._hidden = !value;
648
+ // eslint-disable-next-line @angular-eslint/contextual-lifecycle
649
+ ngOnInit() {
650
+ this.options = this.getTableActionOptions();
651
+ if (this.options) {
652
+ this.refresh ??= this.options.refresh ?? false;
653
+ this.errorMessage ??= this.options.errorMessage ?? undefined;
654
+ this.successMessage ??= this.options.successMessage ?? undefined;
655
+ if (this.matTooltip && this.options.tooltip) {
656
+ this.matTooltip.message = this.options.tooltip;
657
+ }
658
+ this.color ??= this.options.color ?? undefined;
659
+ }
660
+ if (this.matButton) {
661
+ if (this.color) {
662
+ this.matButton.color = this.color;
663
+ }
664
+ }
665
+ if (this.isHeader) {
666
+ this.renderer.addClass(this.elementRef.nativeElement, 'rxap-table-row-header-action');
667
+ }
668
+ else {
669
+ this.renderer.addClass(this.elementRef.nativeElement, 'rxap-table-row-action');
670
+ }
671
+ this.renderer.addClass(this.elementRef.nativeElement, `rxap-action-${dasherize(this.type)}`);
952
672
  }
953
- get cacheId() {
954
- return this.router.url + '--' + this.name;
673
+ onConfirmed() {
674
+ return this.execute();
955
675
  }
956
- constructor(_element, router) {
957
- this._element = _element;
958
- this.router = router;
959
- this.active = true;
960
- this._hidden = false;
676
+ onClick($event) {
677
+ $event.stopPropagation();
678
+ if (!this._hasConfirmDirective && !this.options?.confirm) {
679
+ return this.execute();
680
+ }
681
+ else if (this.options?.confirm) {
682
+ this.openConfirmOverly();
683
+ }
684
+ else {
685
+ if (isDevMode()) {
686
+ console.debug('skip remote method call. Wait for confirmation.');
687
+ }
688
+ }
689
+ return Promise.resolve();
961
690
  }
962
- ngOnInit() {
963
- const cachedValue = localStorage.getItem(this.cacheId);
964
- if (cachedValue === 'true') {
965
- this.active = true;
691
+ async execute() {
692
+ if (this._actionDisabled) {
693
+ return Promise.resolve();
966
694
  }
967
- if (cachedValue === 'false') {
968
- this.active = false;
695
+ this.setStatus(TableRowActionStatus.EXECUTING);
696
+ try {
697
+ await Promise.all(this.getElementList().map((element) => {
698
+ return Promise.all([
699
+ Promise.all(this.findUntypedActionMethod().map((am) => {
700
+ return am.call({
701
+ element,
702
+ type: this.type,
703
+ });
704
+ })),
705
+ Promise.all(this.findTypedActionMethod().map((am) => {
706
+ return am.call(element);
707
+ })),
708
+ ]);
709
+ }));
710
+ this.setStatus(TableRowActionStatus.SUCCESS);
711
+ }
712
+ catch (e) {
713
+ console.error(`Failed to execute row action: ${e.message}`);
714
+ this.setStatus(TableRowActionStatus.ERROR);
969
715
  }
970
716
  }
971
- toggle() {
972
- this.active = !this.active;
973
- localStorage.setItem(this.cacheId, this.active ? 'true' : 'false');
717
+ /**
718
+ * Disables the action. If the button is pressed the action is NOT executed
719
+ *
720
+ * Hint: the button is set to disabled = true to prevent any conflict with
721
+ * extern button enable features linke : rxapHasEnablePermission
722
+ * @protected
723
+ */
724
+ setButtonDisabled() {
725
+ this._actionDisabled = true;
974
726
  }
975
- activate() {
976
- this.active = true;
977
- localStorage.setItem(this.cacheId, 'true');
727
+ /**
728
+ * Enables the action. If the button is pressed the action is executed
729
+ *
730
+ * TODO : find a way to communicate the disabled state between the features
731
+ * Hint: the button is set to disabled = false to prevent any conflict with
732
+ * extern button enable features linke : rxapHasEnablePermission
733
+ * @protected
734
+ */
735
+ setButtonEnabled() {
736
+ this._actionDisabled = false;
978
737
  }
979
- deactivate() {
980
- this.active = false;
981
- localStorage.setItem(this.cacheId, 'false');
738
+ /**
739
+ * find all method instance in the actionMethodList member that
740
+ * do not have a @TableActionMethod decorators
741
+ * @private
742
+ */
743
+ findUntypedActionMethod() {
744
+ return this.actionMethodList.filter(IsTableRowActionTypeSwitchMethod);
982
745
  }
983
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Component }); }
984
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableColumnOptionComponent, isStandalone: true, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] }); }
746
+ /**
747
+ * find all method instance in the actionMethodList member that
748
+ * do have a @TableActionMethod decorators with the current type
749
+ * @private
750
+ */
751
+ findTypedActionMethod() {
752
+ return this.actionMethodList.filter(IsTableRowActionTypeMethod(this.type));
753
+ }
754
+ setStatus(status) {
755
+ if (this._currentStatus === status) {
756
+ return;
757
+ }
758
+ this._currentStatus = status;
759
+ switch (status) {
760
+ case TableRowActionStatus.EXECUTING:
761
+ this.setButtonDisabled();
762
+ this.executingDirective?.show();
763
+ break;
764
+ case TableRowActionStatus.SUCCESS:
765
+ if (this.refresh) {
766
+ this.tableDataSourceDirective.refresh();
767
+ }
768
+ if (this.successMessage) {
769
+ this.snackBar.open(this.successMessage, 'ok', { duration: 2560 });
770
+ }
771
+ this.setStatus(TableRowActionStatus.DONE);
772
+ break;
773
+ case TableRowActionStatus.ERROR:
774
+ this.setStatus(TableRowActionStatus.DONE);
775
+ if (this.errorMessage) {
776
+ this.snackBar.open(this.errorMessage, 'ok', { duration: 5120 });
777
+ }
778
+ break;
779
+ case TableRowActionStatus.DONE:
780
+ this.setButtonEnabled();
781
+ this.executingDirective?.hide();
782
+ break;
783
+ }
784
+ this.cdr.detectChanges();
785
+ }
786
+ getTableActionOptions() {
787
+ const metadataList = this.actionMethodList.map(actionMethod => GetTableRowActionMetadata(actionMethod));
788
+ if (metadataList.length === 0) {
789
+ return null;
790
+ }
791
+ // TODO : handle multiple metadata or not exist metadata
792
+ return metadataList.filter(metadata => metadata.type === this.type)
793
+ .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0))[0];
794
+ }
795
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AbstractTableRowAction, deps: [{ token: Renderer2 }, { token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatIconButton, optional: true }, { token: MatTooltip, optional: true }, { token: INJECTOR }], target: i0.ɵɵFactoryTarget.Injectable }); }
796
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AbstractTableRowAction }); }
985
797
  }
986
- __decorate([
987
- Required,
988
- __metadata("design:type", String)
989
- ], TableColumnOptionComponent.prototype, "name", void 0);
990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnOptionComponent, decorators: [{
991
- type: Component,
992
- args: [{ selector: 'rxap-table-column-option', standalone: true, template: "<ng-content></ng-content>\n" }]
993
- }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: AbstractTableRowAction, decorators: [{
799
+ type: Injectable
800
+ }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
801
+ type: Inject,
802
+ args: [Renderer2]
803
+ }] }, { type: i1$1.Overlay, decorators: [{
804
+ type: Inject,
805
+ args: [Overlay]
806
+ }] }, { type: i0.ElementRef, decorators: [{
994
807
  type: Inject,
995
808
  args: [ElementRef]
996
- }] }, { type: i1$3.Router }]; }, propDecorators: { name: [{
997
- type: Input
998
- }], active: [{
809
+ }] }, { type: undefined, decorators: [{
810
+ type: Inject,
811
+ args: [RXAP_TABLE_ROW_ACTION_METHOD]
812
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
813
+ type: Inject,
814
+ args: [ChangeDetectorRef]
815
+ }] }, { type: i0.ViewContainerRef, decorators: [{
816
+ type: Inject,
817
+ args: [ViewContainerRef]
818
+ }] }, { type: TableDataSourceDirective, decorators: [{
819
+ type: Inject,
820
+ args: [TableDataSourceDirective]
821
+ }] }, { type: i3$1.MatSnackBar, decorators: [{
822
+ type: Inject,
823
+ args: [MatSnackBar]
824
+ }] }, { type: i4.MatIconButton, decorators: [{
825
+ type: Optional
826
+ }, {
827
+ type: Inject,
828
+ args: [MatIconButton]
829
+ }] }, { type: i5.MatTooltip, decorators: [{
830
+ type: Optional
831
+ }, {
832
+ type: Inject,
833
+ args: [MatTooltip]
834
+ }] }, { type: i0.Injector, decorators: [{
835
+ type: Inject,
836
+ args: [INJECTOR]
837
+ }] }]; }, propDecorators: { errorMessage: [{
999
838
  type: Input
1000
- }], inactive: [{
839
+ }], successMessage: [{
1001
840
  type: Input
1002
- }], hidden: [{
841
+ }], refresh: [{
1003
842
  type: Input
1004
- }], show: [{
843
+ }], color: [{
1005
844
  type: Input
845
+ }], executingDirective: [{
846
+ type: ContentChild,
847
+ args: [TableRowActionExecutingDirective]
848
+ }], hasConfirmDirective: [{
849
+ type: Input,
850
+ args: ['rxapConfirm']
851
+ }], onConfirmed: [{
852
+ type: HostListener,
853
+ args: ['confirmed']
854
+ }], onClick: [{
855
+ type: HostListener,
856
+ args: ['click', ['$event']]
1006
857
  }] } });
1007
858
 
1008
- class TableColumnMenuComponent {
1009
- constructor() {
1010
- this.displayColumns = [];
1011
- this._matCardMode = false;
1012
- }
1013
- set matCard(value) {
1014
- this._matCardMode = coerceBoolean(value);
1015
- }
1016
- ngAfterContentInit() {
1017
- this.updateDisplayColumns();
859
+ class RowActionCheckPipe {
860
+ constructor(tableRowActionMethodList) {
861
+ this.actionMethodList = coerceArray(tableRowActionMethodList);
1018
862
  }
1019
- updateDisplayColumns() {
1020
- if (!this.columns) {
1021
- throw new Error('Could not query content children of TableColumnOptionComponent');
863
+ transform(value, type) {
864
+ if (!type) {
865
+ throw new Error(`The provided type is empty '${type}'`);
1022
866
  }
1023
- this.displayColumns = this.columns
1024
- .filter((option) => option.active)
1025
- .map((option) => option.name);
1026
- }
1027
- activate(columnName) {
1028
- this.columns
1029
- ?.filter((option) => option.name === columnName)
1030
- .forEach((column) => column.activate());
1031
- this.updateDisplayColumns();
1032
- }
1033
- deactivate(columnName) {
1034
- this.columns
1035
- ?.filter((option) => option.name === columnName)
1036
- .forEach((column) => column.deactivate());
1037
- this.updateDisplayColumns();
1038
- }
1039
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1040
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableColumnMenuComponent, isStandalone: true, selector: "rxap-table-column-menu", inputs: { matCard: "matCard" }, host: { properties: { "class.mat-card-mode": "this._matCardMode" } }, queries: [{ propertyName: "columns", predicate: TableColumnOptionComponent }], exportAs: ["rxapTableColumns"], ngImport: i0, template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n <span\n *ngFor=\"let column of columns\"\n [disableRipple]=\"true\"\n [fxHide]=\"column.hidden\"\n mat-menu-item\n rxapStopPropagation\n >\n <mat-checkbox\n (change)=\"column.toggle(); updateDisplayColumns()\"\n [checked]=\"column.active\">\n {{ column.display }}\n </mat-checkbox>\n </span>\n <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode{position:absolute;inset:8px 8px auto auto}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: ExtendedModule }, { kind: "directive", type: i4.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1041
- }
1042
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuComponent, decorators: [{
1043
- type: Component,
1044
- args: [{ selector: 'rxap-table-column-menu', changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'rxapTableColumns', standalone: true, imports: [
1045
- MatButtonModule,
1046
- MatMenuModule,
1047
- MatIconModule,
1048
- NgFor,
1049
- StopPropagationDirective,
1050
- ExtendedModule,
1051
- MatCheckboxModule,
1052
- ], template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n <span\n *ngFor=\"let column of columns\"\n [disableRipple]=\"true\"\n [fxHide]=\"column.hidden\"\n mat-menu-item\n rxapStopPropagation\n >\n <mat-checkbox\n (change)=\"column.toggle(); updateDisplayColumns()\"\n [checked]=\"column.active\">\n {{ column.display }}\n </mat-checkbox>\n </span>\n <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode{position:absolute;inset:8px 8px auto auto}\n"] }]
1053
- }], propDecorators: { columns: [{
1054
- type: ContentChildren,
1055
- args: [TableColumnOptionComponent]
1056
- }], matCard: [{
1057
- type: Input
1058
- }], _matCardMode: [{
1059
- type: HostBinding,
1060
- args: ['class.mat-card-mode']
1061
- }] } });
1062
-
1063
- class TableShowArchivedSlideComponent {
1064
- constructor(tableFilter, tableColumnMenu) {
1065
- this.tableFilter = tableFilter;
1066
- this.tableColumnMenu = tableColumnMenu;
1067
- }
1068
- onChange($event) {
1069
- this.tableFilter.set('__archived', $event.checked);
1070
- if ($event.checked) {
1071
- this.tableColumnMenu.activate('removedAt');
867
+ const actionMethodList = this.actionMethodList.filter(IsTableRowActionTypeMethod(type));
868
+ if (actionMethodList.length > 1) {
869
+ throw new Error(`Multiple (${actionMethodList.length}) action method with the same type '${type}' found`);
1072
870
  }
1073
- else {
1074
- this.tableColumnMenu.deactivate('removedAt');
871
+ if (actionMethodList.length === 0) {
872
+ throw new Error(`Could not find a action method with the type '${type}'`);
873
+ }
874
+ const actionMethod = actionMethodList[0];
875
+ if (HasTableRowActionCheckFunction(actionMethod)) {
876
+ const checkFunction = GetTableRowActionCheckFunction(actionMethod);
877
+ const input = coerceArray(value);
878
+ return input.length !== 0 && input.every(checkFunction);
1075
879
  }
880
+ return true;
1076
881
  }
1077
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableShowArchivedSlideComponent, deps: [{ token: TableFilterService }, { token: TableColumnMenuComponent }], target: i0.ɵɵFactoryTarget.Component }); }
1078
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableShowArchivedSlideComponent, isStandalone: true, selector: "rxap-table-show-archived-slide", ngImport: i0, template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <ng-container i18n>Show archived documents</ng-container>\n </mat-slide-toggle>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i3$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
882
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, deps: [{ token: RXAP_TABLE_ROW_ACTION_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
883
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, isStandalone: true, name: "rxapRowActionCheck" }); }
1079
884
  }
1080
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableShowArchivedSlideComponent, decorators: [{
1081
- type: Component,
1082
- args: [{ selector: 'rxap-table-show-archived-slide', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [StopPropagationDirective, MatSlideToggleModule], template: "<div rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <ng-container i18n>Show archived documents</ng-container>\n </mat-slide-toggle>\n</div>\n" }]
1083
- }], ctorParameters: function () { return [{ type: TableFilterService }, { type: TableColumnMenuComponent }]; } });
1084
-
1085
- const TABLE_CREATE_REMOTE_METHOD = new InjectionToken('table-create-remote-method');
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, decorators: [{
886
+ type: Pipe,
887
+ args: [{
888
+ name: 'rxapRowActionCheck',
889
+ standalone: true,
890
+ }]
891
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
892
+ type: Optional
893
+ }, {
894
+ type: Inject,
895
+ args: [RXAP_TABLE_ROW_ACTION_METHOD]
896
+ }] }]; } });
1086
897
 
1087
- class TableCreateButtonDirective {
1088
- constructor(remoteMethod, elementRef, renderer) {
1089
- this.remoteMethod = remoteMethod;
1090
- this.elementRef = elementRef;
1091
- this.renderer = renderer;
1092
- }
1093
- ngOnInit() {
1094
- this.renderer.setStyle(this.elementRef.nativeElement, 'margin-bottom', '6px');
1095
- }
1096
- ngOnDestroy() {
1097
- if (this._createObservable instanceof Subject) {
1098
- this._createObservable.complete();
1099
- }
1100
- }
1101
- async onClick() {
1102
- const result = this._createObservable = await this.remoteMethod.call();
1103
- if (isObservable(result)) {
1104
- await result.toPromise();
1105
- }
1106
- this.dataSource.refresh();
898
+ class TableRowActionDirective extends AbstractTableRowAction {
899
+ getElementList() {
900
+ return [this.element];
1107
901
  }
1108
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableCreateButtonDirective, deps: [{ token: TABLE_CREATE_REMOTE_METHOD }, { token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1109
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableCreateButtonDirective, isStandalone: true, selector: "button[rxapTableCreate]", inputs: { dataSource: ["rxapTableCreate", "dataSource"] }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
902
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
903
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowActionDirective, isStandalone: true, selector: "button[rxapTableRowAction]", inputs: { errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", color: "color", type: ["rxapTableRowAction", "type"], element: "element" }, usesInheritance: true, ngImport: i0 }); }
1110
904
  }
1111
- __decorate([
1112
- Required,
1113
- __metadata("design:type", TableDataSourceDirective)
1114
- ], TableCreateButtonDirective.prototype, "dataSource", void 0);
1115
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableCreateButtonDirective, decorators: [{
905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionDirective, decorators: [{
1116
906
  type: Directive,
1117
907
  args: [{
1118
- selector: 'button[rxapTableCreate]',
908
+ selector: 'button[rxapTableRowAction]',
1119
909
  standalone: true,
910
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
911
+ inputs: ['errorMessage', 'successMessage', 'refresh', 'color'],
1120
912
  }]
1121
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1122
- type: Inject,
1123
- args: [TABLE_CREATE_REMOTE_METHOD]
1124
- }] }, { type: i0.ElementRef, decorators: [{
1125
- type: Inject,
1126
- args: [ElementRef]
1127
- }] }, { type: i0.Renderer2, decorators: [{
1128
- type: Inject,
1129
- args: [Renderer2]
1130
- }] }]; }, propDecorators: { dataSource: [{
913
+ }], propDecorators: { type: [{
1131
914
  type: Input,
1132
- args: ['rxapTableCreate']
1133
- }], onClick: [{
1134
- type: HostListener,
1135
- args: ['click']
915
+ args: [{
916
+ required: true,
917
+ alias: 'rxapTableRowAction',
918
+ }]
919
+ }], element: [{
920
+ type: Input,
921
+ args: [{ required: true }]
1136
922
  }] } });
1137
923
 
1138
- const ROW_ARCHIVE_METHOD = new InjectionToken('archive-remote-method');
1139
- const ROW_RESTORE_METHOD = new InjectionToken('unarchive-remote-method');
1140
- const ROW_DELETE_METHOD = new InjectionToken('delete-remote-method');
1141
- const ROW_EDIT_METHOD = new InjectionToken('edit-remote-method');
1142
- const ROW_VIEW_METHOD = new InjectionToken('view-remote-method');
1143
- const ROW_LINK_METHOD = new InjectionToken('link-remote-method');
1144
- const ROW_EDIT_LOADER_METHOD = new InjectionToken('edit-loader-method');
1145
-
1146
- class RowControlsCellComponent {
1147
- constructor(tableDataSource, deleteRemoteMethod = null, archiveRemoteMethod = null, unarchiveRemoteMethod = null, editRemoteMethod = null, rowViewMethod = null, rowLinkMethod = null, editLoaderMethod = null) {
1148
- this.tableDataSource = tableDataSource;
1149
- this.deleteRemoteMethod = deleteRemoteMethod;
1150
- this.archiveRemoteMethod = archiveRemoteMethod;
1151
- this.unarchiveRemoteMethod = unarchiveRemoteMethod;
1152
- this.editRemoteMethod = editRemoteMethod;
1153
- this.rowViewMethod = rowViewMethod;
1154
- this.rowLinkMethod = rowLinkMethod;
1155
- this.editLoaderMethod = editLoaderMethod;
1156
- }
1157
- async archive() {
1158
- if (this.archiveRemoteMethod) {
1159
- await this.archiveRemoteMethod.call({ parameters: { uuid: this.element.uuid } });
1160
- this.tableDataSource.refresh();
1161
- }
1162
- }
1163
- async unarchive() {
1164
- if (this.unarchiveRemoteMethod) {
1165
- await this.unarchiveRemoteMethod.call({ parameters: { uuid: this.element.uuid } });
1166
- this.tableDataSource.refresh();
1167
- }
924
+ class TableRowHeaderActionDirective extends AbstractTableRowAction {
925
+ constructor(renderer, overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector, selectRowService) {
926
+ super(renderer, overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, injector);
927
+ this.selectRowService = selectRowService;
928
+ this.isHeader = true;
1168
929
  }
1169
- async remove() {
1170
- if (this.deleteRemoteMethod) {
1171
- await this.deleteRemoteMethod.call({ parameters: { uuid: this.element.uuid } });
1172
- this.tableDataSource.refresh();
1173
- }
930
+ ngOnDestroy() {
931
+ this._subscription?.unsubscribe();
1174
932
  }
1175
- async view() {
1176
- if (this.rowViewMethod) {
1177
- await this.rowViewMethod.call(this.element);
933
+ ngOnInit() {
934
+ if (this.selectRowService) {
935
+ this._subscription = this.selectRowService.selectedRows$
936
+ .pipe(startWith(this.selectRowService.selectedRows), map((rows) => rows.length !== 0), tap((hasSelected) => {
937
+ if (hasSelected) {
938
+ this.setButtonEnabled();
939
+ }
940
+ else {
941
+ this.setButtonDisabled();
942
+ }
943
+ this.cdr.detectChanges();
944
+ }))
945
+ .subscribe();
1178
946
  }
1179
- }
1180
- async link() {
1181
- if (this.rowLinkMethod) {
1182
- await this.rowLinkMethod.call(this.element);
947
+ else {
948
+ this.setButtonDisabled();
1183
949
  }
1184
950
  }
1185
- async edit() {
1186
- if (this.editRemoteMethod) {
1187
- let initial = this.element;
1188
- if (this.editLoaderMethod) {
1189
- initial = await this.editLoaderMethod.call(initial);
1190
- }
1191
- const result = await this.editRemoteMethod.call(initial, { context: this.element });
1192
- if (isObservable(result)) {
1193
- await result.toPromise();
1194
- }
1195
- this.tableDataSource.refresh();
1196
- }
951
+ getElementList() {
952
+ return this.selectRowService?.selectedRows ?? [];
1197
953
  }
1198
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowControlsCellComponent, deps: [{ token: TableDataSourceDirective }, { token: ROW_DELETE_METHOD, optional: true }, { token: ROW_ARCHIVE_METHOD, optional: true }, { token: ROW_RESTORE_METHOD, optional: true }, { token: ROW_EDIT_METHOD, optional: true }, { token: ROW_VIEW_METHOD, optional: true }, { token: ROW_LINK_METHOD, optional: true }, { token: ROW_EDIT_LOADER_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1199
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: RowControlsCellComponent, isStandalone: true, selector: "td[rxap-row-controls-cell]", inputs: { element: "element" }, ngImport: i0, template: "<div fxLayout=\"row\">\n\n <!-- archive -->\n <button (confirmed)=\"archive()\" *ngIf=\"!element['__archived'] && archiveRemoteMethod\" fxFlex=\"40px\"\n mat-icon-button matTooltip=\"Archivieren\" rxapConfirm\n type=\"button\">\n <mat-icon>archive</mat-icon>\n </button>\n\n <!-- unarchive -->\n <button (confirmed)=\"unarchive()\" *ngIf=\"element['__archived'] && unarchiveRemoteMethod\" fxFlex=\"40px\"\n mat-icon-button matTooltip=\"Wiederherstellen\" rxapConfirm\n type=\"button\">\n <mat-icon>unarchive</mat-icon>\n </button>\n\n <!-- delete -->\n <button (confirmed)=\"remove()\"\n *ngIf=\"(element['__archived'] && deleteRemoteMethod) || (deleteRemoteMethod && !unarchiveRemoteMethod && !archiveRemoteMethod)\"\n color=\"warn\"\n fxFlex=\"40px\" mat-icon-button matTooltip=\"L\u00F6schen\"\n rxapConfirm type=\"button\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- edit -->\n <button (click)=\"edit()\" *ngIf=\"!element['__archived'] && editRemoteMethod\" fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Bearbeiten\" type=\"button\">\n <mat-icon>edit</mat-icon>\n </button>\n\n <!-- view -->\n <button (click)=\"view()\" *ngIf=\"rowViewMethod\" fxFlex=\"40px\" mat-icon-button matTooltip=\"Details\" type=\"button\">\n <mat-icon>visibility</mat-icon>\n </button>\n\n <!-- link -->\n <button (click)=\"link()\" *ngIf=\"rowLinkMethod\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon svgIcon=\"database-import\"></mat-icon>\n </button>\n\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: ConfirmDirective, selector: "[rxapConfirm]", inputs: ["rxapConfirm"], outputs: ["confirmed", "unconfirmed"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
954
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowHeaderActionDirective, deps: [{ token: Renderer2 }, { token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatButton, optional: true }, { token: MatTooltip, optional: true }, { token: INJECTOR }, { token: SelectRowService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
955
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowHeaderActionDirective, isStandalone: true, selector: "button[rxapTableRowHeaderAction]", inputs: { errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", color: "color", type: ["rxapTableRowHeaderAction", "type"] }, usesInheritance: true, ngImport: i0 }); }
1200
956
  }
1201
- __decorate([
1202
- Required,
1203
- __metadata("design:type", Object)
1204
- ], RowControlsCellComponent.prototype, "element", void 0);
1205
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowControlsCellComponent, decorators: [{
1206
- type: Component,
1207
- args: [{ selector: 'td[rxap-row-controls-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [FlexModule, NgIf, MatButtonModule, MatTooltipModule, ConfirmDirective, MatIconModule], template: "<div fxLayout=\"row\">\n\n <!-- archive -->\n <button (confirmed)=\"archive()\" *ngIf=\"!element['__archived'] && archiveRemoteMethod\" fxFlex=\"40px\"\n mat-icon-button matTooltip=\"Archivieren\" rxapConfirm\n type=\"button\">\n <mat-icon>archive</mat-icon>\n </button>\n\n <!-- unarchive -->\n <button (confirmed)=\"unarchive()\" *ngIf=\"element['__archived'] && unarchiveRemoteMethod\" fxFlex=\"40px\"\n mat-icon-button matTooltip=\"Wiederherstellen\" rxapConfirm\n type=\"button\">\n <mat-icon>unarchive</mat-icon>\n </button>\n\n <!-- delete -->\n <button (confirmed)=\"remove()\"\n *ngIf=\"(element['__archived'] && deleteRemoteMethod) || (deleteRemoteMethod && !unarchiveRemoteMethod && !archiveRemoteMethod)\"\n color=\"warn\"\n fxFlex=\"40px\" mat-icon-button matTooltip=\"L\u00F6schen\"\n rxapConfirm type=\"button\">\n <mat-icon>delete</mat-icon>\n </button>\n\n <!-- edit -->\n <button (click)=\"edit()\" *ngIf=\"!element['__archived'] && editRemoteMethod\" fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Bearbeiten\" type=\"button\">\n <mat-icon>edit</mat-icon>\n </button>\n\n <!-- view -->\n <button (click)=\"view()\" *ngIf=\"rowViewMethod\" fxFlex=\"40px\" mat-icon-button matTooltip=\"Details\" type=\"button\">\n <mat-icon>visibility</mat-icon>\n </button>\n\n <!-- link -->\n <button (click)=\"link()\" *ngIf=\"rowLinkMethod\" fxFlex=\"40px\" mat-icon-button type=\"button\">\n <mat-icon svgIcon=\"database-import\"></mat-icon>\n </button>\n\n</div>\n" }]
1208
- }], ctorParameters: function () { return [{ type: TableDataSourceDirective }, { type: undefined, decorators: [{
1209
- type: Optional
1210
- }, {
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowHeaderActionDirective, decorators: [{
958
+ type: Directive,
959
+ args: [{
960
+ selector: 'button[rxapTableRowHeaderAction]',
961
+ standalone: true,
962
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
963
+ inputs: ['errorMessage', 'successMessage', 'refresh', 'color'],
964
+ }]
965
+ }], ctorParameters: function () { return [{ type: i0.Renderer2, decorators: [{
1211
966
  type: Inject,
1212
- args: [ROW_DELETE_METHOD]
1213
- }] }, { type: undefined, decorators: [{
1214
- type: Optional
1215
- }, {
967
+ args: [Renderer2]
968
+ }] }, { type: i1$1.Overlay, decorators: [{
1216
969
  type: Inject,
1217
- args: [ROW_ARCHIVE_METHOD]
1218
- }] }, { type: undefined, decorators: [{
1219
- type: Optional
1220
- }, {
970
+ args: [Overlay]
971
+ }] }, { type: i0.ElementRef, decorators: [{
1221
972
  type: Inject,
1222
- args: [ROW_RESTORE_METHOD]
973
+ args: [ElementRef]
1223
974
  }] }, { type: undefined, decorators: [{
1224
- type: Optional
1225
- }, {
1226
975
  type: Inject,
1227
- args: [ROW_EDIT_METHOD]
1228
- }] }, { type: undefined, decorators: [{
1229
- type: Optional
1230
- }, {
976
+ args: [RXAP_TABLE_ROW_ACTION_METHOD]
977
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
1231
978
  type: Inject,
1232
- args: [ROW_VIEW_METHOD]
1233
- }] }, { type: undefined, decorators: [{
1234
- type: Optional
1235
- }, {
979
+ args: [ChangeDetectorRef]
980
+ }] }, { type: i0.ViewContainerRef, decorators: [{
1236
981
  type: Inject,
1237
- args: [ROW_LINK_METHOD]
1238
- }] }, { type: undefined, decorators: [{
1239
- type: Optional
1240
- }, {
982
+ args: [ViewContainerRef]
983
+ }] }, { type: TableDataSourceDirective, decorators: [{
1241
984
  type: Inject,
1242
- args: [ROW_EDIT_LOADER_METHOD]
1243
- }] }]; }, propDecorators: { element: [{
1244
- type: Input
1245
- }] } });
1246
-
1247
- class RowControlsHeaderCellComponent {
1248
- constructor(tableDataSource, tableFilter = null, selectRow = null, deleteRemoteMethod = null, archiveRemoteMethod = null, unarchiveRemoteMethod = null) {
1249
- this.tableDataSource = tableDataSource;
1250
- this.tableFilter = tableFilter;
1251
- this.selectRow = selectRow;
1252
- this.deleteRemoteMethod = deleteRemoteMethod;
1253
- this.archiveRemoteMethod = archiveRemoteMethod;
1254
- this.unarchiveRemoteMethod = unarchiveRemoteMethod;
1255
- this.disabled$ =
1256
- this.selectRow?.selectedRows$.pipe(map((selectedRows) => selectedRows.length === 0), startWith(true)) ?? of(true);
1257
- this.showUnarchive$ = this.showDelete$ =
1258
- this.tableFilter?.change.pipe(map((filter) => filter &&
1259
- filter['__archived'] !== undefined &&
1260
- filter['__archived'] === true), distinctUntilChanged()) ?? of(false);
1261
- this.showArchive$ =
1262
- this.tableFilter?.change.pipe(map((filter) => !filter ||
1263
- filter['__archived'] === undefined ||
1264
- filter['__archived'] === false), distinctUntilChanged()) ?? of(true);
1265
- if (!this.archiveRemoteMethod) {
1266
- this.showArchive$ = of(false);
1267
- }
1268
- if (!this.unarchiveRemoteMethod) {
1269
- this.showUnarchive$ = of(false);
1270
- }
1271
- if (!this.deleteRemoteMethod) {
1272
- this.showDelete$ = of(false);
1273
- }
1274
- }
1275
- async archiveSelected(selectedRows) {
1276
- if (this.archiveRemoteMethod && selectedRows) {
1277
- await Promise.all(selectedRows.map((selectedRow) => this.archiveRemoteMethod?.call({
1278
- parameters: { uuid: selectedRow['uuid'] },
1279
- })));
1280
- this.tableDataSource.refresh();
1281
- }
1282
- }
1283
- async unarchiveSelected(selectedRows) {
1284
- if (this.unarchiveRemoteMethod && selectedRows) {
1285
- await Promise.all(selectedRows.map((selectedRow) => this.unarchiveRemoteMethod?.call({
1286
- parameters: { uuid: selectedRow['uuid'] },
1287
- })));
1288
- this.tableDataSource.refresh();
1289
- }
1290
- }
1291
- async deleteSelected(selectedRows) {
1292
- if (this.deleteRemoteMethod && selectedRows) {
1293
- await Promise.all(selectedRows.map((selectedRow) => this.deleteRemoteMethod?.call({
1294
- parameters: { uuid: selectedRow['uuid'] },
1295
- })));
1296
- this.tableDataSource.refresh();
1297
- }
1298
- }
1299
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowControlsHeaderCellComponent, deps: [{ token: TableDataSourceDirective }, { token: TableFilterService, optional: true }, { token: SelectRowService, optional: true }, { token: ROW_DELETE_METHOD, optional: true }, { token: ROW_ARCHIVE_METHOD, optional: true }, { token: ROW_RESTORE_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1300
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: RowControlsHeaderCellComponent, isStandalone: true, selector: "th[rxap-row-controls-header-cell]", ngImport: i0, template: "<div fxLayout=\"row\">\n\n <!-- archive -->\n <button (confirmed)=\"archiveSelected($event)\" *ngIf=\"selectRow && (showArchive$ | async)\"\n [disabled]=\"disabled$ | async\"\n [rxapConfirm]=\"selectRow.selectedRows\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Archivieren\" type=\"button\">\n <mat-icon>archive</mat-icon>\n </button>\n\n <!-- unarchive -->\n <button (confirmed)=\"unarchiveSelected($event)\" *ngIf=\"selectRow && (showUnarchive$ | async)\"\n [disabled]=\"disabled$ | async\"\n [rxapConfirm]=\"selectRow.selectedRows\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Wiederherstellen\" type=\"button\">\n <mat-icon>unarchive</mat-icon>\n </button>\n\n <!-- delete -->\n <button (confirmed)=\"deleteSelected($event)\" *ngIf=\"selectRow && (showDelete$ | async)\"\n [disabled]=\"disabled$ | async\" [rxapConfirm]=\"selectRow.selectedRows\" color=\"warn\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"L\u00F6schen\" type=\"button\">\n <mat-icon>delete</mat-icon>\n </button>\n\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: ConfirmDirective, selector: "[rxapConfirm]", inputs: ["rxapConfirm"], outputs: ["confirmed", "unconfirmed"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1301
- }
1302
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowControlsHeaderCellComponent, decorators: [{
1303
- type: Component,
1304
- args: [{ selector: 'th[rxap-row-controls-header-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1305
- FlexModule,
1306
- NgIf,
1307
- MatButtonModule,
1308
- MatTooltipModule,
1309
- ConfirmDirective,
1310
- MatIconModule,
1311
- AsyncPipe,
1312
- ], template: "<div fxLayout=\"row\">\n\n <!-- archive -->\n <button (confirmed)=\"archiveSelected($event)\" *ngIf=\"selectRow && (showArchive$ | async)\"\n [disabled]=\"disabled$ | async\"\n [rxapConfirm]=\"selectRow.selectedRows\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Archivieren\" type=\"button\">\n <mat-icon>archive</mat-icon>\n </button>\n\n <!-- unarchive -->\n <button (confirmed)=\"unarchiveSelected($event)\" *ngIf=\"selectRow && (showUnarchive$ | async)\"\n [disabled]=\"disabled$ | async\"\n [rxapConfirm]=\"selectRow.selectedRows\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"Wiederherstellen\" type=\"button\">\n <mat-icon>unarchive</mat-icon>\n </button>\n\n <!-- delete -->\n <button (confirmed)=\"deleteSelected($event)\" *ngIf=\"selectRow && (showDelete$ | async)\"\n [disabled]=\"disabled$ | async\" [rxapConfirm]=\"selectRow.selectedRows\" color=\"warn\"\n fxFlex=\"40px\" mat-icon-button\n matTooltip=\"L\u00F6schen\" type=\"button\">\n <mat-icon>delete</mat-icon>\n </button>\n\n</div>\n" }]
1313
- }], ctorParameters: function () { return [{ type: TableDataSourceDirective }, { type: TableFilterService, decorators: [{
1314
- type: Optional
1315
- }, {
985
+ args: [TableDataSourceDirective]
986
+ }] }, { type: i3$1.MatSnackBar, decorators: [{
1316
987
  type: Inject,
1317
- args: [TableFilterService]
1318
- }] }, { type: SelectRowService, decorators: [{
988
+ args: [MatSnackBar]
989
+ }] }, { type: i4.MatButton, decorators: [{
1319
990
  type: Optional
1320
991
  }, {
1321
992
  type: Inject,
1322
- args: [SelectRowService]
1323
- }] }, { type: undefined, decorators: [{
993
+ args: [MatButton]
994
+ }] }, { type: i5.MatTooltip, decorators: [{
1324
995
  type: Optional
1325
996
  }, {
1326
997
  type: Inject,
1327
- args: [ROW_DELETE_METHOD]
1328
- }] }, { type: undefined, decorators: [{
1329
- type: Optional
1330
- }, {
998
+ args: [MatTooltip]
999
+ }] }, { type: i0.Injector, decorators: [{
1331
1000
  type: Inject,
1332
- args: [ROW_ARCHIVE_METHOD]
1333
- }] }, { type: undefined, decorators: [{
1001
+ args: [INJECTOR]
1002
+ }] }, { type: SelectRowService, decorators: [{
1334
1003
  type: Optional
1335
1004
  }, {
1336
1005
  type: Inject,
1337
- args: [ROW_RESTORE_METHOD]
1338
- }] }]; } });
1006
+ args: [SelectRowService]
1007
+ }] }]; }, propDecorators: { type: [{
1008
+ type: Input,
1009
+ args: [{
1010
+ required: true,
1011
+ alias: 'rxapTableRowHeaderAction',
1012
+ }]
1013
+ }] } });
1339
1014
 
1340
- class TableSelectControlsComponent {
1341
- constructor(selectRows, windowRef) {
1342
- this.selectRows = selectRows;
1343
- this.windowRef = windowRef;
1344
- this.hasNotSelected$ = this.selectRows.selectedRows$.pipe(map((selected) => selected.length === 0));
1345
- }
1346
- cancel() {
1347
- this.windowRef.close();
1348
- }
1349
- select() {
1350
- this.windowRef.close(this.selectRows.selectedRows);
1351
- }
1352
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableSelectControlsComponent, deps: [{ token: SelectRowService }, { token: RXAP_WINDOW_REF }], target: i0.ɵɵFactoryTarget.Component }); }
1353
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableSelectControlsComponent, isStandalone: true, selector: "rxap-table-select-controls", ngImport: i0, template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button (click)=\"cancel()\" fxFlex=\"nogrow\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" fxFlex=\"nogrow\" mat-raised-button type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1015
+ class TableRowActionsModule {
1016
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1017
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionsModule, imports: [TableRowActionDirective,
1018
+ TableRowActionExecutingDirective,
1019
+ TableRowHeaderActionDirective,
1020
+ RowActionCheckPipe,
1021
+ ConfirmModule], exports: [TableRowActionDirective,
1022
+ TableRowHeaderActionDirective,
1023
+ TableRowActionExecutingDirective,
1024
+ RowActionCheckPipe,
1025
+ MatTooltipModule,
1026
+ MatButtonModule,
1027
+ ConfirmModule,
1028
+ MatIconModule,
1029
+ MatProgressBarModule,
1030
+ CommonModule] }); }
1031
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionsModule, imports: [ConfirmModule, MatTooltipModule,
1032
+ MatButtonModule,
1033
+ ConfirmModule,
1034
+ MatIconModule,
1035
+ MatProgressBarModule,
1036
+ CommonModule] }); }
1354
1037
  }
1355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableSelectControlsComponent, decorators: [{
1356
- type: Component,
1357
- args: [{ selector: 'rxap-table-select-controls', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1358
- FlexModule,
1038
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionsModule, decorators: [{
1039
+ type: NgModule,
1040
+ args: [{
1041
+ imports: [
1042
+ TableRowActionDirective,
1043
+ TableRowActionExecutingDirective,
1044
+ TableRowHeaderActionDirective,
1045
+ RowActionCheckPipe,
1046
+ ConfirmModule,
1047
+ ],
1048
+ exports: [
1049
+ TableRowActionDirective,
1050
+ TableRowHeaderActionDirective,
1051
+ TableRowActionExecutingDirective,
1052
+ RowActionCheckPipe,
1053
+ MatTooltipModule,
1359
1054
  MatButtonModule,
1360
- AsyncPipe,
1361
- ], template: "<div fxLayout=\"row\" fxLayoutGap=\"16px\">\n <button (click)=\"cancel()\" fxFlex=\"nogrow\" mat-stroked-button type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"select()\" [disabled]=\"hasNotSelected$ | async\" fxFlex=\"nogrow\" mat-raised-button type=\"button\">\n <ng-container i18n>Select</ng-container>\n </button>\n</div>\n" }]
1362
- }], ctorParameters: function () { return [{ type: SelectRowService }, { type: undefined, decorators: [{
1363
- type: Inject,
1364
- args: [RXAP_WINDOW_REF]
1365
- }] }]; } });
1055
+ ConfirmModule,
1056
+ MatIconModule,
1057
+ MatProgressBarModule,
1058
+ CommonModule,
1059
+ ],
1060
+ }]
1061
+ }] });
1366
1062
 
1367
- class ImageCellComponent {
1368
- constructor() {
1369
- this.size = BackgroundSizeOptions.COVER;
1370
- this.repeat = BackgroundRepeatOptions.NO_REPEAT;
1371
- this.position = BackgroundPositionOptions.CENTER_CENTER;
1372
- this.value = null;
1063
+ const RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA = 'rxap-table-header-button-method-metadata';
1064
+ function TableHeaderButtonMethod(options = {}) {
1065
+ return function (target) {
1066
+ setMetadata(RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, options, target);
1067
+ };
1068
+ }
1069
+ function GetTableHeaderButtonMetadata(method) {
1070
+ const metadata = getMetadata(RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, method.constructor);
1071
+ if (!metadata) {
1072
+ throw new Error(`Extracted metadata from '${method.constructor.name}' is empty`);
1373
1073
  }
1374
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1375
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ImageCellComponent, isStandalone: true, selector: "td[rxap-image-cell]", inputs: { preset: "preset", size: "size", repeat: "repeat", position: "position", value: ["rxap-image-cell", "value"] }, ngImport: i0, template: "<div\n *ngIf=\"value\"\n [ngClass]=\"[preset]\"\n [position]=\"position\"\n [repeat]=\"repeat\"\n [rxapBackgroundImage]=\"value\"\n [size]=\"size\"\n class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BackgroundImageDirective, selector: "[rxapBackgroundImage]", inputs: ["rxapBackgroundImage", "placeholderImageUrl", "size", "repeat", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1074
+ return metadata;
1376
1075
  }
1377
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageCellComponent, decorators: [{
1378
- type: Component,
1379
- args: [{ selector: 'td[rxap-image-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, NgClass, BackgroundImageDirective], template: "<div\n *ngIf=\"value\"\n [ngClass]=\"[preset]\"\n [position]=\"position\"\n [repeat]=\"repeat\"\n [rxapBackgroundImage]=\"value\"\n [size]=\"size\"\n class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"] }]
1380
- }], propDecorators: { preset: [{
1381
- type: Input
1382
- }], size: [{
1383
- type: Input
1384
- }], repeat: [{
1385
- type: Input
1386
- }], position: [{
1387
- type: Input
1388
- }], value: [{
1389
- type: Input,
1390
- args: ['rxap-image-cell']
1391
- }] } });
1392
-
1393
- class CopyToClipboardCellComponent {
1394
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CopyToClipboardCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1395
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CopyToClipboardCellComponent, isStandalone: true, selector: "td[rxap-copy-to-clipboard-cell]", inputs: { value: ["rxap-copy-to-clipboard-cell", "value"] }, ngImport: i0, template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CopyToClipboardComponent, selector: "rxap-copy-to-clipboard", inputs: ["active", "disabled", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1396
- }
1397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CopyToClipboardCellComponent, decorators: [{
1398
- type: Component,
1399
- args: [{ selector: 'td[rxap-copy-to-clipboard-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, CopyToClipboardComponent], template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
1400
- }], propDecorators: { value: [{
1401
- type: Input,
1402
- args: ['rxap-copy-to-clipboard-cell']
1403
- }] } });
1404
1076
 
1405
- class IconCellComponent {
1406
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IconCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1407
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: IconCellComponent, isStandalone: true, selector: "td[rxap-icon-cell]", inputs: { icon: ["rxap-icon-cell", "icon"] }, ngImport: i0, template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1408
- }
1409
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IconCellComponent, decorators: [{
1410
- type: Component,
1411
- args: [{ selector: 'td[rxap-icon-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, MatIconModule, IconDirective], template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n" }]
1412
- }], propDecorators: { icon: [{
1413
- type: Input,
1414
- args: ['rxap-icon-cell']
1415
- }] } });
1077
+ var TableHeaderButtonActionStatus;
1078
+ (function (TableHeaderButtonActionStatus) {
1079
+ TableHeaderButtonActionStatus["EXECUTING"] = "executing";
1080
+ TableHeaderButtonActionStatus["DONE"] = "done";
1081
+ TableHeaderButtonActionStatus["ERROR"] = "error";
1082
+ TableHeaderButtonActionStatus["SUCCESS"] = "success";
1083
+ })(TableHeaderButtonActionStatus || (TableHeaderButtonActionStatus = {}));
1416
1084
 
1417
- class DateCellComponent {
1418
- constructor() {
1419
- this.date = null;
1420
- this.format = 'dd.MM.yyyy HH:mm';
1421
- }
1422
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DateCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1423
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DateCellComponent, isStandalone: true, selector: "td[rxap-date-cell]", inputs: { date: ["rxap-date-cell", "date"], format: "format" }, ngImport: i0, template: "<ng-template [ngIf]=\"date\">\n {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1424
- }
1425
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DateCellComponent, decorators: [{
1426
- type: Component,
1427
- args: [{ selector: 'td[rxap-date-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, DatePipe], template: "<ng-template [ngIf]=\"date\">\n {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n" }]
1428
- }], propDecorators: { date: [{
1429
- type: Input,
1430
- args: ['rxap-date-cell']
1431
- }], format: [{
1432
- type: Input
1433
- }] } });
1085
+ const TABLE_HEADER_BUTTON_METHOD = new InjectionToken('table-header-button-method');
1434
1086
 
1435
- class LinkCellComponent {
1436
- constructor() {
1437
- this.short = true;
1438
- }
1439
- get href() {
1440
- if (this.protocol) {
1441
- return [this.protocol, this.value].join(':');
1442
- }
1443
- return this.value;
1087
+ class TableHeaderButtonDirective extends ConfirmDirective {
1088
+ constructor(overlay, elementRef, method, snackBar, matTooltip, matButton, cdr) {
1089
+ super(overlay, elementRef);
1090
+ this.method = method;
1091
+ this.snackBar = snackBar;
1092
+ this.matTooltip = matTooltip;
1093
+ this.matButton = matButton;
1094
+ this.cdr = cdr;
1095
+ this.options = null;
1096
+ this._actionDisabled = false;
1097
+ this._currentStatus = TableHeaderButtonActionStatus.DONE;
1098
+ this._hasConfirmDirective = false;
1444
1099
  }
1445
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LinkCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1446
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: LinkCellComponent, isStandalone: true, selector: "td[rxap-link-cell]", inputs: { value: ["rxap-link-cell", "value"], protocol: "protocol", short: "short" }, ngImport: i0, template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"8px\">\n <span *ngIf=\"short\" class=\"content\" fxFlex=\"nogrow\" i18n>Open</span>\n <ng-container [ngSwitch]=\"protocol\">\n <mat-icon *ngSwitchCase=\"'tel'\" fxFlex=\"nogrow\">call</mat-icon>\n <mat-icon *ngSwitchCase=\"'mailto'\" fxFlex=\"nogrow\">email</mat-icon>\n <mat-icon *ngSwitchDefault fxFlex=\"nogrow\">launch</mat-icon>\n </ng-container>\n <span *ngIf=\"!short\" class=\"content\" fxFlex=\"nogrow\">{{value}}</span>\n </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2$2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2$2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2$2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2$2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1447
- }
1448
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LinkCellComponent, decorators: [{
1449
- type: Component,
1450
- args: [{ selector: 'td[rxap-link-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, MatTooltipModule, FlexModule, NgSwitch, NgSwitchCase, MatIconModule, NgSwitchDefault], template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"8px\">\n <span *ngIf=\"short\" class=\"content\" fxFlex=\"nogrow\" i18n>Open</span>\n <ng-container [ngSwitch]=\"protocol\">\n <mat-icon *ngSwitchCase=\"'tel'\" fxFlex=\"nogrow\">call</mat-icon>\n <mat-icon *ngSwitchCase=\"'mailto'\" fxFlex=\"nogrow\">email</mat-icon>\n <mat-icon *ngSwitchDefault fxFlex=\"nogrow\">launch</mat-icon>\n </ng-container>\n <span *ngIf=\"!short\" class=\"content\" fxFlex=\"nogrow\">{{value}}</span>\n </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
1451
- }], propDecorators: { value: [{
1452
- type: Input,
1453
- args: ['rxap-link-cell']
1454
- }], protocol: [{
1455
- type: Input
1456
- }], short: [{
1457
- type: Input
1458
- }] } });
1459
-
1460
- class OptionsCellComponent {
1461
- constructor(renderer) {
1462
- this.renderer = renderer;
1463
- this._subscription = new Subscription();
1464
- this._initialised = false;
1465
- this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
1466
- this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
1100
+ // eslint-disable-next-line @angular-eslint/no-input-rename
1101
+ set hasConfirmDirective(value) {
1102
+ this._hasConfirmDirective = coerceBoolean(value);
1467
1103
  }
1468
- ngAfterContentInit() {
1469
- // Hide the mat-option elements
1470
- this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
1471
- this.setViewValue();
1472
- this._initialised = true;
1104
+ onConfirmed() {
1105
+ return this.execute();
1473
1106
  }
1474
- setViewValue() {
1475
- if (this.value === undefined || this.value === null) {
1476
- this.viewValue = this.emptyViewValue;
1107
+ onClick($event) {
1108
+ $event.stopPropagation();
1109
+ if (!this._hasConfirmDirective && !this.options?.confirm) {
1110
+ return this.execute();
1111
+ }
1112
+ else if (this.options?.confirm) {
1113
+ this.openConfirmOverly();
1477
1114
  }
1478
1115
  else {
1479
- if (this.options) {
1480
- this._subscription.add(this.options.changes
1481
- .pipe(startWith(null), tap(() => (this.viewValue = this.getViewValue())))
1482
- .subscribe());
1483
- }
1484
- else if (isDevMode()) {
1485
- console.log('Could not load any option');
1116
+ if (isDevMode()) {
1117
+ console.debug('skip remote method call. Wait for confirmation.');
1486
1118
  }
1487
1119
  }
1120
+ return Promise.resolve();
1488
1121
  }
1489
- ngOnChanges(changes) {
1490
- if (this._initialised) {
1491
- if (changes['value']) {
1492
- this.setViewValue();
1122
+ async execute() {
1123
+ if (this._actionDisabled) {
1124
+ return Promise.resolve();
1125
+ }
1126
+ this.setStatus(TableHeaderButtonActionStatus.EXECUTING);
1127
+ try {
1128
+ await this.method.call();
1129
+ this.setStatus(TableHeaderButtonActionStatus.SUCCESS);
1130
+ }
1131
+ catch (e) {
1132
+ console.error(`Failed to execute table header action: ${e.message}`);
1133
+ this.setStatus(TableHeaderButtonActionStatus.ERROR);
1134
+ }
1135
+ }
1136
+ ngOnInit() {
1137
+ this.options = this.getTableHeaderButtonOptions();
1138
+ if (this.options) {
1139
+ this.refresh ??= this.options.refresh ?? false;
1140
+ this.errorMessage ??= this.options.errorMessage ?? undefined;
1141
+ this.successMessage ??= this.options.successMessage ?? undefined;
1142
+ if (this.matTooltip && this.options.tooltip) {
1143
+ this.matTooltip.message = this.options.tooltip;
1493
1144
  }
1494
1145
  }
1495
1146
  }
1496
- getViewValue() {
1497
- return (this.options.find((option) => option.value === this.value)?.viewValue ??
1498
- this.defaultViewValue);
1147
+ /**
1148
+ * Disables the action. If the button is pressed the action is NOT executed
1149
+ *
1150
+ * Hint: the button is set to disabled = true to prevent any conflict with
1151
+ * extern button enable features linke : rxapHasEnablePermission
1152
+ * @protected
1153
+ */
1154
+ setButtonDisabled() {
1155
+ this._actionDisabled = true;
1499
1156
  }
1500
- ngOnDestroy() {
1501
- this._subscription?.unsubscribe();
1157
+ /**
1158
+ * Enables the action. If the button is pressed the action is executed
1159
+ *
1160
+ * TODO : find a way to communicate the disabled state between the features
1161
+ * Hint: the button is set to disabled = false to prevent any conflict with
1162
+ * extern button enable features linke : rxapHasEnablePermission
1163
+ * @protected
1164
+ */
1165
+ setButtonEnabled() {
1166
+ this._actionDisabled = false;
1502
1167
  }
1503
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsCellComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
1504
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: OptionsCellComponent, isStandalone: true, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], usesOnChanges: true, ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1168
+ setStatus(status) {
1169
+ if (this._currentStatus === status) {
1170
+ return;
1171
+ }
1172
+ this._currentStatus = status;
1173
+ switch (status) {
1174
+ case TableHeaderButtonActionStatus.EXECUTING:
1175
+ this.setButtonDisabled();
1176
+ break;
1177
+ case TableHeaderButtonActionStatus.SUCCESS:
1178
+ if (this.refresh) {
1179
+ this.tableDataSourceDirective.refresh();
1180
+ }
1181
+ if (this.successMessage) {
1182
+ this.snackBar.open(this.successMessage, 'ok', { duration: 2560 });
1183
+ }
1184
+ this.setStatus(TableHeaderButtonActionStatus.DONE);
1185
+ break;
1186
+ case TableHeaderButtonActionStatus.ERROR:
1187
+ this.setStatus(TableHeaderButtonActionStatus.DONE);
1188
+ if (this.errorMessage) {
1189
+ this.snackBar.open(this.errorMessage, 'ok', { duration: 5120 });
1190
+ }
1191
+ break;
1192
+ case TableHeaderButtonActionStatus.DONE:
1193
+ this.setButtonEnabled();
1194
+ break;
1195
+ }
1196
+ this.cdr.detectChanges();
1197
+ }
1198
+ getTableHeaderButtonOptions() {
1199
+ return GetTableHeaderButtonMetadata(this.method);
1200
+ }
1201
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableHeaderButtonDirective, deps: [{ token: Overlay }, { token: ElementRef }, { token: TABLE_HEADER_BUTTON_METHOD }, { token: MatSnackBar }, { token: MatTooltip, optional: true }, { token: MatMiniFabButton, optional: true }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1202
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableHeaderButtonDirective, isStandalone: true, selector: "button[mat-mini-fab][rxapTableHeaderButton]", inputs: { tableDataSourceDirective: ["rxapTableHeaderButton", "tableDataSourceDirective"], errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"] }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick($event)" } }, usesInheritance: true, ngImport: i0 }); }
1505
1203
  }
1506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsCellComponent, decorators: [{
1507
- type: Component,
1508
- args: [{ selector: 'td[rxap-options-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "{{viewValue}}\n<ng-content></ng-content>\n" }]
1509
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { value: [{
1510
- type: Input,
1511
- args: ['rxap-options-cell']
1512
- }], defaultViewValue: [{
1204
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableHeaderButtonDirective, decorators: [{
1205
+ type: Directive,
1206
+ args: [{
1207
+ selector: 'button[mat-mini-fab][rxapTableHeaderButton]',
1208
+ standalone: true,
1209
+ }]
1210
+ }], ctorParameters: function () { return [{ type: i1$1.Overlay, decorators: [{
1211
+ type: Inject,
1212
+ args: [Overlay]
1213
+ }] }, { type: i0.ElementRef, decorators: [{
1214
+ type: Inject,
1215
+ args: [ElementRef]
1216
+ }] }, { type: undefined, decorators: [{
1217
+ type: Inject,
1218
+ args: [TABLE_HEADER_BUTTON_METHOD]
1219
+ }] }, { type: i3$1.MatSnackBar, decorators: [{
1220
+ type: Inject,
1221
+ args: [MatSnackBar]
1222
+ }] }, { type: i5.MatTooltip, decorators: [{
1223
+ type: Optional
1224
+ }, {
1225
+ type: Inject,
1226
+ args: [MatTooltip]
1227
+ }] }, { type: i4.MatMiniFabButton, decorators: [{
1228
+ type: Optional
1229
+ }, {
1230
+ type: Inject,
1231
+ args: [MatMiniFabButton]
1232
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
1233
+ type: Inject,
1234
+ args: [ChangeDetectorRef]
1235
+ }] }]; }, propDecorators: { tableDataSourceDirective: [{
1513
1236
  type: Input,
1514
- args: ['default']
1515
- }], emptyViewValue: [{
1237
+ args: [{
1238
+ required: true,
1239
+ alias: 'rxapTableHeaderButton',
1240
+ }]
1241
+ }], errorMessage: [{
1242
+ type: Input
1243
+ }], successMessage: [{
1244
+ type: Input
1245
+ }], refresh: [{
1246
+ type: Input
1247
+ }], hasConfirmDirective: [{
1516
1248
  type: Input,
1517
- args: ['empty']
1518
- }], options: [{
1519
- type: ContentChildren,
1520
- args: [MatOption, { descendants: true }]
1249
+ args: ['rxapConfirm']
1250
+ }], onConfirmed: [{
1251
+ type: HostListener,
1252
+ args: ['confirmed']
1253
+ }], onClick: [{
1254
+ type: HostListener,
1255
+ args: ['click', ['$event']]
1521
1256
  }] } });
1522
1257
 
1523
- class BooleanCellComponent {
1524
- constructor() {
1525
- this.value = null;
1526
- }
1527
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BooleanCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1528
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: BooleanCellComponent, isStandalone: true, selector: "td[rxap-boolean-cell]", inputs: { value: ["rxap-boolean-cell", "value"] }, host: { classAttribute: "rxap-boolean-cell" }, ngImport: i0, template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1529
- }
1530
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BooleanCellComponent, decorators: [{
1531
- type: Component,
1532
- args: [{ selector: 'td[rxap-boolean-cell]', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-boolean-cell' }, standalone: true, imports: [NgIf, MatIconModule], template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n" }]
1533
- }], propDecorators: { value: [{
1534
- type: Input,
1535
- args: ['rxap-boolean-cell']
1536
- }] } });
1258
+ const RXAP_TABLE_FILTER_FORM_DEFINITION = new InjectionToken('rxap/form-table-system/filter-form-definition');
1537
1259
 
1538
- /**
1539
- * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
1540
- */
1541
- const RXAP_TABLE_ACTION_METHOD_TYPE_METADATA = 'rxap-table-action-method-type-metadata';
1542
- const RXAP_TABLE_ACTION_METHOD_METADATA = 'rxap-table-action-method-metadata';
1543
- /**
1544
- * @deprecated use RXAP_TABLE_ACTION_METHOD_METADATA instead
1545
- */
1546
- const RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA = 'rxap-table-action-method-check-function-metadata';
1547
- function TableActionMethod(typeOrOptions, checkFunction) {
1548
- let type;
1549
- let options;
1550
- if (typeof typeOrOptions === 'string') {
1551
- type = typeOrOptions;
1552
- options = {
1553
- type,
1554
- checkFunction,
1555
- };
1556
- }
1557
- else {
1558
- options = typeOrOptions;
1559
- type = options.type;
1560
- checkFunction = options.checkFunction;
1561
- }
1562
- return function (target) {
1563
- setMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, options, target);
1564
- if (type) {
1565
- setMetadata(RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, type, target);
1566
- }
1567
- if (checkFunction) {
1568
- setMetadata(RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, checkFunction, target);
1260
+ class FilterHeaderRowDirective extends FormDirective {
1261
+ set useFormDefinition(value) {
1262
+ if (value) {
1263
+ this._formDefinition = value;
1264
+ this.form = value.rxapFormGroup;
1569
1265
  }
1570
- };
1571
- }
1572
-
1573
- class TableRowActionExecutingDirective {
1574
- constructor(templateRef, vcr) {
1575
- this.templateRef = templateRef;
1576
- this.vcr = vcr;
1577
1266
  }
1578
- show() {
1579
- this.vcr.createEmbeddedView(this.templateRef);
1267
+ constructor(tableFilter, cdr, formDefinition) {
1268
+ super(cdr, formDefinition);
1269
+ this.tableFilter = tableFilter;
1580
1270
  }
1581
- hide() {
1582
- this.vcr.clear();
1271
+ ngOnInit() {
1272
+ super.ngOnInit();
1273
+ this._subscription = this.form.value$
1274
+ .pipe(debounceTime(1000), distinctUntilChanged((a, b) => equals(a, b)), tap(values => this.tableFilter.setMap(values)))
1275
+ .subscribe();
1583
1276
  }
1584
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionExecutingDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1585
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowActionExecutingDirective, isStandalone: true, selector: "[rxapTableRowActionExecuting]", ngImport: i0 }); }
1277
+ ngOnDestroy() {
1278
+ super.ngOnDestroy();
1279
+ this._subscription?.unsubscribe();
1280
+ }
1281
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FilterHeaderRowDirective, deps: [{ token: TableFilterService }, { token: i0.ChangeDetectorRef }, { token: RXAP_TABLE_FILTER_FORM_DEFINITION, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1282
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: FilterHeaderRowDirective, isStandalone: true, selector: "table[rxap-filter-header-row]", inputs: { useFormDefinition: ["rxap-filter-header-row", "useFormDefinition"] }, providers: [
1283
+ {
1284
+ provide: ControlContainer,
1285
+ // ignore coverage
1286
+ useExisting: forwardRef(() => FilterHeaderRowDirective),
1287
+ },
1288
+ ], usesInheritance: true, ngImport: i0 }); }
1586
1289
  }
1587
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionExecutingDirective, decorators: [{
1290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: FilterHeaderRowDirective, decorators: [{
1588
1291
  type: Directive,
1589
1292
  args: [{
1590
- selector: '[rxapTableRowActionExecuting]',
1293
+ // eslint-disable-next-line @angular-eslint/directive-selector
1294
+ selector: 'table[rxap-filter-header-row]',
1295
+ providers: [
1296
+ {
1297
+ provide: ControlContainer,
1298
+ // ignore coverage
1299
+ useExisting: forwardRef(() => FilterHeaderRowDirective),
1300
+ },
1301
+ ],
1591
1302
  standalone: true,
1592
1303
  }]
1593
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }]; } });
1594
-
1595
- var TableRowActionStatus;
1596
- (function (TableRowActionStatus) {
1597
- TableRowActionStatus["EXECUTING"] = "executing";
1598
- TableRowActionStatus["DONE"] = "done";
1599
- TableRowActionStatus["ERROR"] = "error";
1600
- TableRowActionStatus["SUCCESS"] = "success";
1601
- })(TableRowActionStatus || (TableRowActionStatus = {}));
1304
+ }], ctorParameters: function () { return [{ type: TableFilterService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
1305
+ type: Optional
1306
+ }, {
1307
+ type: Inject,
1308
+ args: [RXAP_TABLE_FILTER_FORM_DEFINITION]
1309
+ }] }]; }, propDecorators: { useFormDefinition: [{
1310
+ type: Input,
1311
+ args: ['rxap-filter-header-row']
1312
+ }] } });
1602
1313
 
1603
- function IsTableRowActionTypeSwitchMethod(method) {
1604
- return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === undefined;
1605
- }
1606
- function IsTableRowActionTypeMethod(type) {
1607
- return (method) => {
1608
- return (getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.type === type);
1609
- };
1610
- }
1611
- function HasTableRowActionCheckFunction(method) {
1612
- return getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction !== undefined;
1613
- }
1614
- function GetTableRowActionCheckFunction(method) {
1615
- const checkFunction = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor)?.checkFunction;
1616
- if (!checkFunction) {
1617
- throw new Error(`Extracted check function from '${method.constructor.name}' is empty`);
1314
+ class ToFilterColumnNamesPipe {
1315
+ transform(columns) {
1316
+ return columns.map(column => 'filter_' + column);
1618
1317
  }
1619
- return checkFunction;
1620
- }
1621
- function HasTableRowActionMetadata(method) {
1622
- return hasMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
1318
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1319
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, isStandalone: true, name: "toFilterColumnNames" }); }
1623
1320
  }
1624
- function GetTableRowActionMetadata(method) {
1625
- const metadata = getMetadata(RXAP_TABLE_ACTION_METHOD_METADATA, method.constructor);
1626
- if (!metadata) {
1627
- throw new Error(`Extracted metadata from '${method.constructor.name}' is empty`);
1628
- }
1629
- return metadata;
1321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ToFilterColumnNamesPipe, decorators: [{
1322
+ type: Pipe,
1323
+ args: [{
1324
+ name: 'toFilterColumnNames',
1325
+ standalone: true,
1326
+ }]
1327
+ }] });
1328
+
1329
+ class TableFilterModule {
1330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1331
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: TableFilterModule, imports: [ToFilterColumnNamesPipe,
1332
+ FilterHeaderRowDirective], exports: [ToFilterColumnNamesPipe,
1333
+ FilterHeaderRowDirective] }); }
1334
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableFilterModule }); }
1630
1335
  }
1336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableFilterModule, decorators: [{
1337
+ type: NgModule,
1338
+ args: [{
1339
+ exports: [
1340
+ ToFilterColumnNamesPipe,
1341
+ FilterHeaderRowDirective,
1342
+ ],
1343
+ imports: [
1344
+ ToFilterColumnNamesPipe,
1345
+ FilterHeaderRowDirective,
1346
+ ],
1347
+ }]
1348
+ }] });
1631
1349
 
1632
- const RXAP_TABLE_ROW_ACTION_METHOD = new InjectionToken('rxap-table-row-action-method');
1350
+ const TABLE_CREATE_REMOTE_METHOD = new InjectionToken('table-create-remote-method');
1633
1351
 
1634
- class TableRowActionDirective extends ConfirmDirective {
1635
- // eslint-disable-next-line @angular-eslint/no-input-rename
1636
- set hasConfirmDirective(value) {
1637
- this._hasConfirmDirective = coerceBoolean(value);
1638
- }
1639
- constructor(overlay, elementRef, actionMethodList, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip) {
1640
- super(overlay, elementRef);
1641
- this.cdr = cdr;
1642
- this.vcr = vcr;
1643
- this.tableDataSourceDirective = tableDataSourceDirective;
1644
- this.snackBar = snackBar;
1645
- this.matButton = matButton;
1646
- this.matTooltip = matTooltip;
1647
- this._hasConfirmDirective = false;
1648
- this._currentStatus = TableRowActionStatus.DONE;
1649
- this._actionDisabled = false;
1650
- this.options = null;
1651
- this.actionMethodList = coerceArray(actionMethodList);
1352
+ class TableCreateButtonDirective {
1353
+ constructor(method, elementRef, renderer) {
1354
+ this.method = method;
1355
+ this.elementRef = elementRef;
1356
+ this.renderer = renderer;
1652
1357
  }
1653
1358
  ngOnInit() {
1654
- this.options = this.getTableActionOptions();
1655
- if (this.options) {
1656
- this.refresh ??= this.options.refresh ?? false;
1657
- this.errorMessage ??= this.options.errorMessage ?? undefined;
1658
- this.successMessage ??= this.options.successMessage ?? undefined;
1659
- if (this.matTooltip && this.options.tooltip) {
1660
- this.matTooltip.message = this.options.tooltip;
1661
- }
1662
- }
1663
- }
1664
- onConfirmed() {
1665
- return this.execute();
1359
+ this.renderer.setStyle(this.elementRef.nativeElement, 'margin-bottom', '6px');
1666
1360
  }
1667
- onClick($event) {
1668
- $event.stopPropagation();
1669
- if (!this._hasConfirmDirective && !this.options?.confirm) {
1670
- return this.execute();
1671
- }
1672
- else if (this.options?.confirm) {
1673
- this.openConfirmOverly();
1674
- }
1675
- else {
1676
- if (isDevMode()) {
1677
- console.debug('skip remote method call. Wait for confirmation.');
1678
- }
1361
+ ngOnDestroy() {
1362
+ if (this._createObservable instanceof Subject) {
1363
+ this._createObservable.complete();
1679
1364
  }
1680
- return Promise.resolve();
1681
1365
  }
1682
- async execute() {
1683
- if (this._actionDisabled) {
1684
- return Promise.resolve();
1685
- }
1686
- this.setStatus(TableRowActionStatus.EXECUTING);
1687
- try {
1688
- await Promise.all(this.getElementList().map((element) => {
1689
- return Promise.all([
1690
- Promise.all(this.findUntypedActionMethod().map((am) => am.call({
1691
- element,
1692
- type: this.type,
1693
- }))),
1694
- Promise.all(this.findTypedActionMethod().map((am) => am.call(element))),
1695
- ]);
1696
- }));
1697
- this.setStatus(TableRowActionStatus.SUCCESS);
1698
- }
1699
- catch (e) {
1700
- console.error(`Failed to execute row action: ${e.message}`);
1701
- this.setStatus(TableRowActionStatus.ERROR);
1366
+ async onClick() {
1367
+ const result = this._createObservable = await this.method.call();
1368
+ if (isObservable(result)) {
1369
+ await result.toPromise();
1702
1370
  }
1371
+ this.dataSource.refresh();
1703
1372
  }
1704
- getElementList() {
1705
- return [this.element];
1706
- }
1373
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableCreateButtonDirective, deps: [{ token: TABLE_CREATE_REMOTE_METHOD }, { token: ElementRef }, { token: Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1374
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableCreateButtonDirective, isStandalone: true, selector: "button[rxapTableCreate]", inputs: { dataSource: ["rxapTableCreate", "dataSource"] }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
1375
+ }
1376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableCreateButtonDirective, decorators: [{
1377
+ type: Directive,
1378
+ args: [{
1379
+ selector: 'button[rxapTableCreate]',
1380
+ standalone: true,
1381
+ }]
1382
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1383
+ type: Inject,
1384
+ args: [TABLE_CREATE_REMOTE_METHOD]
1385
+ }] }, { type: i0.ElementRef, decorators: [{
1386
+ type: Inject,
1387
+ args: [ElementRef]
1388
+ }] }, { type: i0.Renderer2, decorators: [{
1389
+ type: Inject,
1390
+ args: [Renderer2]
1391
+ }] }]; }, propDecorators: { dataSource: [{
1392
+ type: Input,
1393
+ args: [{
1394
+ required: true,
1395
+ alias: 'rxapTableCreate',
1396
+ }]
1397
+ }], onClick: [{
1398
+ type: HostListener,
1399
+ args: ['click']
1400
+ }] } });
1401
+
1402
+ class TableColumnOptionComponent {
1707
1403
  /**
1708
- * find all method instance in the actionMethodList member that
1709
- * do not have a @TableActionMethod decorators
1710
- * @private
1404
+ * The displayed value of the option. It is necessary to show the selected option in the
1405
+ * select's trigger.
1711
1406
  */
1712
- findUntypedActionMethod() {
1713
- return this.actionMethodList.filter(IsTableRowActionTypeSwitchMethod);
1407
+ get display() {
1408
+ return (this._element.nativeElement.textContent || '').trim();
1714
1409
  }
1715
- /**
1716
- * find all method instance in the actionMethodList member that
1717
- * do have a @TableActionMethod decorators with the current type
1718
- * @private
1719
- */
1720
- findTypedActionMethod() {
1721
- return this.actionMethodList.filter(IsTableRowActionTypeMethod(this.type));
1410
+ set inactive(value) {
1411
+ this.active = !coerceBoolean(value);
1722
1412
  }
1723
- /**
1724
- * Disables the action. If the button is pressed the action is NOT executed
1725
- *
1726
- * Hint: the button is set to disabled = true to prevent any conflict with
1727
- * extern button enable features linke : rxapHasEnablePermission
1728
- * @protected
1729
- */
1730
- setButtonDisabled() {
1731
- this._actionDisabled = true;
1413
+ set hidden(value) {
1414
+ this._hidden = coerceBoolean(value);
1732
1415
  }
1733
- /**
1734
- * Enables the action. If the button is pressed the action is executed
1735
- *
1736
- * TODO : find a way to communicate the disabled state between the features
1737
- * Hint: the button is set to disabled = false to prevent any conflict with
1738
- * extern button enable features linke : rxapHasEnablePermission
1739
- * @protected
1740
- */
1741
- setButtonEnabled() {
1742
- this._actionDisabled = false;
1416
+ get hidden() {
1417
+ return this._hidden;
1743
1418
  }
1744
- setStatus(status) {
1745
- if (this._currentStatus === status) {
1746
- return;
1419
+ set show(value) {
1420
+ this._hidden = !value;
1421
+ }
1422
+ get cacheId() {
1423
+ return this.router.url + '--' + this.name;
1424
+ }
1425
+ constructor(_element, router) {
1426
+ this._element = _element;
1427
+ this.router = router;
1428
+ this.active = true;
1429
+ this._hidden = false;
1430
+ }
1431
+ ngOnInit() {
1432
+ const cachedValue = localStorage.getItem(this.cacheId);
1433
+ if (cachedValue === 'true') {
1434
+ this.active = true;
1747
1435
  }
1748
- this._currentStatus = status;
1749
- switch (status) {
1750
- case TableRowActionStatus.EXECUTING:
1751
- this.setButtonDisabled();
1752
- this.executingDirective?.show();
1753
- break;
1754
- case TableRowActionStatus.SUCCESS:
1755
- if (this.refresh) {
1756
- this.tableDataSourceDirective.refresh();
1757
- }
1758
- if (this.successMessage) {
1759
- this.snackBar.open(this.successMessage, 'ok', { duration: 2560 });
1760
- }
1761
- this.setStatus(TableRowActionStatus.DONE);
1762
- break;
1763
- case TableRowActionStatus.ERROR:
1764
- this.setStatus(TableRowActionStatus.DONE);
1765
- if (this.errorMessage) {
1766
- this.snackBar.open(this.errorMessage, 'ok', { duration: 5120 });
1767
- }
1768
- break;
1769
- case TableRowActionStatus.DONE:
1770
- this.setButtonEnabled();
1771
- this.executingDirective?.hide();
1772
- break;
1436
+ if (cachedValue === 'false') {
1437
+ this.active = false;
1773
1438
  }
1774
- this.cdr.detectChanges();
1775
1439
  }
1776
- getTableActionOptions() {
1777
- const metadataList = this.actionMethodList.map(actionMethod => GetTableRowActionMetadata(actionMethod));
1778
- if (metadataList.length === 0) {
1779
- return null;
1780
- }
1781
- return metadataList.filter(metadata => metadata.type === this.type)
1782
- .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0))[0];
1440
+ toggle() {
1441
+ this.active = !this.active;
1442
+ localStorage.setItem(this.cacheId, this.active ? 'true' : 'false');
1783
1443
  }
1784
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionDirective, deps: [{ token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatButton, optional: true }, { token: MatTooltip, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1785
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowActionDirective, isStandalone: true, selector: "button[rxapTableRowAction]", inputs: { hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"], element: "element", type: ["rxapTableRowAction", "type"], errorMessage: "errorMessage", successMessage: "successMessage", refresh: "refresh" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick($event)" } }, queries: [{ propertyName: "executingDirective", first: true, predicate: TableRowActionExecutingDirective, descendants: true }], usesInheritance: true, ngImport: i0 }); }
1444
+ activate() {
1445
+ this.active = true;
1446
+ localStorage.setItem(this.cacheId, 'true');
1447
+ }
1448
+ deactivate() {
1449
+ this.active = false;
1450
+ localStorage.setItem(this.cacheId, 'false');
1451
+ }
1452
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnOptionComponent, deps: [{ token: ElementRef }, { token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1453
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableColumnOptionComponent, isStandalone: true, selector: "rxap-table-column-option", inputs: { name: "name", active: "active", inactive: "inactive", hidden: "hidden", show: "show" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] }); }
1786
1454
  }
1787
- __decorate([
1788
- Required,
1789
- __metadata("design:type", Object)
1790
- ], TableRowActionDirective.prototype, "element", void 0);
1791
- __decorate([
1792
- Required,
1793
- __metadata("design:type", String)
1794
- ], TableRowActionDirective.prototype, "type", void 0);
1795
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowActionDirective, decorators: [{
1796
- type: Directive,
1797
- args: [{
1798
- selector: 'button[rxapTableRowAction]',
1799
- standalone: true,
1800
- }]
1801
- }], ctorParameters: function () { return [{ type: i1$4.Overlay, decorators: [{
1802
- type: Inject,
1803
- args: [Overlay]
1804
- }] }, { type: i0.ElementRef, decorators: [{
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnOptionComponent, decorators: [{
1456
+ type: Component,
1457
+ args: [{ selector: 'rxap-table-column-option', standalone: true, template: "<ng-content></ng-content>\n" }]
1458
+ }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
1805
1459
  type: Inject,
1806
1460
  args: [ElementRef]
1807
- }] }, { type: undefined, decorators: [{
1808
- type: Inject,
1809
- args: [RXAP_TABLE_ROW_ACTION_METHOD]
1810
- }] }, { type: i0.ChangeDetectorRef, decorators: [{
1811
- type: Inject,
1812
- args: [ChangeDetectorRef]
1813
- }] }, { type: i0.ViewContainerRef, decorators: [{
1814
- type: Inject,
1815
- args: [ViewContainerRef]
1816
- }] }, { type: TableDataSourceDirective, decorators: [{
1817
- type: Inject,
1818
- args: [TableDataSourceDirective]
1819
- }] }, { type: i3$3.MatSnackBar, decorators: [{
1820
- type: Inject,
1821
- args: [MatSnackBar]
1822
- }] }, { type: i3.MatButton, decorators: [{
1461
+ }] }, { type: i1$2.Router }]; }, propDecorators: { name: [{
1462
+ type: Input,
1463
+ args: [{ required: true }]
1464
+ }], active: [{
1465
+ type: Input
1466
+ }], inactive: [{
1467
+ type: Input
1468
+ }], hidden: [{
1469
+ type: Input
1470
+ }], show: [{
1471
+ type: Input
1472
+ }] } });
1473
+
1474
+ class TableColumnMenuComponent {
1475
+ constructor() {
1476
+ this.displayColumns = [];
1477
+ this._inline = false;
1478
+ this._matCardMode = false;
1479
+ }
1480
+ get inline() {
1481
+ return this._inline;
1482
+ }
1483
+ /**
1484
+ * true - the menu is displayed inline and not absolute
1485
+ * @param value
1486
+ */
1487
+ set inline(value) {
1488
+ this._inline = coerceBoolean(value);
1489
+ }
1490
+ set matCard(value) {
1491
+ this._matCardMode = coerceBoolean(value);
1492
+ }
1493
+ ngAfterContentInit() {
1494
+ this.updateDisplayColumns();
1495
+ }
1496
+ updateDisplayColumns() {
1497
+ if (!this.columns) {
1498
+ throw new Error('Could not query content children of TableColumnOptionComponent');
1499
+ }
1500
+ this.displayColumns = this.columns
1501
+ .filter((option) => option.active)
1502
+ .map((option) => option.name);
1503
+ }
1504
+ activate(columnName) {
1505
+ this.columns
1506
+ ?.filter((option) => option.name === columnName)
1507
+ .forEach((column) => column.activate());
1508
+ this.updateDisplayColumns();
1509
+ }
1510
+ deactivate(columnName) {
1511
+ this.columns
1512
+ ?.filter((option) => option.name === columnName)
1513
+ .forEach((column) => column.deactivate());
1514
+ this.updateDisplayColumns();
1515
+ }
1516
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1517
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableColumnMenuComponent, isStandalone: true, selector: "rxap-table-column-menu", inputs: { inline: "inline", matCard: "matCard" }, host: { properties: { "class.inline": "this._inline", "class.mat-card-mode": "this._matCardMode" } }, queries: [{ propertyName: "columns", predicate: TableColumnOptionComponent }], exportAs: ["rxapTableColumns"], ngImport: i0, template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n <span\n *ngFor=\"let column of columns\"\n [disableRipple]=\"true\"\n [fxHide]=\"column.hidden\"\n mat-menu-item\n rxapStopPropagation\n >\n <mat-checkbox\n (change)=\"column.toggle(); updateDisplayColumns()\"\n [checked]=\"column.active\">\n {{ column.display }}\n </mat-checkbox>\n </span>\n <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode:not(.inline){position:absolute;inset:8px 8px auto auto}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2$2.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i2$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: ExtendedModule }, { kind: "directive", type: i4$1.DefaultShowHideDirective, selector: " [fxShow], [fxShow.print], [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl], [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl], [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg], [fxHide], [fxHide.print], [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl], [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl], [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]", inputs: ["fxShow", "fxShow.print", "fxShow.xs", "fxShow.sm", "fxShow.md", "fxShow.lg", "fxShow.xl", "fxShow.lt-sm", "fxShow.lt-md", "fxShow.lt-lg", "fxShow.lt-xl", "fxShow.gt-xs", "fxShow.gt-sm", "fxShow.gt-md", "fxShow.gt-lg", "fxHide", "fxHide.print", "fxHide.xs", "fxHide.sm", "fxHide.md", "fxHide.lg", "fxHide.xl", "fxHide.lt-sm", "fxHide.lt-md", "fxHide.lt-lg", "fxHide.lt-xl", "fxHide.gt-xs", "fxHide.gt-sm", "fxHide.gt-md", "fxHide.gt-lg"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1518
+ }
1519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuComponent, decorators: [{
1520
+ type: Component,
1521
+ args: [{ selector: 'rxap-table-column-menu', changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'rxapTableColumns', standalone: true, imports: [
1522
+ MatButtonModule,
1523
+ MatMenuModule,
1524
+ MatIconModule,
1525
+ NgFor,
1526
+ StopPropagationDirective,
1527
+ ExtendedModule,
1528
+ MatCheckboxModule,
1529
+ ], template: "<button [matMenuTriggerFor]=\"columnMenu\" mat-icon-button type=\"button\">\n <mat-icon>tune</mat-icon>\n</button>\n\n<mat-menu #columnMenu=\"matMenu\">\n <span\n *ngFor=\"let column of columns\"\n [disableRipple]=\"true\"\n [fxHide]=\"column.hidden\"\n mat-menu-item\n rxapStopPropagation\n >\n <mat-checkbox\n (change)=\"column.toggle(); updateDisplayColumns()\"\n [checked]=\"column.active\">\n {{ column.display }}\n </mat-checkbox>\n </span>\n <ng-content select=\"[mat-menu-item],mat-divider\"></ng-content>\n</mat-menu>\n", styles: [":host.mat-card-mode:not(.inline){position:absolute;inset:8px 8px auto auto}\n"] }]
1530
+ }], propDecorators: { columns: [{
1531
+ type: ContentChildren,
1532
+ args: [TableColumnOptionComponent]
1533
+ }], _inline: [{
1534
+ type: HostBinding,
1535
+ args: ['class.inline']
1536
+ }], inline: [{
1537
+ type: Input
1538
+ }], matCard: [{
1539
+ type: Input
1540
+ }], _matCardMode: [{
1541
+ type: HostBinding,
1542
+ args: ['class.mat-card-mode']
1543
+ }] } });
1544
+
1545
+ class TableShowArchivedSlideComponent {
1546
+ constructor(tableFilter, tableColumnMenu) {
1547
+ this.tableFilter = tableFilter;
1548
+ this.tableColumnMenu = tableColumnMenu;
1549
+ }
1550
+ onChange($event) {
1551
+ this.paginator?.firstPage();
1552
+ this.tableFilter?.set('__archived', $event.checked);
1553
+ if ($event.checked) {
1554
+ this.tableColumnMenu.activate('removedAt');
1555
+ this.tableColumnMenu.activate('__--removed-at');
1556
+ this.tableColumnMenu.activate('removed-at');
1557
+ this.tableColumnMenu.activate('__removed-at');
1558
+ }
1559
+ else {
1560
+ this.tableColumnMenu.deactivate('removedAt');
1561
+ this.tableColumnMenu.deactivate('__--removed-at');
1562
+ this.tableColumnMenu.deactivate('removed-at');
1563
+ this.tableColumnMenu.deactivate('__removed-at');
1564
+ }
1565
+ }
1566
+ ngAfterViewInit() {
1567
+ this.tableColumnMenu.deactivate('removedAt');
1568
+ this.tableColumnMenu.deactivate('__--removed-at');
1569
+ this.tableColumnMenu.deactivate('removed-at');
1570
+ this.tableColumnMenu.deactivate('__removed-at');
1571
+ }
1572
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableShowArchivedSlideComponent, deps: [{ token: TableFilterService, optional: true }, { token: TableColumnMenuComponent }], target: i0.ɵɵFactoryTarget.Component }); }
1573
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TableShowArchivedSlideComponent, isStandalone: true, selector: "rxap-table-show-archived-slide", inputs: { paginator: "paginator" }, ngImport: i0, template: "<div class=\"m-6\" rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <span class=\"mx-2 whitespace-nowrap\" i18n>Show archived documents</span>\n </mat-slide-toggle>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: StopPropagationDirective, selector: "[rxapStopPropagation]" }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i1$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1574
+ }
1575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableShowArchivedSlideComponent, decorators: [{
1576
+ type: Component,
1577
+ args: [{ selector: 'rxap-table-show-archived-slide', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [StopPropagationDirective, MatSlideToggleModule], template: "<div class=\"m-6\" rxapStopPropagation>\n <mat-slide-toggle (change)=\"onChange($event)\">\n <span class=\"mx-2 whitespace-nowrap\" i18n>Show archived documents</span>\n </mat-slide-toggle>\n</div>\n" }]
1578
+ }], ctorParameters: function () { return [{ type: TableFilterService, decorators: [{
1823
1579
  type: Optional
1824
1580
  }, {
1825
1581
  type: Inject,
1826
- args: [MatButton]
1827
- }] }, { type: i4$1.MatTooltip, decorators: [{
1828
- type: Optional
1829
- }, {
1582
+ args: [TableFilterService]
1583
+ }] }, { type: TableColumnMenuComponent, decorators: [{
1830
1584
  type: Inject,
1831
- args: [MatTooltip]
1832
- }] }]; }, propDecorators: { hasConfirmDirective: [{
1585
+ args: [TableColumnMenuComponent]
1586
+ }] }]; }, propDecorators: { paginator: [{
1587
+ type: Input
1588
+ }] } });
1589
+
1590
+ class TableColumnMenuModule {
1591
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1592
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuModule, imports: [TableColumnMenuComponent,
1593
+ TableShowArchivedSlideComponent,
1594
+ TableColumnOptionComponent], exports: [TableColumnMenuComponent,
1595
+ TableShowArchivedSlideComponent,
1596
+ TableColumnOptionComponent] }); }
1597
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuModule, imports: [TableColumnMenuComponent,
1598
+ TableShowArchivedSlideComponent] }); }
1599
+ }
1600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableColumnMenuModule, decorators: [{
1601
+ type: NgModule,
1602
+ args: [{
1603
+ imports: [
1604
+ TableColumnMenuComponent,
1605
+ TableShowArchivedSlideComponent,
1606
+ TableColumnOptionComponent,
1607
+ ],
1608
+ exports: [
1609
+ TableColumnMenuComponent,
1610
+ TableShowArchivedSlideComponent,
1611
+ TableColumnOptionComponent,
1612
+ ],
1613
+ }]
1614
+ }] });
1615
+
1616
+ class CheckboxHeaderCellComponent {
1617
+ constructor(cdkTable, selectRow) {
1618
+ this.cdkTable = cdkTable;
1619
+ this.selectRow = selectRow;
1620
+ this.indeterminate$ = EMPTY;
1621
+ this.checked$ = EMPTY;
1622
+ this.isMultipleSelection = false;
1623
+ this.isMultipleSelection =
1624
+ this.selectRow.selectionModel.isMultipleSelection();
1625
+ }
1626
+ ngOnInit() {
1627
+ this.indeterminate$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
1628
+ this.cdkTable['_data'].length !== selectedRows.length));
1629
+ this.checked$ = this.selectRow.selectedRows$.pipe(map((selectedRows) => !!selectedRows.length &&
1630
+ this.cdkTable['_data'].length === selectedRows.length));
1631
+ }
1632
+ onChange($event) {
1633
+ if ($event.checked) {
1634
+ this.selectRow.selectionModel.select(...this.cdkTable['_data']);
1635
+ }
1636
+ else {
1637
+ this.selectRow.selectionModel.clear();
1638
+ }
1639
+ }
1640
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxHeaderCellComponent, deps: [{ token: CdkTable }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
1641
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CheckboxHeaderCellComponent, isStandalone: true, selector: "th[rxap-checkbox-header-cell]", ngImport: i0, template: "<mat-checkbox\n (change)=\"onChange($event)\"\n *ngIf=\"isMultipleSelection\"\n [checked]=\"(checked$ | async) ?? false\"\n [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1642
+ }
1643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxHeaderCellComponent, decorators: [{
1644
+ type: Component,
1645
+ args: [{ selector: 'th[rxap-checkbox-header-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1646
+ NgIf,
1647
+ MatCheckboxModule,
1648
+ AsyncPipe,
1649
+ ], template: "<mat-checkbox\n (change)=\"onChange($event)\"\n *ngIf=\"isMultipleSelection\"\n [checked]=\"(checked$ | async) ?? false\"\n [indeterminate]=\"indeterminate$ | async\">\n</mat-checkbox>\n" }]
1650
+ }], ctorParameters: function () { return [{ type: i1.CdkTable, decorators: [{
1651
+ type: Inject,
1652
+ args: [CdkTable]
1653
+ }] }, { type: SelectRowService }]; } });
1654
+
1655
+ class CheckboxCellComponent {
1656
+ constructor(selectRow) {
1657
+ this.selectRow = selectRow;
1658
+ }
1659
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxCellComponent, deps: [{ token: SelectRowService }], target: i0.ɵɵFactoryTarget.Component }); }
1660
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CheckboxCellComponent, isStandalone: true, selector: "td[rxap-checkbox-cell]", inputs: { element: "element" }, ngImport: i0, template: "<mat-checkbox\n (change)=\"selectRow.selectionModel.toggle(element)\"\n [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i5$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
1661
+ }
1662
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CheckboxCellComponent, decorators: [{
1663
+ type: Component,
1664
+ args: [{ selector: 'td[rxap-checkbox-cell]', changeDetection: ChangeDetectionStrategy.Default, standalone: true, imports: [MatCheckboxModule], template: "<mat-checkbox\n (change)=\"selectRow.selectionModel.toggle(element)\"\n [checked]=\"selectRow.selectionModel.isSelected(element)\">\n</mat-checkbox>\n" }]
1665
+ }], ctorParameters: function () { return [{ type: SelectRowService, decorators: [{
1666
+ type: Inject,
1667
+ args: [SelectRowService]
1668
+ }] }]; }, propDecorators: { element: [{
1669
+ type: Input,
1670
+ args: [{ required: true }]
1671
+ }] } });
1672
+
1673
+ class SelectedRowsDirective {
1674
+ constructor(template, viewContainerRef, cdr, selectRowService) {
1675
+ this.template = template;
1676
+ this.viewContainerRef = viewContainerRef;
1677
+ this.cdr = cdr;
1678
+ this.selectRowService = selectRowService;
1679
+ }
1680
+ ngOnDestroy() {
1681
+ this._subscription?.unsubscribe();
1682
+ }
1683
+ ngOnInit() {
1684
+ this._subscription = this.selectRowService.selectedRows$.pipe(distinctUntilChanged(), tap(selectedAllRows => {
1685
+ this.viewContainerRef.clear();
1686
+ if (selectedAllRows) {
1687
+ this.viewContainerRef.createEmbeddedView(this.template, { $implicit: this.selectRowService.selectedRows });
1688
+ }
1689
+ this.cdr.detectChanges();
1690
+ })).subscribe();
1691
+ }
1692
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectedRowsDirective, deps: [{ token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }, { token: SelectRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
1693
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: SelectedRowsDirective, isStandalone: true, selector: "[rxapSelectedRows]", ngImport: i0 }); }
1694
+ }
1695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectedRowsDirective, decorators: [{
1696
+ type: Directive,
1697
+ args: [{
1698
+ selector: '[rxapSelectedRows]',
1699
+ standalone: true,
1700
+ }]
1701
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1702
+ type: Inject,
1703
+ args: [TemplateRef]
1704
+ }] }, { type: i0.ViewContainerRef, decorators: [{
1705
+ type: Inject,
1706
+ args: [ViewContainerRef]
1707
+ }] }, { type: i0.ChangeDetectorRef, decorators: [{
1708
+ type: Inject,
1709
+ args: [ChangeDetectorRef]
1710
+ }] }, { type: SelectRowService, decorators: [{
1711
+ type: Inject,
1712
+ args: [SelectRowService]
1713
+ }] }]; } });
1714
+
1715
+ class SelectRowModule {
1716
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectRowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1717
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: SelectRowModule, imports: [SelectedRowsDirective,
1718
+ CheckboxCellComponent,
1719
+ CheckboxHeaderCellComponent], exports: [CheckboxCellComponent,
1720
+ CheckboxHeaderCellComponent,
1721
+ SelectedRowsDirective] }); }
1722
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectRowModule, imports: [CheckboxCellComponent,
1723
+ CheckboxHeaderCellComponent] }); }
1724
+ }
1725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: SelectRowModule, decorators: [{
1726
+ type: NgModule,
1727
+ args: [{
1728
+ exports: [
1729
+ CheckboxCellComponent,
1730
+ CheckboxHeaderCellComponent,
1731
+ SelectedRowsDirective,
1732
+ ],
1733
+ imports: [
1734
+ SelectedRowsDirective,
1735
+ CheckboxCellComponent,
1736
+ CheckboxHeaderCellComponent,
1737
+ ],
1738
+ }]
1739
+ }] });
1740
+
1741
+ class ExpandRowContentDirective {
1742
+ static ngTemplateContextGuard(dir, ctx) {
1743
+ return true;
1744
+ }
1745
+ constructor(template) {
1746
+ this.template = template;
1747
+ }
1748
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContentDirective, deps: [{ token: TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1749
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowContentDirective, isStandalone: true, selector: "[rxapExpandRowContent]", ngImport: i0 }); }
1750
+ }
1751
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContentDirective, decorators: [{
1752
+ type: Directive,
1753
+ args: [{
1754
+ selector: '[rxapExpandRowContent]',
1755
+ standalone: true,
1756
+ }]
1757
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
1758
+ type: Inject,
1759
+ args: [TemplateRef]
1760
+ }] }]; } });
1761
+
1762
+ class ExpandRowService {
1763
+ constructor() {
1764
+ this.expandedRow = new BehaviorSubject(null);
1765
+ }
1766
+ toggleRow(row) {
1767
+ if (this.expandedRow.value === row) {
1768
+ this.expandedRow.next(null);
1769
+ }
1770
+ else {
1771
+ this.expandedRow.next(row);
1772
+ }
1773
+ }
1774
+ isExpanded(row) {
1775
+ return this.expandedRow.value === row;
1776
+ }
1777
+ isExpanded$(row) {
1778
+ return this.expandedRow.pipe(map((expandedRow) => expandedRow === row));
1779
+ }
1780
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1781
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService }); }
1782
+ }
1783
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowService, decorators: [{
1784
+ type: Injectable
1785
+ }] });
1786
+
1787
+ class ExpandRowContainerComponent {
1788
+ constructor(viewContainerRef, expandCell) {
1789
+ this.viewContainerRef = viewContainerRef;
1790
+ this.expandCell = expandCell;
1791
+ this.portal = null;
1792
+ }
1793
+ ngOnDestroy() {
1794
+ this._subscription?.unsubscribe();
1795
+ }
1796
+ ngAfterContentInit() {
1797
+ if (this.expandCellContent) {
1798
+ this._subscription = this.expandCell.isExpanded$(this.element).pipe(filter(Boolean), tap(() => {
1799
+ if (!this.portal) {
1800
+ this.portal =
1801
+ new TemplatePortal(this.expandCellContent.template, this.viewContainerRef, { $implicit: this.element });
1802
+ }
1803
+ })).subscribe();
1804
+ }
1805
+ }
1806
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContainerComponent, deps: [{ token: ViewContainerRef }, { token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
1807
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowContainerComponent, isStandalone: true, selector: "td[rxap-expand-row]", inputs: { element: "element" }, queries: [{ propertyName: "expandCellContent", first: true, predicate: ExpandRowContentDirective, descendants: true }], ngImport: i0, template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"], dependencies: [{ kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1$4.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], animations: [
1808
+ trigger('detailExpand', [
1809
+ state('collapsed', style({
1810
+ height: '0px',
1811
+ minHeight: '0',
1812
+ })),
1813
+ state('expanded', style({ height: '*' })),
1814
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1815
+ ]),
1816
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1817
+ }
1818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowContainerComponent, decorators: [{
1819
+ type: Component,
1820
+ args: [{ selector: 'td[rxap-expand-row]', changeDetection: ChangeDetectionStrategy.OnPush, animations: [
1821
+ trigger('detailExpand', [
1822
+ state('collapsed', style({
1823
+ height: '0px',
1824
+ minHeight: '0',
1825
+ })),
1826
+ state('expanded', style({ height: '*' })),
1827
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1828
+ ]),
1829
+ ], standalone: true, imports: [PortalModule, AsyncPipe], template: "<div [@detailExpand]=\"(expandCell.isExpanded$(element) | async) ? 'expanded' : 'collapsed'\" class=\"element-detail\">\n <ng-content></ng-content>\n <ng-template [cdkPortalOutlet]=\"portal\"></ng-template>\n</div>\n", styles: [".element-detail{overflow:hidden;display:flex}\n"] }]
1830
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef, decorators: [{
1831
+ type: Inject,
1832
+ args: [ViewContainerRef]
1833
+ }] }, { type: ExpandRowService, decorators: [{
1834
+ type: Inject,
1835
+ args: [ExpandRowService]
1836
+ }] }]; }, propDecorators: { element: [{
1837
+ type: Input,
1838
+ args: [{ required: true }]
1839
+ }], expandCellContent: [{
1840
+ type: ContentChild,
1841
+ args: [ExpandRowContentDirective]
1842
+ }] } });
1843
+
1844
+ class ExpandControlsCellComponent {
1845
+ constructor(expandCell) {
1846
+ this.expandCell = expandCell;
1847
+ }
1848
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandControlsCellComponent, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Component }); }
1849
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ExpandControlsCellComponent, isStandalone: true, selector: "td[rxap-expand-controls-cell]", inputs: { element: "element" }, ngImport: i0, template: "<button type=\"button\" mat-icon-button>\n <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n <ng-template #notExpanded>\n <mat-icon>keyboard_arrow_right</mat-icon>\n </ng-template>\n</button>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1850
+ }
1851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandControlsCellComponent, decorators: [{
1852
+ type: Component,
1853
+ args: [{ selector: 'td[rxap-expand-controls-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButtonModule, NgIf, MatIconModule, AsyncPipe], template: "<button type=\"button\" mat-icon-button>\n <mat-icon *ngIf=\"expandCell.isExpanded$(element) | async; else notExpanded\">expand_more</mat-icon>\n <ng-template #notExpanded>\n <mat-icon>keyboard_arrow_right</mat-icon>\n </ng-template>\n</button>\n" }]
1854
+ }], ctorParameters: function () { return [{ type: ExpandRowService, decorators: [{
1855
+ type: Inject,
1856
+ args: [ExpandRowService]
1857
+ }] }]; }, propDecorators: { element: [{
1858
+ type: Input,
1859
+ args: [{ required: true }]
1860
+ }] } });
1861
+
1862
+ class ExpandRowDirective {
1863
+ get isExpanded() {
1864
+ return this.expandCell.isExpanded(this.element);
1865
+ }
1866
+ constructor(expandCell) {
1867
+ this.expandCell = expandCell;
1868
+ }
1869
+ onClick() {
1870
+ this.expandCell.toggleRow(this.element);
1871
+ }
1872
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowDirective, deps: [{ token: ExpandRowService }], target: i0.ɵɵFactoryTarget.Directive }); }
1873
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: ExpandRowDirective, isStandalone: true, selector: "tr[rxapExpandRow]", inputs: { element: "element" }, host: { listeners: { "expanded-row": "isExpanded()", "click": "onClick()" } }, ngImport: i0 }); }
1874
+ }
1875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowDirective, decorators: [{
1876
+ type: Directive,
1877
+ args: [{
1878
+ selector: 'tr[rxapExpandRow]',
1879
+ standalone: true,
1880
+ }]
1881
+ }], ctorParameters: function () { return [{ type: ExpandRowService, decorators: [{
1882
+ type: Inject,
1883
+ args: [ExpandRowService]
1884
+ }] }]; }, propDecorators: { isExpanded: [{
1885
+ type: HostListener,
1886
+ args: ['expanded-row']
1887
+ }], element: [{
1888
+ type: Input,
1889
+ args: [{ required: true }]
1890
+ }], onClick: [{
1891
+ type: HostListener,
1892
+ args: ['click']
1893
+ }] } });
1894
+
1895
+ class ExpandRowModule {
1896
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1897
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, imports: [ExpandRowDirective], exports: [ExpandRowDirective] }); }
1898
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, providers: [
1899
+ ExpandRowService,
1900
+ ] }); }
1901
+ }
1902
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ExpandRowModule, decorators: [{
1903
+ type: NgModule,
1904
+ args: [{
1905
+ imports: [ExpandRowDirective],
1906
+ exports: [
1907
+ ExpandRowDirective,
1908
+ ],
1909
+ providers: [
1910
+ ExpandRowService,
1911
+ ],
1912
+ }]
1913
+ }] });
1914
+
1915
+ class TreeControlCellComponent {
1916
+ ngOnInit() {
1917
+ this.offset = (this.element.__node.depth * 24) + 'px';
1918
+ this.updateIcon();
1919
+ }
1920
+ ngDoCheck() {
1921
+ this.updateIcon();
1922
+ }
1923
+ toggleExpand() {
1924
+ return this.element.__node.toggleExpand();
1925
+ }
1926
+ updateIcon() {
1927
+ this.icon = this.element.icon;
1928
+ if (this.element.__node.hasChildren) {
1929
+ if (this.element.__node.expanded) {
1930
+ this.expandIcon = 'expand_more';
1931
+ }
1932
+ else {
1933
+ this.expandIcon = 'expand_less';
1934
+ }
1935
+ }
1936
+ else {
1937
+ this.icon ??= { icon: 'subdirectory_arrow_right' };
1938
+ }
1939
+ }
1940
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TreeControlCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1941
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TreeControlCellComponent, isStandalone: true, selector: "rxap-tree-control-cell, td[rxap-tree-control-cell]", inputs: { element: ["rxap-tree-control-cell", "element"] }, ngImport: i0, template: "<div class=\"flex flex-row justify-start items-center\">\n <div [fxFlexOffset]=\"offset\">\n <button type=\"button\" (click)=\"toggleExpand()\" mat-icon-button>\n <mat-icon>{{expandIcon}}</mat-icon>\n </button>\n </div>\n <div *ngIf=\"icon\">\n <mat-icon [rxapIcon]=\"icon\"></mat-icon>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2.DefaultFlexOffsetDirective, selector: " [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md], [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md], [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm], [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]", inputs: ["fxFlexOffset", "fxFlexOffset.xs", "fxFlexOffset.sm", "fxFlexOffset.md", "fxFlexOffset.lg", "fxFlexOffset.xl", "fxFlexOffset.lt-sm", "fxFlexOffset.lt-md", "fxFlexOffset.lt-lg", "fxFlexOffset.lt-xl", "fxFlexOffset.gt-xs", "fxFlexOffset.gt-sm", "fxFlexOffset.gt-md", "fxFlexOffset.gt-lg"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1942
+ }
1943
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TreeControlCellComponent, decorators: [{
1944
+ type: Component,
1945
+ args: [{ selector: 'rxap-tree-control-cell, td[rxap-tree-control-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
1946
+ FlexModule,
1947
+ MatButtonModule,
1948
+ MatIconModule,
1949
+ IconDirective,
1950
+ NgIf,
1951
+ ], template: "<div class=\"flex flex-row justify-start items-center\">\n <div [fxFlexOffset]=\"offset\">\n <button type=\"button\" (click)=\"toggleExpand()\" mat-icon-button>\n <mat-icon>{{expandIcon}}</mat-icon>\n </button>\n </div>\n <div *ngIf=\"icon\">\n <mat-icon [rxapIcon]=\"icon\"></mat-icon>\n </div>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n</div>\n" }]
1952
+ }], propDecorators: { element: [{
1953
+ type: Input,
1954
+ args: ['rxap-tree-control-cell']
1955
+ }] } });
1956
+
1957
+ class OptionsCellComponent {
1958
+ constructor(renderer) {
1959
+ this.renderer = renderer;
1960
+ this._subscription = new Subscription();
1961
+ this._initialised = false;
1962
+ this.defaultViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.unknown:unknown`;
1963
+ this.emptyViewValue = ''; // $localize`:@@rxap-material.table-system.options-cell.empty:empty`;
1964
+ }
1965
+ ngAfterContentInit() {
1966
+ // Hide the mat-option elements
1967
+ this._subscription.add(this.options.changes.pipe(startWith(null), tap(() => this.options.forEach(option => this.renderer.setStyle(option._getHostElement(), 'display', 'none')))).subscribe());
1968
+ this.setViewValue();
1969
+ this._initialised = true;
1970
+ }
1971
+ setViewValue() {
1972
+ if (this.value === undefined || this.value === null) {
1973
+ this.viewValue = this.emptyViewValue;
1974
+ }
1975
+ else {
1976
+ if (this.options) {
1977
+ this._subscription.add(this.options.changes
1978
+ .pipe(startWith(null), tap(() => (this.viewValue = this.getViewValue())))
1979
+ .subscribe());
1980
+ }
1981
+ else if (isDevMode()) {
1982
+ console.log('Could not load any option');
1983
+ }
1984
+ }
1985
+ }
1986
+ ngOnChanges(changes) {
1987
+ if (this._initialised) {
1988
+ if (changes['value']) {
1989
+ this.setViewValue();
1990
+ }
1991
+ }
1992
+ }
1993
+ getViewValue() {
1994
+ return (this.options.find((option) => option.value === this.value)?.viewValue ??
1995
+ this.defaultViewValue);
1996
+ }
1997
+ ngOnDestroy() {
1998
+ this._subscription?.unsubscribe();
1999
+ }
2000
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsCellComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
2001
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: OptionsCellComponent, isStandalone: true, selector: "td[rxap-options-cell]", inputs: { value: ["rxap-options-cell", "value"], defaultViewValue: ["default", "defaultViewValue"], emptyViewValue: ["empty", "emptyViewValue"] }, queries: [{ propertyName: "options", predicate: MatOption, descendants: true }], usesOnChanges: true, ngImport: i0, template: "{{viewValue}}\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2002
+ }
2003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: OptionsCellComponent, decorators: [{
2004
+ type: Component,
2005
+ args: [{ selector: 'td[rxap-options-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "{{viewValue}}\n<ng-content></ng-content>\n" }]
2006
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { value: [{
2007
+ type: Input,
2008
+ args: ['rxap-options-cell']
2009
+ }], defaultViewValue: [{
2010
+ type: Input,
2011
+ args: ['default']
2012
+ }], emptyViewValue: [{
2013
+ type: Input,
2014
+ args: ['empty']
2015
+ }], options: [{
2016
+ type: ContentChildren,
2017
+ args: [MatOption, { descendants: true }]
2018
+ }] } });
2019
+
2020
+ class LinkCellComponent {
2021
+ constructor() {
2022
+ this.short = true;
2023
+ }
2024
+ get href() {
2025
+ if (this.protocol) {
2026
+ return [this.protocol, this.value].join(':');
2027
+ }
2028
+ return this.value;
2029
+ }
2030
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LinkCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2031
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: LinkCellComponent, isStandalone: true, selector: "td[rxap-link-cell]", inputs: { value: ["rxap-link-cell", "value"], protocol: "protocol", short: "short" }, ngImport: i0, template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"8px\">\n <span *ngIf=\"short\" class=\"content\" fxFlex=\"nogrow\" i18n>Open</span>\n <ng-container [ngSwitch]=\"protocol\">\n <mat-icon *ngSwitchCase=\"'tel'\" fxFlex=\"nogrow\">call</mat-icon>\n <mat-icon *ngSwitchCase=\"'mailto'\" fxFlex=\"nogrow\">email</mat-icon>\n <mat-icon *ngSwitchDefault fxFlex=\"nogrow\">launch</mat-icon>\n </ng-container>\n <span *ngIf=\"!short\" class=\"content\" fxFlex=\"nogrow\">{{value}}</span>\n </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i2.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i2.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i2.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2032
+ }
2033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LinkCellComponent, decorators: [{
2034
+ type: Component,
2035
+ args: [{ selector: 'td[rxap-link-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, MatTooltipModule, FlexModule, NgSwitch, NgSwitchCase, MatIconModule, NgSwitchDefault], template: "<a *ngIf=\"value\" [href]=\"href\" [matTooltip]=\"value\" class=\"link\" target=\"_blank\">\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"8px\">\n <span *ngIf=\"short\" class=\"content\" fxFlex=\"nogrow\" i18n>Open</span>\n <ng-container [ngSwitch]=\"protocol\">\n <mat-icon *ngSwitchCase=\"'tel'\" fxFlex=\"nogrow\">call</mat-icon>\n <mat-icon *ngSwitchCase=\"'mailto'\" fxFlex=\"nogrow\">email</mat-icon>\n <mat-icon *ngSwitchDefault fxFlex=\"nogrow\">launch</mat-icon>\n </ng-container>\n <span *ngIf=\"!short\" class=\"content\" fxFlex=\"nogrow\">{{value}}</span>\n </span>\n</a>\n<ng-content></ng-content>\n", styles: [".link{text-decoration:none;color:inherit}.link .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
2036
+ }], propDecorators: { value: [{
1833
2037
  type: Input,
1834
- args: ['rxapConfirm']
1835
- }], element: [{
2038
+ args: ['rxap-link-cell']
2039
+ }], protocol: [{
1836
2040
  type: Input
1837
- }], type: [{
1838
- type: Input,
1839
- args: ['rxapTableRowAction']
1840
- }], errorMessage: [{
2041
+ }], short: [{
1841
2042
  type: Input
1842
- }], successMessage: [{
2043
+ }] } });
2044
+
2045
+ class ImageCellComponent {
2046
+ constructor() {
2047
+ this.size = BackgroundSizeOptions.COVER;
2048
+ this.repeat = BackgroundRepeatOptions.NO_REPEAT;
2049
+ this.position = BackgroundPositionOptions.CENTER_CENTER;
2050
+ this.value = null;
2051
+ }
2052
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2053
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: ImageCellComponent, isStandalone: true, selector: "td[rxap-image-cell]", inputs: { preset: "preset", size: "size", repeat: "repeat", position: "position", value: ["rxap-image-cell", "value"] }, ngImport: i0, template: "<div\n *ngIf=\"value\"\n [ngClass]=\"[preset]\"\n [position]=\"position\"\n [repeat]=\"repeat\"\n [rxapBackgroundImage]=\"value\"\n [size]=\"size\"\n class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BackgroundImageDirective, selector: "[rxapBackgroundImage]", inputs: ["rxapBackgroundImage", "placeholderImageUrl", "size", "repeat", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2054
+ }
2055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: ImageCellComponent, decorators: [{
2056
+ type: Component,
2057
+ args: [{ selector: 'td[rxap-image-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, NgClass, BackgroundImageDirective], template: "<div\n *ngIf=\"value\"\n [ngClass]=\"[preset]\"\n [position]=\"position\"\n [repeat]=\"repeat\"\n [rxapBackgroundImage]=\"value\"\n [size]=\"size\"\n class=\"image\">\n</div>\n<ng-content></ng-content>\n", styles: [".image{width:40px;height:40px}.image.circle{border-radius:24px}.image.rounded{border-radius:8px}\n"] }]
2058
+ }], propDecorators: { preset: [{
1843
2059
  type: Input
1844
- }], refresh: [{
2060
+ }], size: [{
1845
2061
  type: Input
1846
- }], executingDirective: [{
1847
- type: ContentChild,
1848
- args: [TableRowActionExecutingDirective]
1849
- }], onConfirmed: [{
1850
- type: HostListener,
1851
- args: ['confirmed']
1852
- }], onClick: [{
1853
- type: HostListener,
1854
- args: ['click', ['$event']]
2062
+ }], repeat: [{
2063
+ type: Input
2064
+ }], position: [{
2065
+ type: Input
2066
+ }], value: [{
2067
+ type: Input,
2068
+ args: ['rxap-image-cell']
1855
2069
  }] } });
1856
2070
 
1857
- class TableRowHeaderActionDirective extends TableRowActionDirective {
1858
- constructor(overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip, selectRowService) {
1859
- super(overlay, elementRef, actionMethod, cdr, vcr, tableDataSourceDirective, snackBar, matButton, matTooltip);
1860
- this.selectRowService = selectRowService;
1861
- }
1862
- ngOnDestroy() {
1863
- this._subscription?.unsubscribe();
1864
- }
1865
- ngOnInit() {
1866
- if (this.selectRowService) {
1867
- this._subscription = this.selectRowService.selectedRows$
1868
- .pipe(startWith(this.selectRowService.selectedRows), map((rows) => rows.length !== 0), tap((hasSelected) => {
1869
- if (hasSelected) {
1870
- this.setButtonEnabled();
1871
- }
1872
- else {
1873
- this.setButtonDisabled();
1874
- }
1875
- this.cdr.detectChanges();
1876
- }))
1877
- .subscribe();
1878
- }
1879
- else {
1880
- this.setButtonDisabled();
1881
- }
2071
+ class IconCellComponent {
2072
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IconCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2073
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: IconCellComponent, isStandalone: true, selector: "td[rxap-icon-cell]", inputs: { icon: ["rxap-icon-cell", "icon"] }, ngImport: i0, template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: IconDirective, selector: "mat-icon[rxapIcon]", inputs: ["rxapIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2074
+ }
2075
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IconCellComponent, decorators: [{
2076
+ type: Component,
2077
+ args: [{ selector: 'td[rxap-icon-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, MatIconModule, IconDirective], template: "<mat-icon *ngIf=\"icon\" [rxapIcon]=\"icon\"></mat-icon>\n<ng-content></ng-content>\n" }]
2078
+ }], propDecorators: { icon: [{
2079
+ type: Input,
2080
+ args: ['rxap-icon-cell']
2081
+ }] } });
2082
+
2083
+ class DateCellComponent {
2084
+ constructor() {
2085
+ this.date = null;
2086
+ this.format = 'dd.MM.yyyy HH:mm';
1882
2087
  }
1883
- getElementList() {
1884
- return this.selectRowService?.selectedRows ?? [];
2088
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DateCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2089
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: DateCellComponent, isStandalone: true, selector: "td[rxap-date-cell]", inputs: { date: ["rxap-date-cell", "date"], format: "format" }, ngImport: i0, template: "<ng-template [ngIf]=\"date\">\n {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2090
+ }
2091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: DateCellComponent, decorators: [{
2092
+ type: Component,
2093
+ args: [{ selector: 'td[rxap-date-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, DatePipe], template: "<ng-template [ngIf]=\"date\">\n {{date | date:format}}\n</ng-template>\n<ng-content></ng-content>\n" }]
2094
+ }], propDecorators: { date: [{
2095
+ type: Input,
2096
+ args: ['rxap-date-cell']
2097
+ }], format: [{
2098
+ type: Input
2099
+ }] } });
2100
+
2101
+ class CopyToClipboardCellComponent {
2102
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CopyToClipboardCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2103
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: CopyToClipboardCellComponent, isStandalone: true, selector: "td[rxap-copy-to-clipboard-cell]", inputs: { value: ["rxap-copy-to-clipboard-cell", "value"] }, ngImport: i0, template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CopyToClipboardComponent, selector: "rxap-copy-to-clipboard", inputs: ["active", "disabled", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2104
+ }
2105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CopyToClipboardCellComponent, decorators: [{
2106
+ type: Component,
2107
+ args: [{ selector: 'td[rxap-copy-to-clipboard-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgIf, CopyToClipboardComponent], template: "<rxap-copy-to-clipboard *ngIf=\"value !== null && value !== undefined && value !== ''\" [value]=\"value\"\n class=\"copy-to-clipboard\"></rxap-copy-to-clipboard>\n<ng-content></ng-content>\n", styles: ["::ng-deep .copy-to-clipboard .content{max-width:160px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
2108
+ }], propDecorators: { value: [{
2109
+ type: Input,
2110
+ args: ['rxap-copy-to-clipboard-cell']
2111
+ }] } });
2112
+
2113
+ class BooleanCellComponent {
2114
+ constructor() {
2115
+ this.value = null;
1885
2116
  }
1886
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowHeaderActionDirective, deps: [{ token: Overlay }, { token: ElementRef }, { token: RXAP_TABLE_ROW_ACTION_METHOD }, { token: ChangeDetectorRef }, { token: ViewContainerRef }, { token: TableDataSourceDirective }, { token: MatSnackBar }, { token: MatButton, optional: true }, { token: MatTooltip, optional: true }, { token: SelectRowService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
1887
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: TableRowHeaderActionDirective, isStandalone: true, selector: "button[rxapTableRowHeaderAction]", inputs: { type: ["rxapTableRowHeaderAction", "type"] }, usesInheritance: true, ngImport: i0 }); }
2117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BooleanCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2118
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: BooleanCellComponent, isStandalone: true, selector: "td[rxap-boolean-cell]", inputs: { value: ["rxap-boolean-cell", "value"] }, host: { classAttribute: "rxap-boolean-cell" }, ngImport: i0, template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1888
2119
  }
1889
- __decorate([
1890
- Required,
1891
- __metadata("design:type", String)
1892
- ], TableRowHeaderActionDirective.prototype, "type", void 0);
1893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TableRowHeaderActionDirective, decorators: [{
1894
- type: Directive,
1895
- args: [{
1896
- selector: 'button[rxapTableRowHeaderAction]',
1897
- standalone: true,
1898
- }]
1899
- }], ctorParameters: function () { return [{ type: i1$4.Overlay, decorators: [{
1900
- type: Inject,
1901
- args: [Overlay]
1902
- }] }, { type: i0.ElementRef, decorators: [{
1903
- type: Inject,
1904
- args: [ElementRef]
1905
- }] }, { type: undefined, decorators: [{
1906
- type: Inject,
1907
- args: [RXAP_TABLE_ROW_ACTION_METHOD]
1908
- }] }, { type: i0.ChangeDetectorRef, decorators: [{
1909
- type: Inject,
1910
- args: [ChangeDetectorRef]
1911
- }] }, { type: i0.ViewContainerRef, decorators: [{
1912
- type: Inject,
1913
- args: [ViewContainerRef]
1914
- }] }, { type: TableDataSourceDirective, decorators: [{
1915
- type: Inject,
1916
- args: [TableDataSourceDirective]
1917
- }] }, { type: i3$3.MatSnackBar, decorators: [{
1918
- type: Inject,
1919
- args: [MatSnackBar]
1920
- }] }, { type: i3.MatButton, decorators: [{
1921
- type: Optional
1922
- }, {
1923
- type: Inject,
1924
- args: [MatButton]
1925
- }] }, { type: i4$1.MatTooltip, decorators: [{
1926
- type: Optional
1927
- }, {
1928
- type: Inject,
1929
- args: [MatTooltip]
1930
- }] }, { type: SelectRowService, decorators: [{
1931
- type: Optional
1932
- }, {
1933
- type: Inject,
1934
- args: [SelectRowService]
1935
- }] }]; }, propDecorators: { type: [{
2120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: BooleanCellComponent, decorators: [{
2121
+ type: Component,
2122
+ args: [{ selector: 'td[rxap-boolean-cell]', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-boolean-cell' }, standalone: true, imports: [NgIf, MatIconModule], template: "<ng-template [ngIfElse]=\"isFalse\" [ngIf]=\"value\">\n <mat-icon class=\"truthy\">check_circle</mat-icon>\n</ng-template>\n<ng-template #isFalse>\n <mat-icon class=\"falsy\">cancel</mat-icon>\n</ng-template>\n<ng-content></ng-content>\n" }]
2123
+ }], propDecorators: { value: [{
1936
2124
  type: Input,
1937
- args: ['rxapTableRowHeaderAction']
2125
+ args: ['rxap-boolean-cell']
1938
2126
  }] } });
1939
2127
 
1940
- class RowActionCheckPipe {
1941
- constructor(tableRowActionMethodList) {
1942
- this.actionMethodList = coerceArray(tableRowActionMethodList);
2128
+ class PersistentPaginatorDirective {
2129
+ constructor(matPaginator) {
2130
+ this.matPaginator = matPaginator;
1943
2131
  }
1944
- transform(value, type) {
1945
- if (!type) {
1946
- throw new Error(`The provided type is empty '${type}'`);
1947
- }
1948
- const actionMethodList = this.actionMethodList.filter(IsTableRowActionTypeMethod(type));
1949
- if (actionMethodList.length > 1) {
1950
- throw new Error(`Multiple (${actionMethodList.length}) action method with the same type '${type}' found`);
1951
- }
1952
- if (actionMethodList.length === 0) {
1953
- throw new Error(`Could not find a action method with the type '${type}'`);
2132
+ ngOnInit() {
2133
+ const config = this.restoreConfig();
2134
+ if (config) {
2135
+ this.matPaginator.pageSize = config.pageSize;
1954
2136
  }
1955
- const actionMethod = actionMethodList[0];
1956
- if (HasTableRowActionCheckFunction(actionMethod)) {
1957
- const checkFunction = GetTableRowActionCheckFunction(actionMethod);
1958
- const input = coerceArray(value);
1959
- return input.length !== 0 && input.every(checkFunction);
2137
+ this._subscription = this.matPaginator.page.pipe(tap(() => this.storeConfig())).subscribe();
2138
+ }
2139
+ ngOnDestroy() {
2140
+ this._subscription?.unsubscribe();
2141
+ }
2142
+ getKey() {
2143
+ return 'rxap_mat-paginator-persistent' + this.id;
2144
+ }
2145
+ storeConfig() {
2146
+ const pageSize = this.matPaginator.pageSize;
2147
+ localStorage.setItem(this.getKey(), JSON.stringify({ pageSize }));
2148
+ }
2149
+ restoreConfig() {
2150
+ const configStorage = localStorage.getItem(this.getKey());
2151
+ if (configStorage) {
2152
+ try {
2153
+ return JSON.parse(configStorage);
2154
+ }
2155
+ catch (e) {
2156
+ console.warn(`Could not parse mat paginator persistent config: ${e.message}`);
2157
+ }
1960
2158
  }
1961
- return true;
2159
+ return null;
1962
2160
  }
1963
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, deps: [{ token: RXAP_TABLE_ROW_ACTION_METHOD, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
1964
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, isStandalone: true, name: "rxapRowActionCheck" }); }
2161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PersistentPaginatorDirective, deps: [{ token: i1$5.MatPaginator }], target: i0.ɵɵFactoryTarget.Directive }); }
2162
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: PersistentPaginatorDirective, isStandalone: true, selector: "mat-paginator[rxapPersistent]", inputs: { id: "id" }, ngImport: i0 }); }
1965
2163
  }
1966
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RowActionCheckPipe, decorators: [{
1967
- type: Pipe,
2164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: PersistentPaginatorDirective, decorators: [{
2165
+ type: Directive,
1968
2166
  args: [{
1969
- name: 'rxapRowActionCheck',
2167
+ selector: 'mat-paginator[rxapPersistent]',
1970
2168
  standalone: true,
1971
2169
  }]
1972
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1973
- type: Optional
1974
- }, {
1975
- type: Inject,
1976
- args: [RXAP_TABLE_ROW_ACTION_METHOD]
1977
- }] }]; } });
2170
+ }], ctorParameters: function () { return [{ type: i1$5.MatPaginator }]; }, propDecorators: { id: [{
2171
+ type: Input
2172
+ }] } });
1978
2173
 
1979
- // endregion
2174
+ const offset = '50';
2175
+ const RowAnimation = trigger('rowsAnimation', [
2176
+ transition('void => *', [
2177
+ style({
2178
+ height: '*',
2179
+ opacity: '0',
2180
+ transform: 'translateY(' + (-offset).toString() + 'px)',
2181
+ 'box-shadow': 'none',
2182
+ }),
2183
+ sequence([
2184
+ animate('.2s ease', style({
2185
+ height: '*',
2186
+ opacity: '.2',
2187
+ transform: 'translateX(0)',
2188
+ 'box-shadow': 'none',
2189
+ })),
2190
+ animate('.35s ease', style({
2191
+ height: '*',
2192
+ opacity: 1,
2193
+ transform: 'translateX(0)',
2194
+ })),
2195
+ ]),
2196
+ ]),
2197
+ transition('* => void', [
2198
+ style({
2199
+ height: '0',
2200
+ opacity: '0',
2201
+ 'box-shadow': 'none',
2202
+ }),
2203
+ ]),
2204
+ ]);
2205
+
2206
+ function NormalizeTableRow(row, rowIdOrMapper) {
2207
+ row.__rowId = typeof rowIdOrMapper === 'string' ? rowIdOrMapper : rowIdOrMapper(row);
2208
+ row.__metadata__ ??= { loading$: new ToggleSubject() };
2209
+ row.__metadata__.loading$ ??= new ToggleSubject();
2210
+ return row;
2211
+ }
2212
+
2213
+ // region table-select-controls
1980
2214
  // endregion
1981
2215
 
1982
2216
  /**
1983
2217
  * Generated bundle index. Do not edit.
1984
2218
  */
1985
2219
 
1986
- export { BooleanCellComponent, CheckboxCellComponent, CheckboxHeaderCellComponent, CopyToClipboardCellComponent, DateCellComponent, ExpandControlsCellComponent, ExpandRowContainerComponent, ExpandRowContentDirective, ExpandRowDirective, ExpandRowModule, ExpandRowService, FilterHeaderRowDirective, GetTableRowActionCheckFunction, GetTableRowActionMetadata, HasTableRowActionCheckFunction, HasTableRowActionMetadata, IconCellComponent, ImageCellComponent, IsTableRowActionTypeMethod, IsTableRowActionTypeSwitchMethod, LinkCellComponent, OptionsCellComponent, PersistentPaginatorDirective, ROW_ARCHIVE_METHOD, ROW_DELETE_METHOD, ROW_EDIT_LOADER_METHOD, ROW_EDIT_METHOD, ROW_LINK_METHOD, ROW_RESTORE_METHOD, ROW_VIEW_METHOD, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, RXAP_TABLE_ACTION_METHOD_METADATA, RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_ROW_ACTION_METHOD, RowActionCheckPipe, RowAnimation, RowControlsCellComponent, RowControlsHeaderCellComponent, SelectRowService, SelectedRowsDirective, TABLE_CREATE_REMOTE_METHOD, TABLE_DATA_SOURCE, TABLE_REMOTE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableActionMethod, TableColumnMenuComponent, TableColumnOptionComponent, TableCreateButtonDirective, TableDataSourceDirective, TableFilterService, TableRowActionDirective, TableRowActionExecutingDirective, TableRowActionStatus, TableRowHeaderActionDirective, TableSelectControlsComponent, TableShowArchivedSlideComponent, ToFilterColumnNamesPipe };
2220
+ export { AbstractTableRowAction, BooleanCellComponent, CheckboxCellComponent, CheckboxHeaderCellComponent, CopyToClipboardCellComponent, DateCellComponent, ExpandControlsCellComponent, ExpandRowContainerComponent, ExpandRowContentDirective, ExpandRowDirective, ExpandRowModule, ExpandRowService, FilterHeaderRowDirective, GetTableHeaderButtonMetadata, GetTableRowActionCheckFunction, GetTableRowActionMetadata, HasTableRowActionCheckFunction, HasTableRowActionMetadata, IconCellComponent, ImageCellComponent, IsTableRowActionTypeMethod, IsTableRowActionTypeSwitchMethod, LinkCellComponent, NormalizeTableRow, OptionsCellComponent, PersistentPaginatorDirective, RXAP_MATERIAL_TABLE_SYSTEM_SELECT_ROW_OPTIONS, RXAP_TABLE_ACTION_METHOD_CHECK_FUNCTION_METADATA, RXAP_TABLE_ACTION_METHOD_METADATA, RXAP_TABLE_ACTION_METHOD_TYPE_METADATA, RXAP_TABLE_FILTER, RXAP_TABLE_FILTER_FORM_DEFINITION, RXAP_TABLE_HEADER_BUTTON_METHOD_METADATA, RXAP_TABLE_ROW_ACTION_METHOD, RowActionCheckPipe, RowAnimation, SelectRowModule, SelectRowService, SelectedRowsDirective, SelectionModel, TABLE_CREATE_REMOTE_METHOD, TABLE_DATA_SOURCE, TABLE_HEADER_BUTTON_METHOD, TABLE_REMOTE_METHOD, TABLE_REMOTE_METHOD_ADAPTER_FACTORY, TableActionMethod, TableColumnMenuComponent, TableColumnMenuModule, TableColumnOptionComponent, TableCreateButtonDirective, TableDataSourceDirective, TableFilterModule, TableFilterService, TableHeaderButtonActionStatus, TableHeaderButtonDirective, TableHeaderButtonMethod, TableRowActionDirective, TableRowActionExecutingDirective, TableRowActionStatus, TableRowActionsModule, TableRowHeaderActionDirective, TableSelectControlsComponent, TableShowArchivedSlideComponent, ToFilterColumnNamesPipe, TreeControlCellComponent, getMultipleValuesInSingleSelectionError };
1987
2221
  //# sourceMappingURL=rxap-material-table-system.mjs.map