@rxap/material-table-system 16.0.0-dev.9 → 16.0.1-dev.0

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