@rxap/material-table-system 16.0.0-dev.14 → 16.0.0-dev.15

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