@porscheinformatik/material-addons 17.1.2 → 17.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/card/card.component.mjs +3 -3
- package/esm2022/lib/data-table/configuration/data-table-action-type.mjs +6 -0
- package/esm2022/lib/data-table/configuration/data-table-action.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-column-definition.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-column.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-filter-mode.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-global-configuration.mjs +11 -0
- package/esm2022/lib/data-table/configuration/data-table-header-type.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-row.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-selection-emit-mode.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-selection-emit-type.mjs +2 -0
- package/esm2022/lib/data-table/configuration/data-table-selection-mode.mjs +2 -0
- package/esm2022/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.mjs +15 -11
- package/esm2022/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter-dialog/data-table-filter-dialog.component.mjs +43 -0
- package/esm2022/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter.component.mjs +41 -0
- package/esm2022/lib/data-table/data-table-filter/data-table-filter-header.directive.mjs +126 -0
- package/esm2022/lib/data-table/data-table-filter/data-table-filter-object.mjs +2 -0
- package/esm2022/lib/data-table/data-table-filter/data-table-filter-options.mjs +2 -0
- package/esm2022/lib/data-table/data-table-filter/data-table-filter.directive.mjs +46 -0
- package/esm2022/lib/data-table/data-table-persistence.service.mjs +61 -0
- package/esm2022/lib/data-table/data-table-template/data-table-template-cell-definition.directive.mjs +28 -0
- package/esm2022/lib/data-table/data-table-template/data-table-template-column-definition.directive.mjs +22 -0
- package/esm2022/lib/data-table/data-table-template/data-table-template-expandable-cell-definition.directive.mjs +28 -0
- package/esm2022/lib/data-table/data-table-template/data-table-template-expandable-column-definition.directive.mjs +22 -0
- package/esm2022/lib/data-table/data-table.component.mjs +500 -304
- package/esm2022/lib/data-table/data-table.mjs +9 -1
- package/esm2022/lib/data-table/util/data-table-action-util.mjs +40 -0
- package/esm2022/lib/data-table/util/data-table-data-util.mjs +49 -0
- package/esm2022/lib/data-table/util/data-table-filter-util.mjs +24 -0
- package/esm2022/lib/data-table/util/data-table-sort-util.mjs +57 -0
- package/esm2022/lib/layout/toolbar/toolbar-action.interface.mjs +1 -1
- package/esm2022/lib/layout/toolbar/toolbar.component.mjs +3 -3
- package/esm2022/lib/numeric-field/numeric-field.directive.mjs +1 -1
- package/esm2022/lib/readonly/readonly-form-field/readonly-form-field.component.mjs +7 -3
- package/esm2022/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.mjs +1 -1
- package/esm2022/public_api.mjs +1 -2
- package/fesm2022/porscheinformatik-material-addons.mjs +1104 -434
- package/fesm2022/porscheinformatik-material-addons.mjs.map +1 -1
- package/lib/data-table/configuration/data-table-action-type.d.ts.map +1 -0
- package/lib/data-table/{data-table-action.d.ts → configuration/data-table-action.d.ts} +3 -0
- package/lib/data-table/configuration/data-table-action.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-column-definition.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-column.d.ts +16 -0
- package/lib/data-table/configuration/data-table-column.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-filter-mode.d.ts +2 -0
- package/lib/data-table/configuration/data-table-filter-mode.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-global-configuration.d.ts +11 -0
- package/lib/data-table/configuration/data-table-global-configuration.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-header-type.d.ts +2 -0
- package/lib/data-table/configuration/data-table-header-type.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-row.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-selection-emit-mode.d.ts +2 -0
- package/lib/data-table/configuration/data-table-selection-emit-mode.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-selection-emit-type.d.ts +2 -0
- package/lib/data-table/configuration/data-table-selection-emit-type.d.ts.map +1 -0
- package/lib/data-table/configuration/data-table-selection-mode.d.ts +2 -0
- package/lib/data-table/configuration/data-table-selection-mode.d.ts.map +1 -0
- package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts +3 -3
- package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts.map +1 -1
- package/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter-dialog/data-table-filter-dialog.component.d.ts +16 -0
- package/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter-dialog/data-table-filter-dialog.component.d.ts.map +1 -0
- package/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter.component.d.ts +20 -0
- package/lib/data-table/data-table-filter/data-table-filter-component/data-table-filter.component.d.ts.map +1 -0
- package/lib/data-table/data-table-filter/data-table-filter-header.directive.d.ts +36 -0
- package/lib/data-table/data-table-filter/data-table-filter-header.directive.d.ts.map +1 -0
- package/lib/data-table/data-table-filter/data-table-filter-object.d.ts +4 -0
- package/lib/data-table/data-table-filter/data-table-filter-object.d.ts.map +1 -0
- package/lib/data-table/data-table-filter/data-table-filter-options.d.ts +5 -0
- package/lib/data-table/data-table-filter/data-table-filter-options.d.ts.map +1 -0
- package/lib/data-table/data-table-filter/data-table-filter.directive.d.ts +16 -0
- package/lib/data-table/data-table-filter/data-table-filter.directive.d.ts.map +1 -0
- package/lib/data-table/data-table-persistence.service.d.ts +28 -0
- package/lib/data-table/data-table-persistence.service.d.ts.map +1 -0
- package/lib/data-table/data-table-template/data-table-template-cell-definition.directive.d.ts +14 -0
- package/lib/data-table/data-table-template/data-table-template-cell-definition.directive.d.ts.map +1 -0
- package/lib/data-table/data-table-template/data-table-template-column-definition.directive.d.ts +11 -0
- package/lib/data-table/data-table-template/data-table-template-column-definition.directive.d.ts.map +1 -0
- package/lib/data-table/data-table-template/data-table-template-expandable-cell-definition.directive.d.ts +14 -0
- package/lib/data-table/data-table-template/data-table-template-expandable-cell-definition.directive.d.ts.map +1 -0
- package/lib/data-table/data-table-template/data-table-template-expandable-column-definition.directive.d.ts +11 -0
- package/lib/data-table/data-table-template/data-table-template-expandable-column-definition.directive.d.ts.map +1 -0
- package/lib/data-table/data-table.component.d.ts +144 -74
- package/lib/data-table/data-table.component.d.ts.map +1 -1
- package/lib/data-table/data-table.d.ts +18 -3
- package/lib/data-table/data-table.d.ts.map +1 -1
- package/lib/data-table/util/data-table-action-util.d.ts +9 -0
- package/lib/data-table/util/data-table-action-util.d.ts.map +1 -0
- package/lib/data-table/util/data-table-data-util.d.ts +10 -0
- package/lib/data-table/util/data-table-data-util.d.ts.map +1 -0
- package/lib/data-table/util/data-table-filter-util.d.ts +6 -0
- package/lib/data-table/util/data-table-filter-util.d.ts.map +1 -0
- package/lib/data-table/util/data-table-sort-util.d.ts +12 -0
- package/lib/data-table/util/data-table-sort-util.d.ts.map +1 -0
- package/lib/layout/toolbar/toolbar-action.interface.d.ts +1 -0
- package/lib/layout/toolbar/toolbar-action.interface.d.ts.map +1 -1
- package/lib/numeric-field/numeric-field.directive.d.ts.map +1 -1
- package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts +2 -1
- package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts.map +1 -1
- package/package.json +3 -3
- package/public_api.d.ts +0 -1
- package/public_api.d.ts.map +1 -1
- package/esm2022/lib/data-table/data-table-action-type.mjs +0 -6
- package/esm2022/lib/data-table/data-table-action.mjs +0 -2
- package/esm2022/lib/data-table/data-table-column-definition.mjs +0 -2
- package/esm2022/lib/data-table/data-table-column.mjs +0 -2
- package/esm2022/lib/data-table/data-table-row.mjs +0 -2
- package/esm2022/lib/data-table/data-table.module.mjs +0 -81
- package/lib/data-table/data-table-action-type.d.ts.map +0 -1
- package/lib/data-table/data-table-action.d.ts.map +0 -1
- package/lib/data-table/data-table-column-definition.d.ts.map +0 -1
- package/lib/data-table/data-table-column.d.ts +0 -11
- package/lib/data-table/data-table-column.d.ts.map +0 -1
- package/lib/data-table/data-table-row.d.ts.map +0 -1
- package/lib/data-table/data-table.module.d.ts +0 -25
- package/lib/data-table/data-table.module.d.ts.map +0 -1
- /package/lib/data-table/{data-table-action-type.d.ts → configuration/data-table-action-type.d.ts} +0 -0
- /package/lib/data-table/{data-table-column-definition.d.ts → configuration/data-table-column-definition.d.ts} +0 -0
- /package/lib/data-table/{data-table-row.d.ts → configuration/data-table-row.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, NgModule, HostBinding, ElementRef, ViewChild, Directive, Optional, LOCALE_ID, Injectable, Inject, EventEmitter, Output, forwardRef, HostListener, TemplateRef, ContentChild, ViewChildren, ViewEncapsulation, ChangeDetectionStrategy, QueryList
|
|
2
|
+
import { Component, Input, NgModule, HostBinding, ElementRef, ViewChild, Directive, Optional, LOCALE_ID, Injectable, Inject, EventEmitter, Output, forwardRef, HostListener, TemplateRef, ContentChild, ViewChildren, InjectionToken, SkipSelf, ContentChildren, ViewEncapsulation, ChangeDetectionStrategy, QueryList } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
@@ -16,13 +16,13 @@ import * as i4 from '@angular/material/input';
|
|
|
16
16
|
import { MatInputModule } from '@angular/material/input';
|
|
17
17
|
import * as i5$1 from '@angular/cdk/text-field';
|
|
18
18
|
import * as i1$2 from '@angular/forms';
|
|
19
|
-
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
|
|
19
|
+
import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
20
20
|
import { style, animate, transition, trigger, state } from '@angular/animations';
|
|
21
21
|
import * as i2$1 from '@angular/material/card';
|
|
22
22
|
import { MatCardModule } from '@angular/material/card';
|
|
23
23
|
import { Subject, Subscription, of } from 'rxjs';
|
|
24
24
|
import { throttleTime, map, tap, startWith, switchMap, takeUntil, distinctUntilChanged } from 'rxjs/operators';
|
|
25
|
-
import * as
|
|
25
|
+
import * as i9 from '@angular/material/table';
|
|
26
26
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
27
27
|
import * as i6$1 from '@angular/material/paginator';
|
|
28
28
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
@@ -32,29 +32,35 @@ import * as i6 from '@angular/material/menu';
|
|
|
32
32
|
import { MatMenuModule } from '@angular/material/menu';
|
|
33
33
|
import * as i1$3 from '@angular/material/dialog';
|
|
34
34
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
35
|
-
import * as
|
|
35
|
+
import * as i3$2 from '@angular/cdk/drag-drop';
|
|
36
36
|
import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
|
|
37
37
|
import * as i2$2 from '@ngx-translate/core';
|
|
38
38
|
import { TranslateModule } from '@ngx-translate/core';
|
|
39
39
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
40
|
+
import { DateTime } from 'luxon';
|
|
40
41
|
import { v4 } from 'uuid';
|
|
41
|
-
import * as i10
|
|
42
|
+
import * as i10 from '@angular/material/progress-spinner';
|
|
42
43
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
43
|
-
import * as i13 from '@angular/material/checkbox';
|
|
44
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
45
44
|
import * as i14 from '@angular/material/badge';
|
|
46
45
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
46
|
+
import * as i15 from '@angular/material/checkbox';
|
|
47
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
48
|
+
import * as i16 from '@angular/material/radio';
|
|
49
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
50
|
+
import * as i4$1 from '@angular/material/select';
|
|
51
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
52
|
+
import * as i5$2 from '@angular/material/core';
|
|
47
53
|
import { CdkStepHeader, STEP_STATE, CdkStep, CdkStepper, CdkStepperModule } from '@angular/cdk/stepper';
|
|
48
54
|
import * as i1$4 from '@angular/cdk/a11y';
|
|
49
|
-
import * as i3$
|
|
55
|
+
import * as i3$3 from '@angular/cdk/bidi';
|
|
50
56
|
import * as i2$3 from '@angular/material/stepper';
|
|
51
57
|
import { MatStepperModule } from '@angular/material/stepper';
|
|
52
58
|
import * as i1$5 from '@angular/cdk/layout';
|
|
53
59
|
import { Breakpoints } from '@angular/cdk/layout';
|
|
54
60
|
import * as i2$4 from '@angular/platform-browser';
|
|
55
|
-
import * as i8
|
|
61
|
+
import * as i8 from '@angular/material/toolbar';
|
|
56
62
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
57
|
-
import * as i4$
|
|
63
|
+
import * as i4$2 from '@angular/material/chips';
|
|
58
64
|
import { MatChipsModule } from '@angular/material/chips';
|
|
59
65
|
|
|
60
66
|
class MaterialActionButtonComponent {
|
|
@@ -522,6 +528,7 @@ class ReadOnlyFormFieldComponent {
|
|
|
522
528
|
this.changeDetector = changeDetector;
|
|
523
529
|
this.renderer = renderer;
|
|
524
530
|
this.numberFormatService = numberFormatService;
|
|
531
|
+
this.useProjectedContent = false;
|
|
525
532
|
this.textAlign = 'left';
|
|
526
533
|
this.formatNumber = false;
|
|
527
534
|
this.decimalPlaces = 2;
|
|
@@ -622,14 +629,17 @@ class ReadOnlyFormFieldComponent {
|
|
|
622
629
|
}
|
|
623
630
|
}
|
|
624
631
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ReadOnlyFormFieldComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
625
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: { value: "value", label: "label", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", multiline: "multiline", rows: "rows", id: "id", shrinkIfEmpty: "shrinkIfEmpty", suffix: "suffix", prefix: "prefix", multilineAutoSize: "multilineAutoSize" }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "originalContent", first: true, predicate: ["contentWrapper"], descendants: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign + ' content'\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n disabled\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n disabled\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize\"\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\n <mat-icon *ngIf=\"suffix\" (click)=\"suffixClicked()\" class=\"pointer\" color=\"primary\" matSuffix>{{ suffix }}</mat-icon>\n <mat-icon *ngIf=\"prefix\" (click)=\"prefixClicked()\" class=\"pointer\" color=\"primary\" matPrefix>{{ prefix }}</mat-icon>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
632
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: { useProjectedContent: "useProjectedContent", value: "value", label: "label", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", multiline: "multiline", rows: "rows", id: "id", shrinkIfEmpty: "shrinkIfEmpty", suffix: "suffix", prefix: "prefix", multilineAutoSize: "multilineAutoSize" }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "originalContent", first: true, predicate: ["contentWrapper"], descendants: true }, { propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngStyle]=\"{ display: useProjectedContent ? 'none' : 'block' }\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign + ' content'\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n [disabled]=\"!useProjectedContent\"\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [ngStyle]=\"{ display: useProjectedContent ? 'none' : 'block' }\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n [disabled]=\"!useProjectedContent\"\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize\"\n ></textarea>\n <ng-content *ngIf=\"useProjectedContent\" />\n <mat-error>{{ errorMessage }}</mat-error>\n <mat-icon *ngIf=\"suffix\" (click)=\"suffixClicked()\" class=\"pointer\" color=\"primary\" matSuffix>{{ suffix }}</mat-icon>\n <mat-icon *ngIf=\"prefix\" (click)=\"prefixClicked()\" class=\"pointer\" color=\"primary\" matPrefix>{{ prefix }}</mat-icon>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3$1.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i5$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
626
633
|
}
|
|
627
634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ReadOnlyFormFieldComponent, decorators: [{
|
|
628
635
|
type: Component,
|
|
629
|
-
args: [{ selector: 'mad-readonly-form-field', template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign + ' content'\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n disabled\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n disabled\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize\"\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\n <mat-icon *ngIf=\"suffix\" (click)=\"suffixClicked()\" class=\"pointer\" color=\"primary\" matSuffix>{{ suffix }}</mat-icon>\n <mat-icon *ngIf=\"prefix\" (click)=\"prefixClicked()\" class=\"pointer\" color=\"primary\" matPrefix>{{ prefix }}</mat-icon>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"] }]
|
|
636
|
+
args: [{ selector: 'mad-readonly-form-field', template: "<mat-form-field class=\"form-group mad-read-only\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngStyle]=\"{ display: useProjectedContent ? 'none' : 'block' }\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign + ' content'\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n [disabled]=\"!useProjectedContent\"\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [ngStyle]=\"{ display: useProjectedContent ? 'none' : 'block' }\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline content\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n [disabled]=\"!useProjectedContent\"\n matInput\n [cdkTextareaAutosize]=\"multilineAutoSize\"\n ></textarea>\n <ng-content *ngIf=\"useProjectedContent\" />\n <mat-error>{{ errorMessage }}</mat-error>\n <mat-icon *ngIf=\"suffix\" (click)=\"suffixClicked()\" class=\"pointer\" color=\"primary\" matSuffix>{{ suffix }}</mat-icon>\n <mat-icon *ngIf=\"prefix\" (click)=\"prefixClicked()\" class=\"pointer\" color=\"primary\" matPrefix>{{ prefix }}</mat-icon>\n</mat-form-field>\n", styles: ["mat-form-field{width:100%;width:-webkit-fill-available;width:-moz-available;width:stretch}mat-label{line-height:1.4}span[matPrefix]{padding-right:5px}span[matSuffix]{padding-left:5px}.text-left{text-align:left}.text-right{text-align:right}.multiline{resize:none}\n"] }]
|
|
630
637
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: NumberFormatService }], propDecorators: { originalContent: [{
|
|
631
638
|
type: ViewChild,
|
|
632
639
|
args: ['contentWrapper', { static: false }]
|
|
640
|
+
}], useProjectedContent: [{
|
|
641
|
+
type: Input,
|
|
642
|
+
args: ['useProjectedContent']
|
|
633
643
|
}], value: [{
|
|
634
644
|
type: Input,
|
|
635
645
|
args: ['value']
|
|
@@ -822,7 +832,7 @@ class ReadOnlyFormFieldWrapperComponent {
|
|
|
822
832
|
return this.unitPosition === 'left' ? this.unit + ' ' + this.value : this.value + ' ' + this.unit;
|
|
823
833
|
}
|
|
824
834
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
825
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ReadOnlyFormFieldWrapperComponent, selector: "mad-readonly-form-field-wrapper", inputs: { readonly: "readonly", value: "value", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", id: "id", multiline: "multiline", rows: "rows", shrinkIfEmpty: "shrinkIfEmpty", hideIconInReadOnlyMode: "hideIconInReadOnlyMode", suffix: "suffix", prefix: "prefix", multilineAutoSize: "multilineAutoSize" }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "originalContent", first: true, predicate: ["contentWrapper"], descendants: true }, { propertyName: "readOnlyContentWrapper", first: true, predicate: ["readOnlyContentWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #contentWrapper [hidden]=\"readonly\">\n <ng-content></ng-content>\n</div>\n\n<div #readOnlyContentWrapper>\n <ng-container *ngIf=\"!!readonly\">\n <mad-readonly-form-field\n [label]=\"getLabel()\"\n [value]=\"value\"\n [textAlign]=\"textAlign\"\n [formatNumber]=\"formatNumber\"\n [decimalPlaces]=\"decimalPlaces\"\n [roundDisplayValue]=\"roundValue\"\n [autofillDecimals]=\"autofillDecimals\"\n [unit]=\"unit\"\n [unitPosition]=\"unitPosition\"\n [errorMessage]=\"errorMessage\"\n [multiline]=\"multiline\"\n [rows]=\"rows\"\n [shrinkIfEmpty]=\"shrinkIfEmpty\"\n [id]=\"id\"\n [suffix]=\"suffix\"\n [prefix]=\"prefix\"\n [multilineAutoSize]=\"multilineAutoSize\"\n (suffixClickedEmitter)=\"suffixClicked()\"\n (prefixClickedEmitter)=\"prefixClicked()\"\n matTooltip=\"{{ toolTipText }}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{ !toolTipForInputEnabled }}\"\n >\n </mad-readonly-form-field>\n </ng-container>\n</div>\n", styles: ["mat-form-field{width:inherit}div{width:inherit}::ng-deep .custom-tooltip{font-size:14px!important;word-break:break-all!important;white-space:normal!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: ["value", "label", "textAlign", "formatNumber", "decimalPlaces", "roundDisplayValue", "autofillDecimals", "unit", "unitPosition", "errorMessage", "multiline", "rows", "id", "shrinkIfEmpty", "suffix", "prefix", "multilineAutoSize"], outputs: ["suffixClickedEmitter", "prefixClickedEmitter"] }] }); }
|
|
835
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ReadOnlyFormFieldWrapperComponent, selector: "mad-readonly-form-field-wrapper", inputs: { readonly: "readonly", value: "value", textAlign: "textAlign", formatNumber: "formatNumber", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", errorMessage: "errorMessage", id: "id", multiline: "multiline", rows: "rows", shrinkIfEmpty: "shrinkIfEmpty", hideIconInReadOnlyMode: "hideIconInReadOnlyMode", suffix: "suffix", prefix: "prefix", multilineAutoSize: "multilineAutoSize" }, outputs: { suffixClickedEmitter: "suffixClickedEmitter", prefixClickedEmitter: "prefixClickedEmitter" }, viewQueries: [{ propertyName: "originalContent", first: true, predicate: ["contentWrapper"], descendants: true }, { propertyName: "readOnlyContentWrapper", first: true, predicate: ["readOnlyContentWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #contentWrapper [hidden]=\"readonly\">\n <ng-content></ng-content>\n</div>\n\n<div #readOnlyContentWrapper>\n <ng-container *ngIf=\"!!readonly\">\n <mad-readonly-form-field\n [label]=\"getLabel()\"\n [value]=\"value\"\n [textAlign]=\"textAlign\"\n [formatNumber]=\"formatNumber\"\n [decimalPlaces]=\"decimalPlaces\"\n [roundDisplayValue]=\"roundValue\"\n [autofillDecimals]=\"autofillDecimals\"\n [unit]=\"unit\"\n [unitPosition]=\"unitPosition\"\n [errorMessage]=\"errorMessage\"\n [multiline]=\"multiline\"\n [rows]=\"rows\"\n [shrinkIfEmpty]=\"shrinkIfEmpty\"\n [id]=\"id\"\n [suffix]=\"suffix\"\n [prefix]=\"prefix\"\n [multilineAutoSize]=\"multilineAutoSize\"\n (suffixClickedEmitter)=\"suffixClicked()\"\n (prefixClickedEmitter)=\"prefixClicked()\"\n matTooltip=\"{{ toolTipText }}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{ !toolTipForInputEnabled }}\"\n >\n </mad-readonly-form-field>\n </ng-container>\n</div>\n", styles: ["mat-form-field{width:inherit}div{width:inherit}::ng-deep .custom-tooltip{font-size:14px!important;word-break:break-all!important;white-space:normal!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ReadOnlyFormFieldComponent, selector: "mad-readonly-form-field", inputs: ["useProjectedContent", "value", "label", "textAlign", "formatNumber", "decimalPlaces", "roundDisplayValue", "autofillDecimals", "unit", "unitPosition", "errorMessage", "multiline", "rows", "id", "shrinkIfEmpty", "suffix", "prefix", "multilineAutoSize"], outputs: ["suffixClickedEmitter", "prefixClickedEmitter"] }] }); }
|
|
826
836
|
}
|
|
827
837
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, decorators: [{
|
|
828
838
|
type: Component,
|
|
@@ -1276,7 +1286,7 @@ class CardComponent {
|
|
|
1276
1286
|
this.additionalAction.emit(undefined);
|
|
1277
1287
|
}
|
|
1278
1288
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1279
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: CardComponent, selector: "mad-card", inputs: { cancelDisabled: "cancelDisabled", cancelText: "cancelText", readonly: "readonly", editText: "editText", expandable: "expandable", expanded: "expanded", saveDisabled: "saveDisabled", saveText: "saveText", title: "title", editMode: "editMode", additionalActionIcon: "additionalActionIcon", additionalActionText: "additionalActionText" }, outputs: { edit: "edit", cancel: "cancel", save: "save", additionalAction: "additionalAction" }, ngImport: i0, template: "<mat-card>\n <mat-card-header class=\"header\">\n <mat-card-title-group class=\"center\">\n <mat-card-title class=\"small-title-container\">{{ title }}</mat-card-title>\n <div class=\"top-right-icons\">\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n <mad-icon-button
|
|
1289
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: CardComponent, selector: "mad-card", inputs: { cancelDisabled: "cancelDisabled", cancelText: "cancelText", readonly: "readonly", editText: "editText", expandable: "expandable", expanded: "expanded", saveDisabled: "saveDisabled", saveText: "saveText", title: "title", editMode: "editMode", additionalActionIcon: "additionalActionIcon", additionalActionText: "additionalActionText" }, outputs: { edit: "edit", cancel: "cancel", save: "save", additionalAction: "additionalAction" }, ngImport: i0, template: "<mat-card>\n <mat-card-header class=\"header\">\n <mat-card-title-group class=\"center\">\n <mat-card-title class=\"small-title-container\">{{ title }}</mat-card-title>\n <div class=\"top-right-icons\">\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n <mad-icon-button\n data-testid=\"additional-btn\"\n (click)=\"additionalActionClicked()\"\n *ngIf=\"additionalActionIcon\"\n [title]=\"additionalActionText\"\n type=\"button\"\n >\n <mat-icon>{{ additionalActionIcon }}</mat-icon>\n </mad-icon-button>\n <mad-icon-button data-testid=\"edit-btn\" [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </div>\n </mat-card-title-group>\n </mat-card-header>\n <mat-card-content [@collapseExpandAnimation] *ngIf=\"expanded\">\n <ng-content></ng-content>\n </mat-card-content>\n <mat-card-actions *ngIf=\"!readonly && editMode\">\n <mad-primary-button data-testid=\"save-btn\" [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button data-testid=\"cancel-btn\" [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: [".top-right-icons{text-align:end;width:-moz-fit-content;width:fit-content}.center{display:flex;align-items:center}.header{height:48px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i2$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i2$1.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i2$1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i2$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "component", type: i2$1.MatCardTitleGroup, selector: "mat-card-title-group" }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title", "color"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: ["throttleTime"], outputs: ["throttleClick"] }], animations: [
|
|
1280
1290
|
trigger('collapseExpandAnimation', [
|
|
1281
1291
|
transition(':enter', [
|
|
1282
1292
|
style({ opacity: 0, height: 0, overflow: 'hidden' }),
|
|
@@ -1326,7 +1336,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
1326
1336
|
transition('true => false', animate('100ms ease-out')),
|
|
1327
1337
|
transition('false => true', animate('100ms ease-in')),
|
|
1328
1338
|
]),
|
|
1329
|
-
], template: "<mat-card>\n <mat-card-header class=\"header\">\n <mat-card-title-group class=\"center\">\n <mat-card-title class=\"small-title-container\">{{ title }}</mat-card-title>\n <div class=\"top-right-icons\">\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n <mad-icon-button
|
|
1339
|
+
], template: "<mat-card>\n <mat-card-header class=\"header\">\n <mat-card-title-group class=\"center\">\n <mat-card-title class=\"small-title-container\">{{ title }}</mat-card-title>\n <div class=\"top-right-icons\">\n <mad-icon-button data-testid=\"collapse-btn\" (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n <mad-icon-button\n data-testid=\"additional-btn\"\n (click)=\"additionalActionClicked()\"\n *ngIf=\"additionalActionIcon\"\n [title]=\"additionalActionText\"\n type=\"button\"\n >\n <mat-icon>{{ additionalActionIcon }}</mat-icon>\n </mad-icon-button>\n <mad-icon-button data-testid=\"edit-btn\" [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </div>\n </mat-card-title-group>\n </mat-card-header>\n <mat-card-content [@collapseExpandAnimation] *ngIf=\"expanded\">\n <ng-content></ng-content>\n </mat-card-content>\n <mat-card-actions *ngIf=\"!readonly && editMode\">\n <mad-primary-button data-testid=\"save-btn\" [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button data-testid=\"cancel-btn\" [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: [".top-right-icons{text-align:end;width:-moz-fit-content;width:fit-content}.center{display:flex;align-items:center}.header{height:48px}\n"] }]
|
|
1330
1340
|
}], propDecorators: { cancelDisabled: [{
|
|
1331
1341
|
type: Input
|
|
1332
1342
|
}], cancelText: [{
|
|
@@ -1675,7 +1685,7 @@ class TableComponent {
|
|
|
1675
1685
|
return event?.target?.classList.contains('mat-icon');
|
|
1676
1686
|
}
|
|
1677
1687
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1678
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: TableComponent, selector: "mad-table", inputs: { columns: "columns", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", noDataText: "noDataText", pageSizeOptions: "pageSizeOptions", defaultPageSize: "defaultPageSize", rowActions: "rowActions", tableActions: "tableActions", displayedData: "displayedData", paginationEnabled: "paginationEnabled", filterEnabled: "filterEnabled" }, outputs: { tableAction: "tableAction", rowAction: "rowAction", sortEvent: "sortEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n</div>\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled", "color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type:
|
|
1688
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: TableComponent, selector: "mad-table", inputs: { columns: "columns", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", noDataText: "noDataText", pageSizeOptions: "pageSizeOptions", defaultPageSize: "defaultPageSize", rowActions: "rowActions", tableActions: "tableActions", displayedData: "displayedData", paginationEnabled: "paginationEnabled", filterEnabled: "filterEnabled" }, outputs: { tableAction: "tableAction", rowAction: "rowAction", sortEvent: "sortEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<!-- Table actions -->\n<div *ngIf=\"tableActions?.length\">\n <mad-primary-button class=\"table-action\" *ngFor=\"let tableAction of tableActions\" (click)=\"onTableAction(tableAction)\">\n {{ tableAction.label }}\n </mad-primary-button>\n</div>\n\n<!-- Row action buttons -->\n<mat-menu #menu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table filter -->\n<mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel }}</mat-label>\n <input matInput (keyup)=\"onFilter($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n</mat-form-field>\n\n<!-- Table -->\n<div *ngIf=\"dataSource?.data?.length > 0; else noData\" class=\"mad-table\">\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column -->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\" *ngIf=\"rowActions?.length\" sticky>\n <th mat-header-cell *matHeaderCellDef class=\"row-action-button\"></th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <mad-icon-button [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"menu\">\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.label\" [sticky]=\"column.isSticky\">\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.label }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\">\n {{ element[column.dataPropertyName] }}\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnNames\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnNames\"\n ></tr>\n </table>\n</div>\n<!-- Pagination -->\n<mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [pageSize]=\"defaultPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n showFirstLastButtons\n>\n</mat-paginator>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [".text-right{text-align:right!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-button{width:10px}.noDataText{width:100%;text-align:center}.mad-table{width:100%;overflow-x:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled", "color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] }); }
|
|
1679
1689
|
}
|
|
1680
1690
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: TableComponent, decorators: [{
|
|
1681
1691
|
type: Component,
|
|
@@ -1836,11 +1846,11 @@ class DataTableColumnsModalComponent {
|
|
|
1836
1846
|
this.filteredAvailableColumns = [...this.availableColumns];
|
|
1837
1847
|
}
|
|
1838
1848
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableColumnsModalComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1839
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DataTableColumnsModalComponent, selector: "mad-data-table-columns-modal.component", ngImport: i0, template: "<h1 mat-dialog-title>{{ data
|
|
1849
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DataTableColumnsModalComponent, isStandalone: true, selector: "mad-data-table-columns-modal.component", ngImport: i0, template: "<h1 mat-dialog-title>{{ data.titleLabel | translate }}</h1>\n<div mat-dialog-content>\n <div class=\"column-drag-main-content\">\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">{{ data.infoTextLabel | translate }}</div>\n <div class=\"column-drag-container-header\">{{ data.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n <div class=\"column-drag-box\" *ngFor=\"let selectedColumn of selectedColumns; let i = index\" cdkDrag [id]=\"selectedColumn.id\">\n {{ i + 1 }}. {{ selectedColumn.label | translate }}\n </div>\n </div>\n </div>\n\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">\n <!-- Table filter -->\n <mat-form-field>\n <mat-label>{{ data.filterColumnsLabel | translate }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data.filterColumnsPlaceHolder | translate }}\"\n [(ngModel)]=\"searchFilter\"\n />\n <button *ngIf=\"searchFilter\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <div class=\"column-drag-container-header\">{{ data.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n <div *ngFor=\"let availableColumn of filteredAvailableColumns\" class=\"column-drag-box\" cdkDrag [id]=\"availableColumn.id\">\n {{ availableColumn.label }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<div mat-dialog-actions [align]=\"'end'\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data.cancelLabel | translate }}\n </mad-outline-button>\n <mad-danger-button *ngIf=\"data.deleteDefinitionAllowed\" (click)=\"onDelete()\">\n {{ data.deleteLabel | translate }}\n </mad-danger-button>\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!((this.selectedColumns.length || 0) > 0)\">\n {{ data.saveLabel | translate }}\n </mad-primary-button>\n</div>\n", styles: [".column-drag-main-content{display:flex;flex-direction:row;width:544px;justify-content:space-between;padding:8px 8px 16px;margin-bottom:16px;border-bottom:1px solid whitesmoke}.column-drag-container{width:256px;max-width:100%;display:inline-block;vertical-align:top;font-size:small}.info-box{width:100%;font-size:small;margin-bottom:16px;color:#000000a8}.column-drag-info-area{width:100%;height:36px;margin-bottom:32px;color:#000000a8;font-size:small;display:flex;justify-content:right;align-items:stretch;flex-direction:column}.column-drag-list{border:solid 1px #ccc;height:200px;box-sizing:border-box;background:white;border-radius:4px;overflow:auto;display:block}.column-drag-container-header{font-weight:700;margin-bottom:4px}.column-drag-box{padding:12px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;height:40px;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i3$2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i3$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title", "color"] }, { kind: "component", type: DangerButtonComponent, selector: "mad-danger-button", inputs: ["type", "disabled", "title"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] }); }
|
|
1840
1850
|
}
|
|
1841
1851
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableColumnsModalComponent, decorators: [{
|
|
1842
1852
|
type: Component,
|
|
1843
|
-
args: [{ selector: 'mad-data-table-columns-modal.component', template: "<h1 mat-dialog-title>{{ data
|
|
1853
|
+
args: [{ selector: 'mad-data-table-columns-modal.component', standalone: true, imports: [CommonModule, DragDropModule, MatFormFieldModule, MatIconModule, FormsModule, ButtonModule, TranslateModule], template: "<h1 mat-dialog-title>{{ data.titleLabel | translate }}</h1>\n<div mat-dialog-content>\n <div class=\"column-drag-main-content\">\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">{{ data.infoTextLabel | translate }}</div>\n <div class=\"column-drag-container-header\">{{ data.selectedLabel | translate }}</div>\n <div\n cdkDropList\n #selectedList=\"cdkDropList\"\n [cdkDropListData]=\"selectedColumns\"\n [cdkDropListConnectedTo]=\"[availableList]\"\n class=\"column-drag-list selected-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n <div class=\"column-drag-box\" *ngFor=\"let selectedColumn of selectedColumns; let i = index\" cdkDrag [id]=\"selectedColumn.id\">\n {{ i + 1 }}. {{ selectedColumn.label | translate }}\n </div>\n </div>\n </div>\n\n <div class=\"column-drag-container\">\n <div class=\"column-drag-info-area\">\n <!-- Table filter -->\n <mat-form-field>\n <mat-label>{{ data.filterColumnsLabel | translate }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data.filterColumnsPlaceHolder | translate }}\"\n [(ngModel)]=\"searchFilter\"\n />\n <button *ngIf=\"searchFilter\" matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearFilterValue()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n </div>\n <div class=\"column-drag-container-header\">{{ data.availableLabel | translate }}</div>\n <div\n cdkDropList\n cdkDropListSortingDisabled\n #availableList=\"cdkDropList\"\n [cdkDropListData]=\"availableColumns\"\n [cdkDropListConnectedTo]=\"[selectedList]\"\n class=\"column-drag-list\"\n (cdkDropListDropped)=\"onDrop($event)\"\n >\n <div *ngFor=\"let availableColumn of filteredAvailableColumns\" class=\"column-drag-box\" cdkDrag [id]=\"availableColumn.id\">\n {{ availableColumn.label }}\n </div>\n </div>\n </div>\n </div>\n</div>\n<div mat-dialog-actions [align]=\"'end'\">\n <mad-outline-button (click)=\"onCancel()\">\n {{ data.cancelLabel | translate }}\n </mad-outline-button>\n <mad-danger-button *ngIf=\"data.deleteDefinitionAllowed\" (click)=\"onDelete()\">\n {{ data.deleteLabel | translate }}\n </mad-danger-button>\n <mad-primary-button (click)=\"onSave()\" [disabled]=\"!((this.selectedColumns.length || 0) > 0)\">\n {{ data.saveLabel | translate }}\n </mad-primary-button>\n</div>\n", styles: [".column-drag-main-content{display:flex;flex-direction:row;width:544px;justify-content:space-between;padding:8px 8px 16px;margin-bottom:16px;border-bottom:1px solid whitesmoke}.column-drag-container{width:256px;max-width:100%;display:inline-block;vertical-align:top;font-size:small}.info-box{width:100%;font-size:small;margin-bottom:16px;color:#000000a8}.column-drag-info-area{width:100%;height:36px;margin-bottom:32px;color:#000000a8;font-size:small;display:flex;justify-content:right;align-items:stretch;flex-direction:column}.column-drag-list{border:solid 1px #ccc;height:200px;box-sizing:border-box;background:white;border-radius:4px;overflow:auto;display:block}.column-drag-container-header{font-weight:700;margin-bottom:4px}.column-drag-box{padding:12px 10px;border-bottom:solid 1px #ccc;color:#000000de;display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;height:40px;cursor:move;background:white;font-size:14px}.cdk-drag-preview{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.column-drag-box:last-child{border:none}.column-drag-list.cdk-drop-list-dragging .column-drag-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
1844
1854
|
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
|
|
1845
1855
|
type: Inject,
|
|
1846
1856
|
args: [MAT_DIALOG_DATA]
|
|
@@ -1852,140 +1862,77 @@ class DataTableActionType {
|
|
|
1852
1862
|
static { this.NONE = 'NONE'; }
|
|
1853
1863
|
}
|
|
1854
1864
|
|
|
1855
|
-
class
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
this.setFilterValue(filterString);
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
set displayedColumns(cols) {
|
|
1863
|
-
if (!this.displayedColumnDefinition) {
|
|
1864
|
-
this.columns = cols ? [...cols] : [];
|
|
1865
|
-
this.columnIds = this.columns.map((column) => column.id);
|
|
1866
|
-
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
1867
|
-
}
|
|
1865
|
+
class DataTableFilter {
|
|
1866
|
+
constructor() {
|
|
1867
|
+
this.filterChange = new EventEmitter();
|
|
1868
|
+
this.filterables = new Map();
|
|
1868
1869
|
}
|
|
1869
|
-
|
|
1870
|
-
this.
|
|
1871
|
-
this.columns = def.displayedColumns;
|
|
1872
|
-
this.columnIds = this.columns.map((column) => column.id);
|
|
1873
|
-
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
1870
|
+
register(filterable) {
|
|
1871
|
+
this.filterables.set(filterable.id, filterable);
|
|
1874
1872
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
if (!this.dataSource) {
|
|
1878
|
-
this.dataSource = new MatTableDataSource(dataArray);
|
|
1879
|
-
}
|
|
1880
|
-
this.createDataMapsAndSetDisplayedDataSourceData(dataArray);
|
|
1873
|
+
unregister(filterable) {
|
|
1874
|
+
this.filterables.delete(filterable.id);
|
|
1881
1875
|
}
|
|
1882
|
-
|
|
1883
|
-
this.
|
|
1884
|
-
this.paginatorPageSize = page.pageSize;
|
|
1885
|
-
this.paginatorLength = page.length;
|
|
1876
|
+
changeFilter() {
|
|
1877
|
+
this.filterChange.emit(this.createFilter());
|
|
1886
1878
|
}
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
}
|
|
1895
|
-
if (definition.displayedColumns?.length > 0) {
|
|
1896
|
-
this.viewableColumnDefinitions.push(definition);
|
|
1897
|
-
}
|
|
1879
|
+
updateFilterables(dataTableFilterObject) {
|
|
1880
|
+
if (!!dataTableFilterObject) {
|
|
1881
|
+
Object.entries(dataTableFilterObject).forEach(([key, value]) => {
|
|
1882
|
+
const filterable = this.filterables.get(key);
|
|
1883
|
+
if (!!filterable) {
|
|
1884
|
+
filterable.filterValue = value;
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1898
1887
|
}
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
this.isLoading = isLoading;
|
|
1902
|
-
}
|
|
1903
|
-
set defaultPageSize(defaultSize) {
|
|
1904
|
-
this.paginatorPageSize = defaultSize;
|
|
1905
|
-
}
|
|
1906
|
-
set externalPaginator(paginator) {
|
|
1907
|
-
this.extPaginator = paginator;
|
|
1908
|
-
}
|
|
1909
|
-
set paginationEnabled(isPaginationEnabled) {
|
|
1910
|
-
this.isPaginationEnabled = isPaginationEnabled;
|
|
1911
|
-
this.unsetPageSizeIfNecessary();
|
|
1912
|
-
}
|
|
1913
|
-
set allColumns(allColumns) {
|
|
1914
|
-
this.allAvailableColumns = allColumns;
|
|
1915
|
-
if (allColumns && this.showColumnModal) {
|
|
1916
|
-
this.openColumnModal();
|
|
1888
|
+
else {
|
|
1889
|
+
this.filterables.forEach((value) => (value.filterValue = null));
|
|
1917
1890
|
}
|
|
1918
1891
|
}
|
|
1919
|
-
|
|
1920
|
-
this.
|
|
1921
|
-
this.setFilterValue(undefined);
|
|
1892
|
+
createFilter() {
|
|
1893
|
+
return Array.from(this.filterables.values()).reduce((result, current) => ({ ...result, [current.id]: current.filterValue }), {});
|
|
1922
1894
|
}
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1895
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilter, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1896
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableFilter, isStandalone: true, selector: "[madFilter]", outputs: { filterChange: "madFilterChange" }, ngImport: i0 }); }
|
|
1897
|
+
}
|
|
1898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilter, decorators: [{
|
|
1899
|
+
type: Directive,
|
|
1900
|
+
args: [{
|
|
1901
|
+
selector: '[madFilter]',
|
|
1902
|
+
standalone: true,
|
|
1903
|
+
}]
|
|
1904
|
+
}], propDecorators: { filterChange: [{
|
|
1905
|
+
type: Output,
|
|
1906
|
+
args: ['madFilterChange']
|
|
1907
|
+
}] } });
|
|
1908
|
+
|
|
1909
|
+
class DataTableSortUtil {
|
|
1910
|
+
static sortData(format) {
|
|
1911
|
+
return (tableData, matSort) => [...tableData].sort((a, b) => DataTableSortUtil.compare(a, b, matSort, format));
|
|
1930
1912
|
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
this.filterPlaceholder = '';
|
|
1936
|
-
this.filterColumnsLabel = 'Filter';
|
|
1937
|
-
this.filterColumnsPlaceHolder = 'Filter available columns';
|
|
1938
|
-
this.noDataText = 'No matching data found';
|
|
1939
|
-
this.columnSettingsModalTitleLabel = 'Column settings';
|
|
1940
|
-
this.selectedLabel = 'Selected columns';
|
|
1941
|
-
this.availableLabel = 'Available columns';
|
|
1942
|
-
this.saveLabel = 'Save';
|
|
1943
|
-
this.deleteLabel = 'Delete';
|
|
1944
|
-
this.cancelLabel = 'Cancel';
|
|
1945
|
-
this.infoTextLabel = 'Drag and drop a column to select or reorder it.';
|
|
1946
|
-
this.pageSizeOptions = [5, 10, 15];
|
|
1947
|
-
this.actions = [];
|
|
1948
|
-
this.deleteDefinitionAllowed = false;
|
|
1949
|
-
this.useAsync = false;
|
|
1950
|
-
this.translateLabels = true;
|
|
1951
|
-
this.sortEvent = new EventEmitter();
|
|
1952
|
-
this.actionEvent = new EventEmitter();
|
|
1953
|
-
this.pageEvent = new EventEmitter();
|
|
1954
|
-
this.allColumnsEvent = new EventEmitter();
|
|
1955
|
-
this.columnDefinitionChangeEvent = new EventEmitter();
|
|
1956
|
-
this.viewDefinitionChangeEvent = new EventEmitter();
|
|
1957
|
-
this.ACTION_COLUMN_NAME = '__action__';
|
|
1958
|
-
this.SINGLE = DataTableActionType.SINGLE;
|
|
1959
|
-
this.BATCH = DataTableActionType.BATCH;
|
|
1960
|
-
this.NONE = DataTableActionType.NONE;
|
|
1961
|
-
this.tableActions = [];
|
|
1962
|
-
this.rowActions = [];
|
|
1963
|
-
this.columns = [];
|
|
1964
|
-
this.allSelected = false;
|
|
1965
|
-
this.rowMap = new Map();
|
|
1966
|
-
this.selectionModel = new SelectionModel(true);
|
|
1967
|
-
this.allColumnDefinitions = [];
|
|
1968
|
-
this.isFilterEnabled = false;
|
|
1969
|
-
this.isPaginationEnabled = false;
|
|
1970
|
-
this.mode = this.NONE;
|
|
1971
|
-
this.isRowClickable = false;
|
|
1972
|
-
this.showColumnModal = false;
|
|
1973
|
-
this.isLoading = false;
|
|
1974
|
-
this.paginatorLength = 0;
|
|
1975
|
-
this.paginatorPageIndex = 0;
|
|
1976
|
-
this.paginatorPageSize = 50;
|
|
1977
|
-
}
|
|
1978
|
-
static compare(a, b, sort) {
|
|
1913
|
+
static sortNothing() {
|
|
1914
|
+
return (tableData, _) => tableData;
|
|
1915
|
+
}
|
|
1916
|
+
static compare(a, b, sort, format) {
|
|
1979
1917
|
const x = a[sort.active];
|
|
1980
1918
|
const y = b[sort.active];
|
|
1981
1919
|
const ascending = sort.direction === 'asc';
|
|
1982
1920
|
switch (typeof x) {
|
|
1983
1921
|
case 'number':
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1922
|
+
if (typeof y !== 'number') {
|
|
1923
|
+
return DataTableSortUtil.compareString(String(x), y, ascending);
|
|
1924
|
+
}
|
|
1925
|
+
return DataTableSortUtil.compareNumber(x, y, ascending);
|
|
1926
|
+
case 'string': {
|
|
1927
|
+
const stringY = String(y);
|
|
1928
|
+
const dateX = DateTime.fromFormat(x, format);
|
|
1929
|
+
const dateY = DateTime.fromFormat(stringY, format);
|
|
1930
|
+
return dateX.isValid && dateY.isValid
|
|
1931
|
+
? DataTableSortUtil.compareDate(dateX, dateY, ascending)
|
|
1932
|
+
: DataTableSortUtil.compareString(x, stringY, ascending);
|
|
1933
|
+
}
|
|
1987
1934
|
case 'boolean':
|
|
1988
|
-
return
|
|
1935
|
+
return DataTableSortUtil.compareBoolean(x, y, ascending);
|
|
1989
1936
|
default:
|
|
1990
1937
|
// cannot compare -> return equal
|
|
1991
1938
|
return 0;
|
|
@@ -1994,6 +1941,9 @@ class DataTableComponent {
|
|
|
1994
1941
|
static compareNumber(x, y, ascending) {
|
|
1995
1942
|
return ascending ? x - y : y - x;
|
|
1996
1943
|
}
|
|
1944
|
+
static compareDate(x, y, ascending) {
|
|
1945
|
+
return DataTableSortUtil.compareNumber(+x, +y, ascending);
|
|
1946
|
+
}
|
|
1997
1947
|
static compareString(x, y, ascending) {
|
|
1998
1948
|
return ascending ? x.localeCompare(y) : y.localeCompare(x);
|
|
1999
1949
|
}
|
|
@@ -2010,267 +1960,1015 @@ class DataTableComponent {
|
|
|
2010
1960
|
return x ? 1 : -1;
|
|
2011
1961
|
}
|
|
2012
1962
|
}
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
class DataTableActionUtil {
|
|
1966
|
+
static getDisplayActions(actions, selectionMode) {
|
|
1967
|
+
const rowActions = [];
|
|
1968
|
+
const tableActions = [];
|
|
1969
|
+
for (const action of actions) {
|
|
1970
|
+
if (selectionMode !== action.hiddenInMode) {
|
|
1971
|
+
switch (action.type) {
|
|
1972
|
+
case 'SINGLE':
|
|
1973
|
+
if (selectionMode === 'SINGLE') {
|
|
1974
|
+
rowActions.push(action);
|
|
1975
|
+
}
|
|
1976
|
+
else {
|
|
1977
|
+
tableActions.push(action);
|
|
1978
|
+
}
|
|
1979
|
+
break;
|
|
1980
|
+
case 'BATCH':
|
|
1981
|
+
if (selectionMode !== 'SINGLE') {
|
|
1982
|
+
tableActions.push(action);
|
|
1983
|
+
}
|
|
1984
|
+
break;
|
|
1985
|
+
default:
|
|
1986
|
+
tableActions.push(action);
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
return {
|
|
1991
|
+
rowActions: rowActions,
|
|
1992
|
+
groupedTableActions: DataTableActionUtil.getGroupedTableActions(tableActions),
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
static getGroupedTableActions(tableActions) {
|
|
1996
|
+
return Object.values(tableActions.reduce((result, current) => {
|
|
1997
|
+
const index = Object.entries(result).findIndex(([, actions]) => actions.find((it) => !!current.groupId && it.groupId === current.groupId));
|
|
1998
|
+
const key = index !== -1 ? index : Object.keys(result).length || 0;
|
|
1999
|
+
(result[key] = result[key] || []).push(current);
|
|
2000
|
+
return result;
|
|
2001
|
+
}, {}));
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
class DataTableDataUtil {
|
|
2006
|
+
static updateRowMap(rowMap, data, columns, idGenerator, parentIdGenerator) {
|
|
2007
|
+
rowMap.clear();
|
|
2008
|
+
data?.forEach((it) => {
|
|
2009
|
+
const rowId = DataTableDataUtil.createRowId(it, idGenerator);
|
|
2010
|
+
const dataRow = DataTableDataUtil.createDataTableRow(it, rowId, parentIdGenerator, columns);
|
|
2011
|
+
rowMap.set(rowId, dataRow);
|
|
2012
|
+
});
|
|
2013
|
+
return rowMap;
|
|
2014
|
+
}
|
|
2015
|
+
static createRowId(data, idGenerator) {
|
|
2016
|
+
let id;
|
|
2017
|
+
if (!!idGenerator) {
|
|
2018
|
+
id = idGenerator(data);
|
|
2019
|
+
}
|
|
2020
|
+
return (!!id ? id : v4()).toString();
|
|
2021
|
+
}
|
|
2022
|
+
static createDataTableRow(data, rowId, parentIdGenerator, columns) {
|
|
2023
|
+
const parentId = parentIdGenerator ? parentIdGenerator(data) : undefined;
|
|
2024
|
+
const displayedData = DataTableDataUtil.createDisplayedData(rowId, parentId, data, columns);
|
|
2025
|
+
const dataRow = {
|
|
2026
|
+
id: rowId,
|
|
2027
|
+
parentId: parentId,
|
|
2028
|
+
actualData: data,
|
|
2029
|
+
displayedData: displayedData,
|
|
2030
|
+
};
|
|
2031
|
+
return dataRow;
|
|
2032
|
+
}
|
|
2033
|
+
static createDisplayedData(rowId, parentId, actualDataElement, columns) {
|
|
2034
|
+
const displayedData = {};
|
|
2035
|
+
displayedData['rowId'] = rowId;
|
|
2036
|
+
displayedData['parentId'] = parentId;
|
|
2037
|
+
// keep non displayed data in row
|
|
2038
|
+
for (const key of Object.keys(actualDataElement)) {
|
|
2039
|
+
const column = columns.find((it) => it.dataPropertyName === key);
|
|
2040
|
+
const actualValue = actualDataElement[key];
|
|
2041
|
+
displayedData[key] = DataTableDataUtil.transformData(actualValue, column?.transformer, column?.transformerParams);
|
|
2042
|
+
}
|
|
2043
|
+
return displayedData;
|
|
2044
|
+
}
|
|
2013
2045
|
static transformData(value, transformer, transformerParams) {
|
|
2014
2046
|
if (!transformer || !(transformer instanceof Function)) {
|
|
2015
2047
|
return value;
|
|
2016
2048
|
}
|
|
2017
2049
|
return transformer(value, transformerParams);
|
|
2018
2050
|
}
|
|
2019
|
-
|
|
2020
|
-
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
class DataTableFilterUtil {
|
|
2054
|
+
static columnBasedFilterPredicate(rowMap) {
|
|
2055
|
+
return (row, filterString) => {
|
|
2056
|
+
const actualData = rowMap.get(row.rowId)?.actualData;
|
|
2057
|
+
const displayedData = row;
|
|
2058
|
+
const filters = JSON.parse(filterString);
|
|
2059
|
+
return Object.entries(filters).every(([key, value]) => !value || this.contains(actualData, key, value) || this.contains(displayedData, key, value));
|
|
2060
|
+
};
|
|
2021
2061
|
}
|
|
2022
|
-
static
|
|
2023
|
-
return
|
|
2062
|
+
static tableBasedFilterPredicate() {
|
|
2063
|
+
return (data, filter) => {
|
|
2064
|
+
const transform = (str) => str
|
|
2065
|
+
.trim()
|
|
2066
|
+
.toLowerCase()
|
|
2067
|
+
.replace(/^"(.*)"$/, '$1');
|
|
2068
|
+
const dataStr = transform(JSON.stringify(data));
|
|
2069
|
+
return dataStr.indexOf(transform(filter)) != -1;
|
|
2070
|
+
};
|
|
2024
2071
|
}
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
this.setActions();
|
|
2028
|
-
if (this.mode !== this.NONE) {
|
|
2029
|
-
this.isRowClickable = true;
|
|
2030
|
-
this.defaultAction = this.rowActions[0];
|
|
2031
|
-
}
|
|
2072
|
+
static contains(data, key, searchTerm) {
|
|
2073
|
+
return (String(data[key]) ?? '').toLowerCase().includes(searchTerm.toLowerCase());
|
|
2032
2074
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
class DataTablePersistenceService {
|
|
2078
|
+
constructor() {
|
|
2079
|
+
this.sortKey = 'sort';
|
|
2080
|
+
this.filterKey = 'filter';
|
|
2081
|
+
this.pageSizeKey = 'pageSize';
|
|
2038
2082
|
}
|
|
2039
|
-
|
|
2040
|
-
this.
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2083
|
+
saveSort(tableId, sort) {
|
|
2084
|
+
this.save(this.getId(tableId, this.sortKey), sort);
|
|
2085
|
+
}
|
|
2086
|
+
loadSort(tableId) {
|
|
2087
|
+
return this.load(this.getId(tableId, this.sortKey));
|
|
2088
|
+
}
|
|
2089
|
+
saveFilter(tableId, filter) {
|
|
2090
|
+
this.save(this.getId(tableId, this.filterKey), filter);
|
|
2091
|
+
}
|
|
2092
|
+
loadFilter(tableId) {
|
|
2093
|
+
return this.load(this.getId(tableId, this.filterKey));
|
|
2094
|
+
}
|
|
2095
|
+
savePageSize(tableId, pageSize) {
|
|
2096
|
+
this.save(this.getId(tableId, this.pageSizeKey), pageSize);
|
|
2097
|
+
}
|
|
2098
|
+
loadPageSize(tableId) {
|
|
2099
|
+
return this.load(this.getId(tableId, this.pageSizeKey));
|
|
2100
|
+
}
|
|
2101
|
+
save(id, item) {
|
|
2102
|
+
if (!!item) {
|
|
2103
|
+
localStorage.setItem(id, JSON.stringify(item));
|
|
2044
2104
|
}
|
|
2045
2105
|
else {
|
|
2046
|
-
|
|
2047
|
-
this.allColumnsEvent.emit();
|
|
2106
|
+
localStorage.removeItem(id);
|
|
2048
2107
|
}
|
|
2049
2108
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2109
|
+
load(id) {
|
|
2110
|
+
const item = localStorage.getItem(id);
|
|
2111
|
+
return !!item ? JSON.parse(item) : undefined;
|
|
2053
2112
|
}
|
|
2054
|
-
|
|
2055
|
-
return
|
|
2113
|
+
getId(tableId, key) {
|
|
2114
|
+
return `${tableId}.${key}`;
|
|
2056
2115
|
}
|
|
2057
|
-
|
|
2058
|
-
|
|
2116
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTablePersistenceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2117
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTablePersistenceService, providedIn: 'root' }); }
|
|
2118
|
+
}
|
|
2119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTablePersistenceService, decorators: [{
|
|
2120
|
+
type: Injectable,
|
|
2121
|
+
args: [{
|
|
2122
|
+
providedIn: 'root',
|
|
2123
|
+
}]
|
|
2124
|
+
}] });
|
|
2125
|
+
const MAD_DATA_TABLE_PERSISTENCE_SERVICE = new InjectionToken('mad-data-table-persistence-service');
|
|
2126
|
+
function DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER_FACTORY(persistenceService) {
|
|
2127
|
+
return persistenceService || new DataTablePersistenceService();
|
|
2128
|
+
}
|
|
2129
|
+
const DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER = {
|
|
2130
|
+
// If there is a custom DataTablePersistenceService available, use that. Otherwise, provide the "local storage" default one.
|
|
2131
|
+
provide: MAD_DATA_TABLE_PERSISTENCE_SERVICE,
|
|
2132
|
+
deps: [[new Optional(), new SkipSelf(), new Inject(MAD_DATA_TABLE_PERSISTENCE_SERVICE)]],
|
|
2133
|
+
useFactory: DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER_FACTORY,
|
|
2134
|
+
};
|
|
2135
|
+
|
|
2136
|
+
const MAD_DATA_TABLE_GLOBAL_CONFIGURATION = new InjectionToken('mad-data-table-global-configuration');
|
|
2137
|
+
// If there is a custom DATA_TABLE_CONFIG_PROVIDER available, use that. Otherwise, provide the default one.
|
|
2138
|
+
const MAD_DATA_TABL_GLOBAL_CONFIGURATION_PROVIDER = {
|
|
2139
|
+
provide: MAD_DATA_TABLE_GLOBAL_CONFIGURATION,
|
|
2140
|
+
deps: [[new Optional(), new SkipSelf(), new Inject(MAD_DATA_TABLE_GLOBAL_CONFIGURATION)]],
|
|
2141
|
+
useFactory: (dataTableConfig) => dataTableConfig ?? {
|
|
2142
|
+
dateTimeFormat: 'dd.MM.yyyy',
|
|
2143
|
+
},
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
class DataTableFilterDialogComponent {
|
|
2147
|
+
set filterValue(value) {
|
|
2148
|
+
this.control.setValue(value);
|
|
2059
2149
|
}
|
|
2060
|
-
|
|
2061
|
-
|
|
2150
|
+
constructor() {
|
|
2151
|
+
this.filterChanged = new EventEmitter();
|
|
2152
|
+
this.control = new FormControl(null);
|
|
2153
|
+
this._subscription = new Subscription();
|
|
2154
|
+
this._subscription.add(this.control.valueChanges.subscribe((value) => this.filterChanged.emit(value)));
|
|
2062
2155
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2156
|
+
ngOnDestroy() {
|
|
2157
|
+
this._subscription.unsubscribe();
|
|
2065
2158
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilterDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2160
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DataTableFilterDialogComponent, isStandalone: true, selector: "mad-data-table-filter-dialog", inputs: { filterOptions: "filterOptions", filterValue: "filterValue" }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: "<div class=\"filter-dialog-box\">\n <ng-container *ngIf=\"!filterOptions?.length; else selectInput\">\n <mat-form-field class=\"filter-dialog-input\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <input matInput type=\"text\" required=\"false\" [formControl]=\"control\" />\n </mat-form-field>\n </ng-container>\n</div>\n\n<ng-template #selectInput>\n <mat-form-field class=\"filter-dialog-input\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <mat-select [formControl]=\"control\">\n <mat-option></mat-option>\n <mat-option *ngFor=\"let entry of filterOptions\" [value]=\"entry.key\">{{ entry.label }}</mat-option>\n </mat-select>\n </mat-form-field>\n</ng-template>\n", styles: [".container{position:relative;width:12px;height:12px;margin:5px 0 5px 5px}.overlay{position:absolute;width:12px;height:12px;background-color:#fff;display:flex;align-items:center}.mat-icon{position:relative;display:flex;align-items:center;font-size:1em;color:#757575}.filter-dialog-box{display:flex;align-items:center;width:auto;height:80px;padding:12px 12px 0;margin-top:22px;background-color:#fff;box-shadow:0 1px 3px #0000000d}.filter-dialog-input{width:auto;max-width:180px;margin:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "aria-describedby", "panelClass", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] }); }
|
|
2161
|
+
}
|
|
2162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilterDialogComponent, decorators: [{
|
|
2163
|
+
type: Component,
|
|
2164
|
+
args: [{ selector: 'mad-data-table-filter-dialog', standalone: true, imports: [CommonModule, MatFormFieldModule, MatInputModule, MatSelectModule, FormsModule, ReactiveFormsModule, TranslateModule], template: "<div class=\"filter-dialog-box\">\n <ng-container *ngIf=\"!filterOptions?.length; else selectInput\">\n <mat-form-field class=\"filter-dialog-input\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <input matInput type=\"text\" required=\"false\" [formControl]=\"control\" />\n </mat-form-field>\n </ng-container>\n</div>\n\n<ng-template #selectInput>\n <mat-form-field class=\"filter-dialog-input\">\n <mat-label>{{ 'common.filter.term' | translate }}</mat-label>\n <mat-select [formControl]=\"control\">\n <mat-option></mat-option>\n <mat-option *ngFor=\"let entry of filterOptions\" [value]=\"entry.key\">{{ entry.label }}</mat-option>\n </mat-select>\n </mat-form-field>\n</ng-template>\n", styles: [".container{position:relative;width:12px;height:12px;margin:5px 0 5px 5px}.overlay{position:absolute;width:12px;height:12px;background-color:#fff;display:flex;align-items:center}.mat-icon{position:relative;display:flex;align-items:center;font-size:1em;color:#757575}.filter-dialog-box{display:flex;align-items:center;width:auto;height:80px;padding:12px 12px 0;margin-top:22px;background-color:#fff;box-shadow:0 1px 3px #0000000d}.filter-dialog-input{width:auto;max-width:180px;margin:auto}\n"] }]
|
|
2165
|
+
}], ctorParameters: () => [], propDecorators: { filterOptions: [{
|
|
2166
|
+
type: Input
|
|
2167
|
+
}], filterValue: [{
|
|
2168
|
+
type: Input
|
|
2169
|
+
}], filterChanged: [{
|
|
2170
|
+
type: Output
|
|
2171
|
+
}] } });
|
|
2172
|
+
|
|
2173
|
+
class FilterComponent {
|
|
2174
|
+
constructor(elementRef) {
|
|
2175
|
+
this.elementRef = elementRef;
|
|
2176
|
+
this.filterValueChange = new EventEmitter();
|
|
2072
2177
|
}
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
return this.selectedCount !== 1;
|
|
2077
|
-
case this.BATCH:
|
|
2078
|
-
return this.selectedCount < 1;
|
|
2079
|
-
default:
|
|
2080
|
-
return false;
|
|
2081
|
-
}
|
|
2178
|
+
toggleFilter(event) {
|
|
2179
|
+
event.preventDefault();
|
|
2180
|
+
this.showFilterDialog = !this.showFilterDialog;
|
|
2082
2181
|
}
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
this.
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
this.
|
|
2091
|
-
if (!row.parentId) {
|
|
2092
|
-
this.selectionModel.select('' + row.rowId);
|
|
2093
|
-
}
|
|
2094
|
-
});
|
|
2182
|
+
onFilterChanged(filterValue) {
|
|
2183
|
+
this.isActive = !!filterValue;
|
|
2184
|
+
this.filterValue = filterValue;
|
|
2185
|
+
this.filterValueChange.emit(this.filterValue);
|
|
2186
|
+
}
|
|
2187
|
+
onClick(event) {
|
|
2188
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
2189
|
+
this.showFilterDialog = false;
|
|
2095
2190
|
}
|
|
2096
2191
|
}
|
|
2097
|
-
|
|
2098
|
-
return this.
|
|
2192
|
+
get opacity() {
|
|
2193
|
+
return this.isActive ? '1' : this.isHovered || this.showFilterDialog ? '0.54' : '0';
|
|
2099
2194
|
}
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2195
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: FilterComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2196
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: FilterComponent, isStandalone: true, selector: "mad-data-table-filter", outputs: { filterValueChange: "filterValueChange" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0, template: "<div class=\"container\">\n <div class=\"overlay\" [style.opacity]=\"opacity\">\n <mat-icon fontSet=\"material-icons-outlined\" (click)=\"toggleFilter($event)\">filter_alt</mat-icon>\n </div>\n <mad-data-table-filter-dialog\n class=\"filter-dialog\"\n [filterOptions]=\"filterOptions\"\n [hidden]=\"!showFilterDialog\"\n [filterValue]=\"filterValue\"\n (filterChanged)=\"onFilterChanged($event)\"\n />\n</div>\n", styles: [".container{position:relative;width:12px;height:12px}.overlay{position:absolute;width:12px;height:12px;background-color:#fff;display:flex;align-items:center}.mat-icon{position:relative;display:flex;align-items:center;font-size:1em;color:#757575}.filter-dialog{position:absolute;margin-top:12px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: DataTableFilterDialogComponent, selector: "mad-data-table-filter-dialog", inputs: ["filterOptions", "filterValue"], outputs: ["filterChanged"] }] }); }
|
|
2197
|
+
}
|
|
2198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: FilterComponent, decorators: [{
|
|
2199
|
+
type: Component,
|
|
2200
|
+
args: [{ selector: 'mad-data-table-filter', standalone: true, imports: [CommonModule, MatIconModule, DataTableFilterDialogComponent], template: "<div class=\"container\">\n <div class=\"overlay\" [style.opacity]=\"opacity\">\n <mat-icon fontSet=\"material-icons-outlined\" (click)=\"toggleFilter($event)\">filter_alt</mat-icon>\n </div>\n <mad-data-table-filter-dialog\n class=\"filter-dialog\"\n [filterOptions]=\"filterOptions\"\n [hidden]=\"!showFilterDialog\"\n [filterValue]=\"filterValue\"\n (filterChanged)=\"onFilterChanged($event)\"\n />\n</div>\n", styles: [".container{position:relative;width:12px;height:12px}.overlay{position:absolute;width:12px;height:12px;background-color:#fff;display:flex;align-items:center}.mat-icon{position:relative;display:flex;align-items:center;font-size:1em;color:#757575}.filter-dialog{position:absolute;margin-top:12px}\n"] }]
|
|
2201
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { filterValueChange: [{
|
|
2202
|
+
type: Output
|
|
2203
|
+
}], onClick: [{
|
|
2204
|
+
type: HostListener,
|
|
2205
|
+
args: ['document:click', ['$event']]
|
|
2206
|
+
}] } });
|
|
2207
|
+
|
|
2208
|
+
class DataTableFilterHeader {
|
|
2209
|
+
set madFilterOptions(filterOptions) {
|
|
2210
|
+
this._filterOptions = filterOptions || [];
|
|
2104
2211
|
}
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
break;
|
|
2113
|
-
case this.SINGLE:
|
|
2114
|
-
// emit the default action if the row (not the icon!) was clicked
|
|
2115
|
-
if (!!action && !DataTableComponent.isClickOnRowMenuIcon(event)) {
|
|
2116
|
-
const selected = [];
|
|
2117
|
-
// if ID-generator is provided, return the ID, else return the ACTUAL data
|
|
2118
|
-
selected.push(this.idGenerator ? row.rowId : this.rowMap.get(row.rowId)?.actualData);
|
|
2119
|
-
this.emitTableAction(action, selected);
|
|
2120
|
-
}
|
|
2121
|
-
break;
|
|
2122
|
-
default:
|
|
2123
|
-
// do nothing if mode is NONE (or null)
|
|
2124
|
-
return;
|
|
2125
|
-
}
|
|
2212
|
+
constructor(element, viewContainerRef, renderer, madFilter, matSortHeader) {
|
|
2213
|
+
this.element = element;
|
|
2214
|
+
this.viewContainerRef = viewContainerRef;
|
|
2215
|
+
this.renderer = renderer;
|
|
2216
|
+
this.madFilter = madFilter;
|
|
2217
|
+
this.matSortHeader = matSortHeader;
|
|
2218
|
+
this._subscription = new Subscription();
|
|
2126
2219
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2220
|
+
ngOnInit() {
|
|
2221
|
+
this._filterComponent = this.viewContainerRef.createComponent(FilterComponent);
|
|
2222
|
+
this._filterComponent.instance.filterOptions = this._filterOptions;
|
|
2223
|
+
this._filterComponent.changeDetectorRef.detectChanges();
|
|
2224
|
+
this.insertFilterComponent();
|
|
2225
|
+
this.observeFilterComponent();
|
|
2226
|
+
}
|
|
2227
|
+
ngAfterViewInit() {
|
|
2228
|
+
if (!!this.matSortHeader) {
|
|
2229
|
+
const reference = this.matSortHeader._handleClick.bind(this.matSortHeader);
|
|
2230
|
+
this.matSortHeader._handleClick = () => { };
|
|
2231
|
+
this.findArrow(this.element.nativeElement).addEventListener('click', reference);
|
|
2130
2232
|
}
|
|
2131
|
-
|
|
2132
|
-
this.
|
|
2233
|
+
if (!!this.madFilter) {
|
|
2234
|
+
this.madFilter.register(this);
|
|
2133
2235
|
}
|
|
2134
2236
|
}
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
}
|
|
2237
|
+
ngOnDestroy() {
|
|
2238
|
+
this._subscription.unsubscribe();
|
|
2239
|
+
this.madFilter.unregister(this);
|
|
2139
2240
|
}
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
}
|
|
2146
|
-
tableAction.selected = selection;
|
|
2147
|
-
this.actionEvent.emit(tableAction);
|
|
2148
|
-
}
|
|
2241
|
+
observeFilterComponent() {
|
|
2242
|
+
this._subscription.add(this._filterComponent.instance.filterValueChange.subscribe((value) => {
|
|
2243
|
+
this._filterValue = value;
|
|
2244
|
+
this.madFilter.changeFilter();
|
|
2245
|
+
}));
|
|
2149
2246
|
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
if (action.type !== this.NONE) {
|
|
2153
|
-
emitAction.selected = [...selected];
|
|
2154
|
-
}
|
|
2155
|
-
this.actionEvent.emit(emitAction);
|
|
2247
|
+
get filterValue() {
|
|
2248
|
+
return this._filterValue;
|
|
2156
2249
|
}
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
displayedDataElement.parentId = parentId;
|
|
2161
|
-
for (const column of this.columns) {
|
|
2162
|
-
const actualValue = actualDataElement[column.dataPropertyName];
|
|
2163
|
-
displayedDataElement[column.dataPropertyName] = DataTableComponent.transformData(actualValue, column.transformer, column.transformerParams);
|
|
2164
|
-
}
|
|
2165
|
-
return displayedDataElement;
|
|
2250
|
+
set filterValue(filterValue) {
|
|
2251
|
+
this._filterComponent.instance.filterValue = filterValue;
|
|
2252
|
+
this._filterComponent.changeDetectorRef.detectChanges();
|
|
2166
2253
|
}
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
this.dataSource.data = [...sortedData];
|
|
2254
|
+
onMouseenter() {
|
|
2255
|
+
this._filterComponent.instance.isHovered = true;
|
|
2170
2256
|
}
|
|
2171
|
-
|
|
2172
|
-
this.
|
|
2173
|
-
this.tableActions = [];
|
|
2174
|
-
for (const action of this.actions) {
|
|
2175
|
-
if (this.mode !== action.hiddenInMode) {
|
|
2176
|
-
switch (action.type) {
|
|
2177
|
-
case this.SINGLE:
|
|
2178
|
-
if (this.mode === this.SINGLE) {
|
|
2179
|
-
this.rowActions.push(action);
|
|
2180
|
-
}
|
|
2181
|
-
else {
|
|
2182
|
-
this.tableActions.push(action);
|
|
2183
|
-
}
|
|
2184
|
-
break;
|
|
2185
|
-
case this.BATCH:
|
|
2186
|
-
if (this.mode !== this.SINGLE) {
|
|
2187
|
-
this.tableActions.push(action);
|
|
2188
|
-
}
|
|
2189
|
-
break;
|
|
2190
|
-
default:
|
|
2191
|
-
this.tableActions.push(action);
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2257
|
+
onMouseleave() {
|
|
2258
|
+
this._filterComponent.instance.isHovered = false;
|
|
2195
2259
|
}
|
|
2196
|
-
|
|
2197
|
-
const
|
|
2198
|
-
this.
|
|
2199
|
-
if (
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2260
|
+
insertFilterComponent() {
|
|
2261
|
+
const componentNativeElement = this._filterComponent.location.nativeElement;
|
|
2262
|
+
const div = this.getWrappedHeader();
|
|
2263
|
+
if (!!this.matSortHeader) {
|
|
2264
|
+
const sortHeader = div.firstChild;
|
|
2265
|
+
this.renderer.insertBefore(sortHeader, componentNativeElement, sortHeader.firstChild.nextSibling);
|
|
2266
|
+
}
|
|
2267
|
+
else {
|
|
2268
|
+
this.renderer.appendChild(div, componentNativeElement);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
getWrappedHeader() {
|
|
2272
|
+
const headerContent = this.element.nativeElement.firstChild;
|
|
2273
|
+
this.renderer.removeChild(this.element.nativeElement, headerContent);
|
|
2274
|
+
const div = this.renderer.createElement('div');
|
|
2275
|
+
this.renderer.setStyle(div, 'display', 'flex');
|
|
2276
|
+
this.renderer.setStyle(div, 'align-items', 'center');
|
|
2277
|
+
if (this.madFilterColumnRightAligned) {
|
|
2278
|
+
this.renderer.setStyle(div, 'justify-content', 'flex-end');
|
|
2279
|
+
this.renderer.setStyle(headerContent.firstChild, 'justify-content', 'flex-end');
|
|
2280
|
+
}
|
|
2281
|
+
this.renderer.appendChild(div, headerContent);
|
|
2282
|
+
this.renderer.appendChild(this.element.nativeElement, div);
|
|
2283
|
+
return div;
|
|
2284
|
+
}
|
|
2285
|
+
findArrow(element) {
|
|
2286
|
+
return this.isArrowElement(element) ? element : this.findArrowInList(element.children);
|
|
2287
|
+
}
|
|
2288
|
+
findArrowInList(nativeElements) {
|
|
2289
|
+
for (let nativeElement of Array.from(nativeElements)) {
|
|
2290
|
+
const foundElement = this.findArrow(nativeElement);
|
|
2291
|
+
if (!!foundElement) {
|
|
2292
|
+
return foundElement;
|
|
2212
2293
|
}
|
|
2213
2294
|
}
|
|
2214
|
-
|
|
2215
|
-
this.unsetPageSizeIfNecessary();
|
|
2295
|
+
return null;
|
|
2216
2296
|
}
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2297
|
+
isArrowElement(nativeElement) {
|
|
2298
|
+
return nativeElement.classList.contains('mat-sort-header-arrow');
|
|
2299
|
+
}
|
|
2300
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilterHeader, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: DataTableFilter, optional: true }, { token: i7.MatSortHeader, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2301
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableFilterHeader, isStandalone: true, selector: "th[mad-filter-header]", inputs: { id: ["mad-filter-header", "id"], madFilterColumnRightAligned: "madFilterColumnRightAligned", madFilterOptions: "madFilterOptions" }, host: { listeners: { "mouseenter": "onMouseenter()", "mouseleave": "onMouseleave()" } }, ngImport: i0 }); }
|
|
2302
|
+
}
|
|
2303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableFilterHeader, decorators: [{
|
|
2304
|
+
type: Directive,
|
|
2305
|
+
args: [{
|
|
2306
|
+
selector: 'th[mad-filter-header]',
|
|
2307
|
+
standalone: true,
|
|
2308
|
+
}]
|
|
2309
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: DataTableFilter, decorators: [{
|
|
2310
|
+
type: Optional
|
|
2311
|
+
}] }, { type: i7.MatSortHeader, decorators: [{
|
|
2312
|
+
type: Optional
|
|
2313
|
+
}] }], propDecorators: { id: [{
|
|
2314
|
+
type: Input,
|
|
2315
|
+
args: ['mad-filter-header']
|
|
2316
|
+
}], madFilterColumnRightAligned: [{
|
|
2317
|
+
type: Input
|
|
2318
|
+
}], madFilterOptions: [{
|
|
2319
|
+
type: Input
|
|
2320
|
+
}], onMouseenter: [{
|
|
2321
|
+
type: HostListener,
|
|
2322
|
+
args: ['mouseenter']
|
|
2323
|
+
}], onMouseleave: [{
|
|
2324
|
+
type: HostListener,
|
|
2325
|
+
args: ['mouseleave']
|
|
2326
|
+
}] } });
|
|
2327
|
+
|
|
2328
|
+
class DataTableTemplateColumnDefinition {
|
|
2329
|
+
register(cellDef) {
|
|
2330
|
+
this.cellDef = cellDef;
|
|
2331
|
+
}
|
|
2332
|
+
unregister() {
|
|
2333
|
+
this.cellDef = null;
|
|
2334
|
+
}
|
|
2335
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateColumnDefinition, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2336
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableTemplateColumnDefinition, isStandalone: true, selector: "[madColumnDef]", inputs: { madColumnDef: "madColumnDef" }, ngImport: i0 }); }
|
|
2337
|
+
}
|
|
2338
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateColumnDefinition, decorators: [{
|
|
2339
|
+
type: Directive,
|
|
2340
|
+
args: [{
|
|
2341
|
+
selector: '[madColumnDef]',
|
|
2342
|
+
standalone: true,
|
|
2343
|
+
}]
|
|
2344
|
+
}], propDecorators: { madColumnDef: [{
|
|
2345
|
+
type: Input
|
|
2346
|
+
}] } });
|
|
2347
|
+
|
|
2348
|
+
class DataTableTemplateCellDefinition {
|
|
2349
|
+
constructor(templateRef, columnDef) {
|
|
2350
|
+
this.templateRef = templateRef;
|
|
2351
|
+
this.columnDef = columnDef;
|
|
2352
|
+
}
|
|
2353
|
+
ngOnInit() {
|
|
2354
|
+
this.columnDef.register(this);
|
|
2355
|
+
}
|
|
2356
|
+
ngOnDestroy() {
|
|
2357
|
+
this.columnDef.unregister();
|
|
2358
|
+
}
|
|
2359
|
+
getCellTemplate() {
|
|
2360
|
+
return this.templateRef;
|
|
2361
|
+
}
|
|
2362
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateCellDefinition, deps: [{ token: i0.TemplateRef }, { token: DataTableTemplateColumnDefinition }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2363
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableTemplateCellDefinition, isStandalone: true, selector: "[madCellDef]", ngImport: i0 }); }
|
|
2364
|
+
}
|
|
2365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateCellDefinition, decorators: [{
|
|
2366
|
+
type: Directive,
|
|
2367
|
+
args: [{
|
|
2368
|
+
selector: '[madCellDef]',
|
|
2369
|
+
standalone: true,
|
|
2370
|
+
}]
|
|
2371
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: DataTableTemplateColumnDefinition }] });
|
|
2372
|
+
|
|
2373
|
+
class DataTableTemplateExpandableColumnDefinition {
|
|
2374
|
+
register(cellDef) {
|
|
2375
|
+
this.cellDef = cellDef;
|
|
2376
|
+
}
|
|
2377
|
+
unregister() {
|
|
2378
|
+
this.cellDef = null;
|
|
2379
|
+
}
|
|
2380
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateExpandableColumnDefinition, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2381
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableTemplateExpandableColumnDefinition, isStandalone: true, selector: "[madExpandableColumnDef]", inputs: { madExpandableColumnDef: "madExpandableColumnDef" }, ngImport: i0 }); }
|
|
2382
|
+
}
|
|
2383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateExpandableColumnDefinition, decorators: [{
|
|
2384
|
+
type: Directive,
|
|
2385
|
+
args: [{
|
|
2386
|
+
selector: '[madExpandableColumnDef]',
|
|
2387
|
+
standalone: true,
|
|
2388
|
+
}]
|
|
2389
|
+
}], propDecorators: { madExpandableColumnDef: [{
|
|
2390
|
+
type: Input
|
|
2391
|
+
}] } });
|
|
2392
|
+
|
|
2393
|
+
class DataTableTemplateExpandableCellDefinition {
|
|
2394
|
+
constructor(templateRef, columnDef) {
|
|
2395
|
+
this.templateRef = templateRef;
|
|
2396
|
+
this.columnDef = columnDef;
|
|
2397
|
+
}
|
|
2398
|
+
ngOnInit() {
|
|
2399
|
+
this.columnDef.register(this);
|
|
2400
|
+
}
|
|
2401
|
+
ngOnDestroy() {
|
|
2402
|
+
this.columnDef.unregister();
|
|
2403
|
+
}
|
|
2404
|
+
getCellTemplate() {
|
|
2405
|
+
return this.templateRef;
|
|
2406
|
+
}
|
|
2407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateExpandableCellDefinition, deps: [{ token: i0.TemplateRef }, { token: DataTableTemplateExpandableColumnDefinition }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2408
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: DataTableTemplateExpandableCellDefinition, isStandalone: true, selector: "[madExpandableCellDef]", ngImport: i0 }); }
|
|
2409
|
+
}
|
|
2410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableTemplateExpandableCellDefinition, decorators: [{
|
|
2411
|
+
type: Directive,
|
|
2412
|
+
args: [{
|
|
2413
|
+
selector: '[madExpandableCellDef]',
|
|
2414
|
+
standalone: true,
|
|
2415
|
+
}]
|
|
2416
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: DataTableTemplateExpandableColumnDefinition }] });
|
|
2417
|
+
|
|
2418
|
+
class DataTableComponent {
|
|
2419
|
+
set useAsync(useAsync) {
|
|
2420
|
+
this._useAsync = useAsync;
|
|
2421
|
+
this.applySortData();
|
|
2422
|
+
}
|
|
2423
|
+
set selection(selection) {
|
|
2424
|
+
this._selection = selection;
|
|
2425
|
+
this.updateSelectionModel(selection);
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* @deprecated
|
|
2429
|
+
* Please use "filterMode" instead
|
|
2430
|
+
*/
|
|
2431
|
+
set filterEnabled(isFilterEnabled) {
|
|
2432
|
+
this._filterMode = isFilterEnabled ? 'TABLE_BASED' : 'NONE';
|
|
2433
|
+
this.applyFilterPredicate();
|
|
2434
|
+
}
|
|
2435
|
+
set filterMode(filterMode) {
|
|
2436
|
+
this._filterMode = filterMode;
|
|
2437
|
+
this.applyFilterPredicate();
|
|
2438
|
+
}
|
|
2439
|
+
set filterValue(filterValue) {
|
|
2440
|
+
this._filterValue = filterValue;
|
|
2441
|
+
this.applyFilterValue(this._filterValue);
|
|
2442
|
+
}
|
|
2443
|
+
set externalPaginator(paginator) {
|
|
2444
|
+
this.extPaginator = paginator;
|
|
2445
|
+
}
|
|
2446
|
+
set defaultPageSize(defaultSize) {
|
|
2447
|
+
this.page = {
|
|
2448
|
+
...this.page,
|
|
2449
|
+
pageSize: defaultSize,
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
set selectionEmitMode(selectionEmitMode) {
|
|
2453
|
+
this._selectionEmitMode = selectionEmitMode;
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* @deprecated
|
|
2457
|
+
* This function mixes up 2 responsibilities:
|
|
2458
|
+
* - determining if actions should be displayed / handled
|
|
2459
|
+
* - determining whether actions are row based (single) or table based (batch)
|
|
2460
|
+
* Please use a combination of "selectionEmitMode" and "selectionMode" instead:
|
|
2461
|
+
* - selectionEmitMode determines how selected items are handled (as part of actions, as selections or not at all)
|
|
2462
|
+
* - selectionMode determines if selected items are treated separately (single) or together (batch)
|
|
2463
|
+
*/
|
|
2464
|
+
set forceMode(selectionMode) {
|
|
2465
|
+
if (selectionMode === 'SINGLE' || selectionMode === 'BATCH') {
|
|
2466
|
+
this._selectionEmitMode = 'ON_ACTION';
|
|
2467
|
+
this._forceSelectionMode = selectionMode;
|
|
2468
|
+
this._selectionModel.clear();
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
set forceSelectionMode(selectionMode) {
|
|
2472
|
+
this._forceSelectionMode = selectionMode;
|
|
2473
|
+
this._selectionModel.clear();
|
|
2474
|
+
}
|
|
2475
|
+
set displayedColumns(cols) {
|
|
2476
|
+
if (!this.displayedColumnDefinition) {
|
|
2477
|
+
this.columns = cols ? [...cols] : [];
|
|
2478
|
+
this.columnIds = this.columns.map((column) => column.id);
|
|
2479
|
+
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
set displayedColumnDefinition(def) {
|
|
2483
|
+
this.columns = def.displayedColumns;
|
|
2484
|
+
this.columnIds = this.columns.map((column) => column.id);
|
|
2485
|
+
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
2486
|
+
this._selectedColumnDefinition = def;
|
|
2487
|
+
}
|
|
2488
|
+
set columnDefinitions(definitions) {
|
|
2489
|
+
this.editableColumnDefinitions = [];
|
|
2490
|
+
this.viewableColumnDefinitions = [];
|
|
2491
|
+
this._allColumnDefinitions = [...definitions];
|
|
2492
|
+
for (const definition of definitions) {
|
|
2493
|
+
if (definition.editable) {
|
|
2494
|
+
this.editableColumnDefinitions.push(definition);
|
|
2495
|
+
}
|
|
2496
|
+
if (definition.displayedColumns?.length > 0) {
|
|
2497
|
+
this.viewableColumnDefinitions.push(definition);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
set allColumns(allColumns) {
|
|
2502
|
+
this._allAvailableColumns = allColumns;
|
|
2503
|
+
if (allColumns && this._showColumnModal) {
|
|
2504
|
+
this.openColumnModal();
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
constructor(changeDetectorRef, matDialog, persistenceService, dataTableGlobalConfig) {
|
|
2508
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
2509
|
+
this.matDialog = matDialog;
|
|
2510
|
+
this.persistenceService = persistenceService;
|
|
2511
|
+
this.dataTableGlobalConfig = dataTableGlobalConfig;
|
|
2512
|
+
// Translations
|
|
2513
|
+
this.filterLabel = 'common.filter';
|
|
2514
|
+
this.filterPlaceholder = '';
|
|
2515
|
+
this.filterColumnsLabel = 'Filter';
|
|
2516
|
+
this.filterColumnsPlaceHolder = 'Filter available columns';
|
|
2517
|
+
this.showEmptyTable = false;
|
|
2518
|
+
this.noDataText = 'No matching data found';
|
|
2519
|
+
this.columnSettingsModalTitleLabel = 'Column settings';
|
|
2520
|
+
this.selectedLabel = 'Selected columns';
|
|
2521
|
+
this.availableLabel = 'Available columns';
|
|
2522
|
+
this.saveLabel = 'Save';
|
|
2523
|
+
this.deleteLabel = 'Delete';
|
|
2524
|
+
this.cancelLabel = 'Cancel';
|
|
2525
|
+
this.infoTextLabel = 'Drag and drop a column to select or reorder it.';
|
|
2526
|
+
this.translateLabels = true;
|
|
2527
|
+
this.stateful = false;
|
|
2528
|
+
this.loading = false;
|
|
2529
|
+
this.paginationEnabled = false;
|
|
2530
|
+
this.page = { pageIndex: 0, pageSize: 50, length: 0 };
|
|
2531
|
+
this.pageSizeOptions = [5, 10, 15];
|
|
2532
|
+
this.actions = [];
|
|
2533
|
+
this.selectionEmitType = 'ID';
|
|
2534
|
+
this.showDeleteFilterAction = true;
|
|
2535
|
+
this.disableRowClick = false;
|
|
2536
|
+
this.deleteDefinitionAllowed = false;
|
|
2537
|
+
this.actionEvent = new EventEmitter();
|
|
2538
|
+
this.selectionEvent = new EventEmitter();
|
|
2539
|
+
this.sortEvent = new EventEmitter();
|
|
2540
|
+
this.filterEvent = new EventEmitter();
|
|
2541
|
+
this.pageEvent = new EventEmitter();
|
|
2542
|
+
this.allColumnsEvent = new EventEmitter();
|
|
2543
|
+
this.columnDefinitionChangeEvent = new EventEmitter();
|
|
2544
|
+
this.viewDefinitionChangeEvent = new EventEmitter();
|
|
2545
|
+
this.allSelected = false;
|
|
2546
|
+
this.ACTION_COLUMN_NAME = '__action__';
|
|
2547
|
+
this.tableActions = [];
|
|
2548
|
+
this.rowActions = [];
|
|
2549
|
+
this.columns = [];
|
|
2550
|
+
this._useAsync = false;
|
|
2551
|
+
this._rowMap = new Map();
|
|
2552
|
+
this._selectionModel = new SelectionModel(true);
|
|
2553
|
+
this._selectionEmitMode = 'NONE';
|
|
2554
|
+
this._filterMode = 'NONE';
|
|
2555
|
+
this._allColumnDefinitions = [];
|
|
2556
|
+
this._showColumnModal = false;
|
|
2557
|
+
this.dataSource = new MatTableDataSource();
|
|
2558
|
+
}
|
|
2559
|
+
ngAfterViewInit() {
|
|
2560
|
+
if (!this._useAsync) {
|
|
2561
|
+
this.dataSource.paginator = this.paginator;
|
|
2562
|
+
this.dataSource.sort = this.sort;
|
|
2563
|
+
}
|
|
2564
|
+
this.applySortData();
|
|
2565
|
+
this.initState();
|
|
2566
|
+
}
|
|
2567
|
+
ngOnChanges(changes) {
|
|
2568
|
+
if ('tableData' in changes) {
|
|
2569
|
+
this.updateDataTableData();
|
|
2570
|
+
this.updateSelectionModel(this.getSelection('ID').length ? this.getSelection('ID') : this._selection);
|
|
2571
|
+
if (this.showAll) {
|
|
2572
|
+
this.updatePaginator();
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
if ('idGenerator' in changes || 'displayedColumns' in changes) {
|
|
2576
|
+
this.updateDataTableData();
|
|
2577
|
+
}
|
|
2578
|
+
// performance reasons (same behaviour could be achived in getters)
|
|
2579
|
+
if ('forceMode' in changes || 'forceSelectionMode' in changes || 'actions' in changes) {
|
|
2580
|
+
const actions = DataTableActionUtil.getDisplayActions(this.actions, this.selectionMode);
|
|
2581
|
+
this.rowActions = actions.rowActions;
|
|
2582
|
+
this.tableActions = actions.groupedTableActions;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
/** TABLE DISPLAY HANDLING */
|
|
2586
|
+
getDataTableHeaderType(column) {
|
|
2587
|
+
if (column.isSortable && !column.isFilterable) {
|
|
2588
|
+
return 'SORT';
|
|
2589
|
+
}
|
|
2590
|
+
if (!column.isSortable && column.isFilterable) {
|
|
2591
|
+
return 'FILTER';
|
|
2592
|
+
}
|
|
2593
|
+
if (column.isSortable && column.isFilterable) {
|
|
2594
|
+
return 'SORT_AND_FILTER';
|
|
2595
|
+
}
|
|
2596
|
+
return 'PLAIN';
|
|
2597
|
+
}
|
|
2598
|
+
getCustomCellTemplate(columnId) {
|
|
2599
|
+
const columnDef = this.columnDefs.find((it) => it.madColumnDef === columnId);
|
|
2600
|
+
return columnDef && columnDef.cellDef ? columnDef.cellDef.getCellTemplate() : null;
|
|
2601
|
+
}
|
|
2602
|
+
getCustomExpandableTemplate() {
|
|
2603
|
+
return this.expandableDef?.getCellTemplate() || null;
|
|
2604
|
+
}
|
|
2605
|
+
get expandableColumnDef() {
|
|
2606
|
+
return this.expandableDef?.columnDef.madExpandableColumnDef || '';
|
|
2607
|
+
}
|
|
2608
|
+
onExpand(event, element) {
|
|
2609
|
+
this.expandedElement = this.expandedElement === element ? null : element;
|
|
2610
|
+
event.stopPropagation();
|
|
2611
|
+
}
|
|
2612
|
+
/** ACTION BUTTON DISPLAY HANDLING */
|
|
2613
|
+
hasVisibleRowActions(displayedData) {
|
|
2614
|
+
return !this.rowActions.every((action) => this.isHiddenForData(action, [this._rowMap.get(displayedData.rowId)?.actualData]));
|
|
2615
|
+
}
|
|
2616
|
+
isHidden(action) {
|
|
2617
|
+
return this.isHiddenForData(action, this.getSelection('DATA'));
|
|
2618
|
+
}
|
|
2619
|
+
isHiddenForData(action, data) {
|
|
2620
|
+
return !!action.isHidden && action.isHidden(data);
|
|
2621
|
+
}
|
|
2622
|
+
isDisabled(action) {
|
|
2623
|
+
return this.isDisabledForActionType(action.type) || (!!action.isDisabled && action.isDisabled(this.getSelection('DATA')));
|
|
2624
|
+
}
|
|
2625
|
+
isDisabledForActionType(actionType) {
|
|
2626
|
+
switch (actionType) {
|
|
2627
|
+
case 'SINGLE':
|
|
2628
|
+
return this.selectedCount !== 1;
|
|
2629
|
+
case 'BATCH':
|
|
2630
|
+
return this.selectedCount < 1;
|
|
2631
|
+
default:
|
|
2632
|
+
return false;
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
getSelectedCount(actionType) {
|
|
2636
|
+
const count = this.selectedCount;
|
|
2637
|
+
if (actionType !== 'BATCH' || count < 2) {
|
|
2638
|
+
return '';
|
|
2639
|
+
}
|
|
2640
|
+
return ` (${count})`;
|
|
2641
|
+
}
|
|
2642
|
+
get selectedCount() {
|
|
2643
|
+
return this._selectionModel?.selected ? this._selectionModel.selected.length : 0;
|
|
2644
|
+
}
|
|
2645
|
+
/** TABLE DATA CHANGE HANDLING */
|
|
2646
|
+
updateDataTableData() {
|
|
2647
|
+
// do not make this function immutable - we desparately need the reference of rowMap to stay the same
|
|
2648
|
+
DataTableDataUtil.updateRowMap(this._rowMap, this.tableData, this.columns, this.idGenerator, this.parentIdGenerator);
|
|
2649
|
+
this.dataSource.data = Array.from(this._rowMap.values()).map((it) => it.displayedData);
|
|
2650
|
+
}
|
|
2651
|
+
updateSelectionModel(selection) {
|
|
2652
|
+
this._selectionModel.clear();
|
|
2653
|
+
selection?.forEach((it) => {
|
|
2654
|
+
const item = this._rowMap.get(it) || [...this._rowMap.values()].find((row) => row.actualData === it);
|
|
2655
|
+
if (!!item) {
|
|
2656
|
+
this.onSelectionEvent(item.id);
|
|
2238
2657
|
}
|
|
2239
2658
|
});
|
|
2659
|
+
this.emitSelection();
|
|
2240
2660
|
}
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2661
|
+
/** ACTION & SELECTION HANDLING */
|
|
2662
|
+
get selectionEmitMode() {
|
|
2663
|
+
return this._selectionEmitMode === 'NONE' && !!this.actions.length ? 'ON_ACTION' : this._selectionEmitMode;
|
|
2664
|
+
}
|
|
2665
|
+
get selectionMode() {
|
|
2666
|
+
return !!this._forceSelectionMode ? this._forceSelectionMode : this.actions.find((it) => it.type === 'BATCH') ? 'BATCH' : 'SINGLE';
|
|
2667
|
+
}
|
|
2668
|
+
get filteredPageData() {
|
|
2669
|
+
// only use filtered data
|
|
2670
|
+
return this.dataSource?._pageData(this.dataSource.filteredData);
|
|
2671
|
+
}
|
|
2672
|
+
get showActionColumn() {
|
|
2673
|
+
return !(this.selectionEmitMode === 'NONE' || this.hideActionColumn) || !!this.expandableDef;
|
|
2674
|
+
}
|
|
2675
|
+
showCheckbox(displayedData) {
|
|
2676
|
+
return !displayedData.parentId && this.selectionMode === 'BATCH' && !this.hideActionColumn;
|
|
2677
|
+
}
|
|
2678
|
+
showRowActionIcon(displayedData) {
|
|
2679
|
+
return !displayedData.parentId && this.selectionEmitMode === 'ON_ACTION' && this.selectionMode === 'SINGLE' && !this.hideActionColumn;
|
|
2680
|
+
}
|
|
2681
|
+
showRadioButton(displayedData) {
|
|
2682
|
+
return !displayedData.parentId && this.selectionEmitMode === 'ON_SELECTION' && this.selectionMode === 'SINGLE';
|
|
2683
|
+
}
|
|
2684
|
+
showExpandableButton(displayedData) {
|
|
2685
|
+
return !displayedData.parentId && !!this.expandableDef;
|
|
2686
|
+
}
|
|
2687
|
+
isSelected(rowId) {
|
|
2688
|
+
return this._selectionModel.isSelected(rowId);
|
|
2689
|
+
}
|
|
2690
|
+
onToggleSelectAll() {
|
|
2691
|
+
// clear all selection first
|
|
2692
|
+
this._selectionModel.clear();
|
|
2693
|
+
// toggle all checkbox
|
|
2694
|
+
this.allSelected = !this.allSelected;
|
|
2695
|
+
if (this.allSelected) {
|
|
2696
|
+
// select all rows of the current page
|
|
2697
|
+
this.filteredPageData.forEach((row) => {
|
|
2698
|
+
if (!row.parentId) {
|
|
2699
|
+
this._selectionModel.select(row.rowId);
|
|
2700
|
+
}
|
|
2701
|
+
});
|
|
2244
2702
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2703
|
+
this.emitSelection();
|
|
2704
|
+
}
|
|
2705
|
+
onActionEvent(action) {
|
|
2706
|
+
const emitAction = { ...action };
|
|
2707
|
+
if (!!emitAction && this.selectionEmitMode !== 'NONE') {
|
|
2708
|
+
emitAction.selected = this.getSelection(this.selectionEmitType);
|
|
2709
|
+
this.actionEvent.emit(emitAction);
|
|
2247
2710
|
}
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2711
|
+
}
|
|
2712
|
+
onSelectionEvent(id) {
|
|
2713
|
+
switch (this.selectionMode) {
|
|
2714
|
+
case 'BATCH':
|
|
2715
|
+
this._selectionModel.toggle(id);
|
|
2716
|
+
break;
|
|
2717
|
+
case 'SINGLE':
|
|
2718
|
+
this._selectionModel.clear();
|
|
2719
|
+
this._selectionModel.toggle(id);
|
|
2720
|
+
break;
|
|
2251
2721
|
}
|
|
2252
|
-
|
|
2253
|
-
|
|
2722
|
+
}
|
|
2723
|
+
onRowEvent(event, row, action = this.defaultAction) {
|
|
2724
|
+
if (this.selectionEmitMode === 'NONE' || row?.parentId) {
|
|
2725
|
+
return;
|
|
2726
|
+
}
|
|
2727
|
+
this.onSelectionEvent(row.rowId);
|
|
2728
|
+
this.processSelection(event, action);
|
|
2729
|
+
}
|
|
2730
|
+
get defaultAction() {
|
|
2731
|
+
return this.selectionEmitMode !== 'NONE' ? this.rowActions[0] : undefined;
|
|
2732
|
+
}
|
|
2733
|
+
get hideActionColumn() {
|
|
2734
|
+
return this.selectionEmitMode === 'ON_ACTION' && this.actions.every((it) => it.type === 'NONE');
|
|
2735
|
+
}
|
|
2736
|
+
processSelection(event, action) {
|
|
2737
|
+
if (this.selectionEmitMode === 'ON_ACTION' &&
|
|
2738
|
+
this.selectionMode === 'SINGLE' &&
|
|
2739
|
+
!!action &&
|
|
2740
|
+
!DataTableComponent.isClickOnRowMenuIcon(event)) {
|
|
2741
|
+
this.onActionEvent(action);
|
|
2742
|
+
}
|
|
2743
|
+
this.emitSelection();
|
|
2744
|
+
}
|
|
2745
|
+
emitSelection() {
|
|
2746
|
+
if (this.selectionEmitMode === 'ON_SELECTION') {
|
|
2747
|
+
this.selectionEvent.emit(this.getSelection(this.selectionEmitType));
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
getSelection(selectionEmitType) {
|
|
2751
|
+
const selection = [];
|
|
2752
|
+
this._selectionModel.selected.forEach((it) =>
|
|
2753
|
+
// if ID-generator is provided, return the ID, else return the ACTUAL data
|
|
2754
|
+
selection.push(this.idGenerator && selectionEmitType === 'ID' ? it : this._rowMap.get(it)?.actualData));
|
|
2755
|
+
return selection;
|
|
2756
|
+
}
|
|
2757
|
+
static isClickOnRowMenuIcon(event) {
|
|
2758
|
+
return event?.target?.classList.contains('mat-icon');
|
|
2759
|
+
}
|
|
2760
|
+
/** SORT HANDLING */
|
|
2761
|
+
onSortingEvent(sort) {
|
|
2762
|
+
if (this._useAsync) {
|
|
2763
|
+
this.sortEvent.emit(sort);
|
|
2254
2764
|
}
|
|
2255
|
-
if (
|
|
2256
|
-
|
|
2765
|
+
if (this.stateful) {
|
|
2766
|
+
this.persistenceService.saveSort(this.id, sort);
|
|
2257
2767
|
}
|
|
2258
|
-
return this.NONE;
|
|
2259
2768
|
}
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
this.
|
|
2264
|
-
|
|
2769
|
+
applySortData() {
|
|
2770
|
+
this.dataSource.sortData = this._useAsync
|
|
2771
|
+
? DataTableSortUtil.sortNothing()
|
|
2772
|
+
: DataTableSortUtil.sortData(this.dataTableGlobalConfig.dateTimeFormat);
|
|
2773
|
+
}
|
|
2774
|
+
/** FILTER HANDLING */
|
|
2775
|
+
get filterMode() {
|
|
2776
|
+
return this._useAsync && this._filterMode === 'TABLE_BASED' ? 'NONE' : this._filterMode;
|
|
2777
|
+
}
|
|
2778
|
+
onTableBasedFilterEvent(event) {
|
|
2779
|
+
this.onFilteringEvent(event.target.value);
|
|
2780
|
+
}
|
|
2781
|
+
onColumnBasedFilterEvent(filter) {
|
|
2782
|
+
this.onFilteringEvent(filter);
|
|
2783
|
+
}
|
|
2784
|
+
onDeleteFilter() {
|
|
2785
|
+
this.onFilteringEvent(undefined);
|
|
2786
|
+
this.filter.updateFilterables(undefined);
|
|
2787
|
+
}
|
|
2788
|
+
onFilteringEvent(filter) {
|
|
2789
|
+
if (this._useAsync) {
|
|
2790
|
+
this.filterEvent.emit(filter);
|
|
2791
|
+
}
|
|
2792
|
+
else {
|
|
2793
|
+
this.allSelected = false;
|
|
2794
|
+
this._selectionModel.clear();
|
|
2795
|
+
this.applyFilterValue(filter);
|
|
2265
2796
|
}
|
|
2797
|
+
if (this.stateful) {
|
|
2798
|
+
this.persistenceService.saveFilter(this.id, filter);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
applyFilterPredicate() {
|
|
2802
|
+
this.dataSource.filterPredicate =
|
|
2803
|
+
this.filterMode === 'COLUMN_BASED'
|
|
2804
|
+
? DataTableFilterUtil.columnBasedFilterPredicate(this._rowMap)
|
|
2805
|
+
: DataTableFilterUtil.tableBasedFilterPredicate();
|
|
2806
|
+
this.applyFilterValue(this._filterValue);
|
|
2807
|
+
}
|
|
2808
|
+
applyFilterValue(value) {
|
|
2809
|
+
const isString = typeof this._filterValue === 'string';
|
|
2810
|
+
this.dataSource.filter = !!value ? (isString ? value.trim().toLowerCase() : JSON.stringify(value)) : '';
|
|
2266
2811
|
}
|
|
2267
|
-
|
|
2268
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DataTableComponent, selector: "mad-data-table", inputs: { filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", filterColumnsLabel: "filterColumnsLabel", filterColumnsPlaceHolder: "filterColumnsPlaceHolder", noDataText: "noDataText", columnSettingsModalTitleLabel: "columnSettingsModalTitleLabel", selectedLabel: "selectedLabel", availableLabel: "availableLabel", saveLabel: "saveLabel", deleteLabel: "deleteLabel", cancelLabel: "cancelLabel", infoTextLabel: "infoTextLabel", tableClass: "tableClass", pageSizeOptions: "pageSizeOptions", externalFilter: "externalFilter", actions: "actions", idGenerator: "idGenerator", parentIdGenerator: "parentIdGenerator", deleteDefinitionAllowed: "deleteDefinitionAllowed", useAsync: "useAsync", translateLabels: "translateLabels", filterValue: "filterValue", displayedColumns: "displayedColumns", displayedColumnDefinition: "displayedColumnDefinition", tableData: "tableData", page: "page", columnDefinitions: "columnDefinitions", loading: "loading", defaultPageSize: "defaultPageSize", externalPaginator: "externalPaginator", paginationEnabled: "paginationEnabled", allColumns: "allColumns", filterEnabled: "filterEnabled", forceMode: "forceMode" }, outputs: { sortEvent: "sortEvent", actionEvent: "actionEvent", pageEvent: "pageEvent", allColumnsEvent: "allColumnsEvent", columnDefinitionChangeEvent: "columnDefinitionChangeEvent", viewDefinitionChangeEvent: "viewDefinitionChangeEvent" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], ngImport: i0, template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length\">\n <mad-outline-button\n [disabled]=\"isDisabled(tableAction.type)\"\n class=\"table-action\"\n *ngFor=\"let tableAction of tableActions\"\n (click)=\"onTableAction(tableAction)\"\n >\n {{ translateLabels ? (tableAction.label | translate) : tableAction.label }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ translateLabels ? (filterLabel | translate) : filterLabel }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\" placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <button *ngFor=\"let rowAction of rowActions\" mat-menu-item class=\"row-action\" (click)=\"onRowEvent($event, element, rowAction)\">\n {{ translateLabels ? (rowAction.label | translate) : rowAction.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div *ngIf=\"rowCount > 0; else noData\" class=\"datatable\" [class]=\"tableClass\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n\n <table mat-table [dataSource]=\"dataSource\" matSort (matSortChange)=\"onSortingEvent($event)\">\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [ngClass]=\"mode === NONE ? 'no-action-cell' : 'row-action-cell'\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox (change)=\"onToggleSelectAll()\" [checked]=\"allSelected\"> </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" [ngClass]=\"mode === NONE ? 'no-action-cell' : 'row-action-cell'\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"!element.parentId && mode === BATCH\" class=\"mad-datatable-checkbox-container\" (click)=\"onRowEvent($event, element)\">\n <mat-checkbox class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"> </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"!element.parentId && mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\"\n [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Cell definitions and rows with injected cells -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <!-- header cell to be injected -->\n <ng-container *ngIf=\"column.isSortable; else noSort\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n [class.text-right]=\"column.isRightAligned\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-template>\n <!-- data cell to be injected -->\n <td\n mat-cell\n *matCellDef=\"let element\"\n [class.text-right]=\"column.isRightAligned\"\n [class.mad-dt-child-cell]=\"element.parentId\"\n [ngSwitch]=\"column.transformer\"\n (click)=\"onRowEvent($event, element)\"\n >\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <!-- header row where cells will be injected -->\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <!-- data row where cells will be injected -->\n <tr mat-row [class.clickable-table-row]=\"!row.parentId && isRowClickable\" *matRowDef=\"let row; columns: columnIds\"></tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button *ngIf=\"this.editableColumnDefinitions?.length == 1\" (click)=\"onColumnSettings()\">\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\">\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\">\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"isPaginationEnabled ? 'block' : 'none'\"\n [length]=\"paginatorLength\"\n [pageIndex]=\"paginatorPageIndex\"\n [pageSize]=\"paginatorPageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"isLoading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ noDataText }}\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:#fff}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable{overflow:auto;flex:1 1 auto;height:100%;position:relative;width:100%}.datatable table{max-height:100%;width:100%}.datatable th,.datatable td{overflow:hidden;width:auto;text-overflow:ellipsis;white-space:nowrap}.text-right{text-align:right!important;padding-right:24px!important}.table-action{margin-right:.5em;margin-bottom:.5em}.row-action-cell{width:48px!important;padding-left:8px!important}.no-action-cell{width:8px!important;padding:0}.noDataText{width:100%;text-align:center;position:relative}.mad-datatable-action-bar{display:flex;justify-content:space-between;align-items:baseline}.mad-datatable-checkbox-container{margin-right:8px;margin-left:8px}.mad-datatable-spinner-wrapper{background-color:#fff;opacity:.8;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:99999;pointer-events:unset}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-mdc-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.no-pointer-events{pointer-events:none}.active-column-definition{color:#000;background-color:#f5f5f5}.mad-dt-child-cell{color:#0009}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled", "color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title", "color"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: i13.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }] }); }
|
|
2812
|
+
/** PAGINATION HANDLING */
|
|
2813
|
+
onPageEvent(event) {
|
|
2814
|
+
if (this._useAsync) {
|
|
2815
|
+
this.pageEvent.emit(event);
|
|
2816
|
+
}
|
|
2817
|
+
if (this.stateful) {
|
|
2818
|
+
this.persistenceService.savePageSize(this.id, event.pageSize);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
get pageIndex() {
|
|
2822
|
+
return this.showAll ? 0 : this.page.pageIndex;
|
|
2823
|
+
}
|
|
2824
|
+
get pageSize() {
|
|
2825
|
+
return this.showAll ? this.dataLength : this.page.pageSize;
|
|
2826
|
+
}
|
|
2827
|
+
get pageLength() {
|
|
2828
|
+
return this.showAll ? this.dataLength : this.page.length;
|
|
2829
|
+
}
|
|
2830
|
+
updatePaginator() {
|
|
2831
|
+
if (this.paginator) {
|
|
2832
|
+
this.paginator.pageSize = this.pageSize;
|
|
2833
|
+
this.paginator.page.emit(this.page);
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
get dataLength() {
|
|
2837
|
+
return this.dataSource.data?.length || 0;
|
|
2838
|
+
}
|
|
2839
|
+
get showAll() {
|
|
2840
|
+
return !this._useAsync && !this.paginationEnabled;
|
|
2841
|
+
}
|
|
2842
|
+
/** INIT STATE */
|
|
2843
|
+
initState() {
|
|
2844
|
+
// only set default sort if there is no other sort persisted
|
|
2845
|
+
if (!!this.defaultSort && !this.persistenceService.loadSort(this.id)?.direction) {
|
|
2846
|
+
this.setSort(this.defaultSort);
|
|
2847
|
+
}
|
|
2848
|
+
if (this.stateful) {
|
|
2849
|
+
this.initPaginatorState();
|
|
2850
|
+
this.initSortState();
|
|
2851
|
+
this.initFilterState();
|
|
2852
|
+
}
|
|
2853
|
+
this.changeDetectorRef.detectChanges();
|
|
2854
|
+
}
|
|
2855
|
+
initSortState() {
|
|
2856
|
+
const sort = this.persistenceService.loadSort(this.id);
|
|
2857
|
+
if (!!sort) {
|
|
2858
|
+
this.setSort(sort);
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
setSort(sort) {
|
|
2862
|
+
this.sort.active = sort.active;
|
|
2863
|
+
this.sort.direction = sort.direction;
|
|
2864
|
+
this.sort.sortChange.emit(sort);
|
|
2865
|
+
}
|
|
2866
|
+
initFilterState() {
|
|
2867
|
+
const filter = this.persistenceService.loadFilter(this.id);
|
|
2868
|
+
this.filter.updateFilterables(filter);
|
|
2869
|
+
}
|
|
2870
|
+
initPaginatorState() {
|
|
2871
|
+
this.page = {
|
|
2872
|
+
pageIndex: 0,
|
|
2873
|
+
pageSize: this.persistenceService.loadPageSize(this.id) || this.pageSize,
|
|
2874
|
+
length: 0,
|
|
2875
|
+
};
|
|
2876
|
+
this.updatePaginator();
|
|
2877
|
+
}
|
|
2878
|
+
/** COLUMN HANDLING */
|
|
2879
|
+
onViewDefinition(definition) {
|
|
2880
|
+
this._selectedColumnDefinition = definition;
|
|
2881
|
+
this.viewDefinitionChangeEvent.emit(definition);
|
|
2882
|
+
}
|
|
2883
|
+
onColumnSettings(definition) {
|
|
2884
|
+
this._showColumnModal = true;
|
|
2885
|
+
this._selectedColumnDefinition = definition ? definition : this._allColumnDefinitions[0];
|
|
2886
|
+
if (this._allAvailableColumns) {
|
|
2887
|
+
this.openColumnModal();
|
|
2888
|
+
}
|
|
2889
|
+
else {
|
|
2890
|
+
// if no complete definitions have been loaded yet send an event so the app can load it
|
|
2891
|
+
this.allColumnsEvent.emit();
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
isCurrentDefinition(definition) {
|
|
2895
|
+
return this._selectedColumnDefinition && this._selectedColumnDefinition.id === definition.id;
|
|
2896
|
+
}
|
|
2897
|
+
openColumnModal() {
|
|
2898
|
+
const dialogData = {
|
|
2899
|
+
allColumns: this._allAvailableColumns,
|
|
2900
|
+
definition: this._selectedColumnDefinition,
|
|
2901
|
+
deleteDefinitionAllowed: this.deleteDefinitionAllowed,
|
|
2902
|
+
filterColumnsLabel: this.filterColumnsLabel,
|
|
2903
|
+
filterColumnsPlaceHolder: this.filterColumnsPlaceHolder,
|
|
2904
|
+
noDataText: this.noDataText,
|
|
2905
|
+
titleLabel: this.columnSettingsModalTitleLabel,
|
|
2906
|
+
selectedLabel: this.selectedLabel,
|
|
2907
|
+
availableLabel: this.availableLabel,
|
|
2908
|
+
saveLabel: this.saveLabel,
|
|
2909
|
+
deleteLabel: this.deleteLabel,
|
|
2910
|
+
cancelLabel: this.cancelLabel,
|
|
2911
|
+
infoTextLabel: this.infoTextLabel,
|
|
2912
|
+
};
|
|
2913
|
+
const dialog = this.matDialog.open(DataTableColumnsModalComponent, { data: dialogData });
|
|
2914
|
+
dialog.afterClosed().subscribe((result) => {
|
|
2915
|
+
// no event on CANCEL
|
|
2916
|
+
if (result) {
|
|
2917
|
+
this.columnDefinitionChangeEvent.emit(result);
|
|
2918
|
+
}
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$3.MatDialog }, { token: MAD_DATA_TABLE_PERSISTENCE_SERVICE }, { token: MAD_DATA_TABLE_GLOBAL_CONFIGURATION }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2922
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: DataTableComponent, isStandalone: true, selector: "mad-data-table", inputs: { id: "id", filterLabel: "filterLabel", filterPlaceholder: "filterPlaceholder", filterColumnsLabel: "filterColumnsLabel", filterColumnsPlaceHolder: "filterColumnsPlaceHolder", showEmptyTable: "showEmptyTable", noDataText: "noDataText", columnSettingsModalTitleLabel: "columnSettingsModalTitleLabel", selectedLabel: "selectedLabel", availableLabel: "availableLabel", saveLabel: "saveLabel", deleteLabel: "deleteLabel", cancelLabel: "cancelLabel", infoTextLabel: "infoTextLabel", tableClass: "tableClass", translateLabels: "translateLabels", useAsync: "useAsync", stateful: "stateful", loading: "loading", tableData: "tableData", idGenerator: "idGenerator", parentIdGenerator: "parentIdGenerator", defaultSort: "defaultSort", externalFilter: "externalFilter", paginationEnabled: "paginationEnabled", page: "page", pageSizeOptions: "pageSizeOptions", actions: "actions", selectionEmitType: "selectionEmitType", showDeleteFilterAction: "showDeleteFilterAction", disableRowClick: "disableRowClick", deleteDefinitionAllowed: "deleteDefinitionAllowed", selection: "selection", filterEnabled: "filterEnabled", filterMode: "filterMode", filterValue: "filterValue", externalPaginator: "externalPaginator", defaultPageSize: "defaultPageSize", selectionEmitMode: "selectionEmitMode", forceMode: "forceMode", forceSelectionMode: "forceSelectionMode", displayedColumns: "displayedColumns", displayedColumnDefinition: "displayedColumnDefinition", columnDefinitions: "columnDefinitions", allColumns: "allColumns" }, outputs: { actionEvent: "actionEvent", selectionEvent: "selectionEvent", sortEvent: "sortEvent", filterEvent: "filterEvent", pageEvent: "pageEvent", allColumnsEvent: "allColumnsEvent", columnDefinitionChangeEvent: "columnDefinitionChangeEvent", viewDefinitionChangeEvent: "viewDefinitionChangeEvent" }, providers: [DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER, MAD_DATA_TABL_GLOBAL_CONFIGURATION_PROVIDER], queries: [{ propertyName: "expandableDef", first: true, predicate: DataTableTemplateExpandableCellDefinition, descendants: true }, { propertyName: "columnDefs", predicate: DataTableTemplateColumnDefinition }], viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "filter", first: true, predicate: DataTableFilter, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length || (filterMode === 'COLUMN_BASED' && showDeleteFilterAction)\">\n <mad-button-group *ngFor=\"let actionGroup of tableActions\" class=\"table-action-group\">\n <mad-outline-button\n [hidden]=\"isHidden(tableAction)\"\n [disabled]=\"isDisabled(tableAction)\"\n *ngFor=\"let tableAction of actionGroup\"\n (click)=\"onActionEvent(tableAction)\"\n >\n {{ translateLabels ? (tableAction.label | translate) : tableAction.label }}\n {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </mad-button-group>\n </div>\n <ng-container *ngIf=\"filterMode === 'COLUMN_BASED' && showDeleteFilterAction\">\n <mat-icon fontSet=\"material-icons-outlined\" class=\"delete-filter-action\" color=\"primary\" (click)=\"onDeleteFilter()\"\n >filter_alt_off</mat-icon\n >\n </ng-container>\n <mat-form-field *ngIf=\"filterMode === 'TABLE_BASED'\">\n <mat-label>{{ translateLabels ? (filterLabel | translate) : filterLabel }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"onTableBasedFilterEvent($event)\" placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <ng-container *ngFor=\"let rowAction of rowActions\">\n <button\n *ngIf=\"!isHidden(rowAction)\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\"\n [disabled]=\"isDisabled(rowAction)\"\n >\n {{ translateLabels ? (rowAction.label | translate) : rowAction.label }}\n </button>\n </ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div\n *ngIf=\"filterMode === 'COLUMN_BASED' || showEmptyTable || !!filteredPageData?.length; else noData\"\n class=\"datatable\"\n [class]=\"tableClass\"\n>\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"loading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n <table\n [id]=\"id\"\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n (matSortChange)=\"onSortingEvent($event)\"\n madFilter\n (madFilterChange)=\"onColumnBasedFilterEvent($event)\"\n [multiTemplateDataRows]=\"!!expandableDef\"\n >\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"selectionEmitMode !== 'NONE' && selectionMode === 'BATCH'\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox (change)=\"onToggleSelectAll()\" [checked]=\"allSelected\"> </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"showCheckbox(element)\" class=\"mad-datatable-checkbox-container\" (click)=\"onRowEvent($event, element)\">\n <mat-checkbox class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"> </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"showRowActionIcon(element) && hasVisibleRowActions(element)\"\n [matMenuTriggerData]=\"{ element: element }\"\n [matMenuTriggerFor]=\"rowActionMenu\"\n (click)=\"onSelectionEvent(element.rowId)\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- SINGLE: row radio button -->\n <div *ngIf=\"showRadioButton(element)\" class=\"mad-datatable-checkbox-container\" (click)=\"onRowEvent($event, element)\">\n <mat-radio-button class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"> </mat-radio-button>\n </div>\n <!-- EXPANDABLE: row is expandable/collapsable -->\n <mad-icon-button *ngIf=\"showExpandableButton(element)\" (click)=\"onExpand($event, element)\">\n <mat-icon *ngIf=\"expandedElement !== element\">keyboard_arrow_down</mat-icon>\n <mat-icon *ngIf=\"expandedElement === element\">keyboard_arrow_up</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Cell definitions and rows with injected cells -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <!-- header cell to be injected -->\n <ng-container [ngSwitch]=\"getDataTableHeaderType(column)\">\n <ng-container *ngSwitchCase=\"'SORT'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchCase=\"'FILTER'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchCase=\"'SORT_AND_FILTER'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n </ng-container>\n\n <!-- data cell to be injected -->\n <td\n mat-cell\n *matCellDef=\"let element\"\n [class.text-right]=\"column.isRightAligned\"\n [class.mad-dt-child-cell]=\"element.parentId\"\n [ngSwitch]=\"column.transformer\"\n (click)=\"!disableRowClick && onRowEvent($event, element)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n getCustomCellTemplate(column.id) || defaultCellTemplate;\n context: { column: column, element: element, $implicit: element }\n \"\n ></ng-container>\n </td>\n </ng-container>\n\n <!-- Expanded Content Column - The row is made up of this one column that spans across all columns -->\n <ng-container *ngIf=\"!!expandableDef\" [matColumnDef]=\"expandableColumnDef\">\n <td mat-cell *matCellDef=\"let element\" [attr.colspan]=\"columns.length + 1\">\n <div class=\"mad-data-table-expandable-area\" [@detailExpand]=\"element === expandedElement ? 'expanded' : 'collapsed'\">\n <ng-container\n *ngTemplateOutlet=\"\n getCustomExpandableTemplate() || defaultCellTemplate;\n context: { column: element, element: element, $implicit: element }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n\n <!-- header row where cells will be injected -->\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <!-- data row where cells will be injected -->\n <tr\n mat-row\n [class.clickable-table-row]=\"!row.parentId && selectionEmitMode !== 'NONE'\"\n *matRowDef=\"let row; columns: columnIds\"\n (click)=\"onExpand($event, row)\"\n ></tr>\n <ng-container *ngIf=\"!!expandableDef\">\n <tr mat-row *matRowDef=\"let element; columns: [expandableColumnDef]\" class=\"mad-data-table-expandable-row\"></tr>\n </ng-container>\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell noDataText columnBasedFilter\" [attr.colspan]=\"columnIds.length\">\n {{ translateLabels ? (noDataText | translate) : noDataText }}\n </td>\n </tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button *ngIf=\"editableColumnDefinitions?.length === 1\" (click)=\"onColumnSettings()\">\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button *ngIf=\"(editableColumnDefinitions?.length || 0) > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\">\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button *ngIf=\"(viewableColumnDefinitions?.length || 0) > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\">\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"paginationEnabled ? 'block' : 'none'\"\n [length]=\"pageLength\"\n [pageIndex]=\"pageIndex\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"loading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ translateLabels ? (noDataText | translate) : noDataText }}\n </div>\n</ng-template>\n\n<!-- default cell template -->\n<ng-template #defaultCellTemplate let-element=\"element\" let-column=\"column\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n</ng-template>\n\n<!-- custom cell templates injected from parent -->\n<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:#fff}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable{overflow:auto;flex:1 1 auto;height:100%;position:relative;width:100%}.datatable table{width:100%;min-height:140px;max-height:100%}.datatable table th,.datatable table td{width:auto;text-overflow:ellipsis;white-space:nowrap}.datatable table th{overflow:visible}.datatable table td{overflow:hidden}.layout-fixed table{table-layout:fixed}.layout-fixed table th{font-weight:700}.layout-fixed table td{white-space:normal;word-wrap:break-word}.text-right{text-align:right!important;padding-right:24px!important}.table-action-group{margin-right:.5em;margin-bottom:.5em}.row-action-cell{width:48px!important;padding-left:8px!important}.no-action-cell{width:8px!important;padding:0}.noDataText{width:100%;text-align:center;position:relative}.noDataText.columnBasedFilter{padding-top:10px}.mad-datatable-action-bar{display:flex;justify-content:space-between;align-items:baseline}.mad-datatable-checkbox-container{margin-right:8px;margin-left:8px}.mad-datatable-spinner-wrapper{background-color:#fff;opacity:.8;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:99999;pointer-events:unset}.mad-data-table-expandable-row{height:0;display:contents;padding:0}.mad-data-table-expandable-row td{border-top-color:transparent;border-bottom-color:transparent}.mad-data-table-expandable-area{overflow:hidden;display:flex;width:100%}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-mdc-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.no-pointer-events{pointer-events:none}.active-column-definition{color:#000;background-color:#f5f5f5}.mad-dt-child-cell{color:#0009}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled", "color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i9.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i9.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i9.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i9.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i9.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i9.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i9.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i9.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i9.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i9.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i9.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i10.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title", "color"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: MadButtonGroupComponent, selector: "mad-button-group" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i15.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatRadioModule }, { kind: "component", type: i16.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex", "id", "name", "aria-label", "aria-labelledby", "aria-describedby", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "ngmodule", type: DragDropModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DataTableFilterHeader, selector: "th[mad-filter-header]", inputs: ["mad-filter-header", "madFilterColumnRightAligned", "madFilterOptions"] }, { kind: "directive", type: DataTableFilter, selector: "[madFilter]", outputs: ["madFilterChange"] }], animations: [
|
|
2923
|
+
trigger('detailExpand', [
|
|
2924
|
+
state('collapsed,void', style({ height: '0px', minHeight: '0' })),
|
|
2925
|
+
state('expanded', style({ height: '*' })),
|
|
2926
|
+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
|
2927
|
+
]),
|
|
2928
|
+
] }); }
|
|
2269
2929
|
}
|
|
2270
2930
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
2271
2931
|
type: Component,
|
|
2272
|
-
args: [{ selector: 'mad-data-table',
|
|
2273
|
-
|
|
2932
|
+
args: [{ selector: 'mad-data-table', animations: [
|
|
2933
|
+
trigger('detailExpand', [
|
|
2934
|
+
state('collapsed,void', style({ height: '0px', minHeight: '0' })),
|
|
2935
|
+
state('expanded', style({ height: '*' })),
|
|
2936
|
+
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
|
2937
|
+
]),
|
|
2938
|
+
], standalone: true, imports: [
|
|
2939
|
+
CommonModule,
|
|
2940
|
+
MatButtonModule,
|
|
2941
|
+
MatIconModule,
|
|
2942
|
+
MatFormFieldModule,
|
|
2943
|
+
MatInputModule,
|
|
2944
|
+
MatMenuModule,
|
|
2945
|
+
MatPaginatorModule,
|
|
2946
|
+
MatSortModule,
|
|
2947
|
+
MatTableModule,
|
|
2948
|
+
MatProgressSpinnerModule,
|
|
2949
|
+
ButtonModule,
|
|
2950
|
+
TranslateModule,
|
|
2951
|
+
MatCheckboxModule,
|
|
2952
|
+
MatRadioModule,
|
|
2953
|
+
MatBadgeModule,
|
|
2954
|
+
DragDropModule,
|
|
2955
|
+
FormsModule,
|
|
2956
|
+
DataTableFilterHeader,
|
|
2957
|
+
DataTableFilter,
|
|
2958
|
+
DataTableTemplateColumnDefinition,
|
|
2959
|
+
DataTableTemplateCellDefinition,
|
|
2960
|
+
DataTableTemplateExpandableColumnDefinition,
|
|
2961
|
+
DataTableTemplateExpandableCellDefinition,
|
|
2962
|
+
], providers: [DATA_TABLE_PERSISTENCE_SERVICE_PROVIDER, MAD_DATA_TABL_GLOBAL_CONFIGURATION_PROVIDER], template: "<div class=\"mad-datatable-action-bar\">\n <!-- Table actions: displayed before the table -->\n <div *ngIf=\"tableActions?.length || (filterMode === 'COLUMN_BASED' && showDeleteFilterAction)\">\n <mad-button-group *ngFor=\"let actionGroup of tableActions\" class=\"table-action-group\">\n <mad-outline-button\n [hidden]=\"isHidden(tableAction)\"\n [disabled]=\"isDisabled(tableAction)\"\n *ngFor=\"let tableAction of actionGroup\"\n (click)=\"onActionEvent(tableAction)\"\n >\n {{ translateLabels ? (tableAction.label | translate) : tableAction.label }}\n {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </mad-button-group>\n </div>\n <ng-container *ngIf=\"filterMode === 'COLUMN_BASED' && showDeleteFilterAction\">\n <mat-icon fontSet=\"material-icons-outlined\" class=\"delete-filter-action\" color=\"primary\" (click)=\"onDeleteFilter()\"\n >filter_alt_off</mat-icon\n >\n </ng-container>\n <mat-form-field *ngIf=\"filterMode === 'TABLE_BASED'\">\n <mat-label>{{ translateLabels ? (filterLabel | translate) : filterLabel }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"onTableBasedFilterEvent($event)\" placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\n<!-- Row action menu -->\n<mat-menu #rowActionMenu=\"matMenu\">\n <ng-template matMenuContent let-element=\"element\">\n <ng-container *ngFor=\"let rowAction of rowActions\">\n <button\n *ngIf=\"!isHidden(rowAction)\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onRowEvent($event, element, rowAction)\"\n [disabled]=\"isDisabled(rowAction)\"\n >\n {{ translateLabels ? (rowAction.label | translate) : rowAction.label }}\n </button>\n </ng-container>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of editableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onColumnSettings(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button\n *ngFor=\"let definition of viewableColumnDefinitions\"\n mat-menu-item\n class=\"row-action\"\n (click)=\"onViewDefinition(definition)\"\n [ngClass]=\"{ 'active-column-definition': isCurrentDefinition(definition) }\"\n >\n {{ translateLabels ? (definition.label | translate) : definition.label }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- Table -->\n<div\n *ngIf=\"filterMode === 'COLUMN_BASED' || showEmptyTable || !!filteredPageData?.length; else noData\"\n class=\"datatable\"\n [class]=\"tableClass\"\n>\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"loading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n <table\n [id]=\"id\"\n mat-table\n [dataSource]=\"dataSource\"\n matSort\n (matSortChange)=\"onSortingEvent($event)\"\n madFilter\n (madFilterChange)=\"onColumnBasedFilterEvent($event)\"\n [multiTemplateDataRows]=\"!!expandableDef\"\n >\n <!-- Row actions column-->\n <ng-container [matColumnDef]=\"ACTION_COLUMN_NAME\">\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"selectionEmitMode !== 'NONE' && selectionMode === 'BATCH'\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox (change)=\"onToggleSelectAll()\" [checked]=\"allSelected\"> </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" [ngClass]=\"showActionColumn ? 'row-action-cell' : 'no-action-cell'\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"showCheckbox(element)\" class=\"mad-datatable-checkbox-container\" (click)=\"onRowEvent($event, element)\">\n <mat-checkbox class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"> </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"showRowActionIcon(element) && hasVisibleRowActions(element)\"\n [matMenuTriggerData]=\"{ element: element }\"\n [matMenuTriggerFor]=\"rowActionMenu\"\n (click)=\"onSelectionEvent(element.rowId)\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- SINGLE: row radio button -->\n <div *ngIf=\"showRadioButton(element)\" class=\"mad-datatable-checkbox-container\" (click)=\"onRowEvent($event, element)\">\n <mat-radio-button class=\"no-pointer-events\" [checked]=\"isSelected(element.rowId)\"> </mat-radio-button>\n </div>\n <!-- EXPANDABLE: row is expandable/collapsable -->\n <mad-icon-button *ngIf=\"showExpandableButton(element)\" (click)=\"onExpand($event, element)\">\n <mat-icon *ngIf=\"expandedElement !== element\">keyboard_arrow_down</mat-icon>\n <mat-icon *ngIf=\"expandedElement === element\">keyboard_arrow_up</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Cell definitions and rows with injected cells -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\n <!-- header cell to be injected -->\n <ng-container [ngSwitch]=\"getDataTableHeaderType(column)\">\n <ng-container *ngSwitchCase=\"'SORT'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchCase=\"'FILTER'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchCase=\"'SORT_AND_FILTER'\">\n <th\n scope=\"col\"\n mat-header-cell\n *matHeaderCellDef\n [class.text-right]=\"column.isRightAligned\"\n mat-sort-header=\"{{ column.orderByName ? column.orderByName : column.dataPropertyName }}\"\n [arrowPosition]=\"column.isRightAligned ? 'before' : 'after'\"\n mad-filter-header=\"{{ column.dataPropertyName }}\"\n [madFilterColumnRightAligned]=\"column.isRightAligned\"\n [madFilterOptions]=\"column.filterParams?.filterOptions\"\n >\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ translateLabels ? (column.label | translate) : column.label }}\n </th>\n </ng-container>\n </ng-container>\n\n <!-- data cell to be injected -->\n <td\n mat-cell\n *matCellDef=\"let element\"\n [class.text-right]=\"column.isRightAligned\"\n [class.mad-dt-child-cell]=\"element.parentId\"\n [ngSwitch]=\"column.transformer\"\n (click)=\"!disableRowClick && onRowEvent($event, element)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n getCustomCellTemplate(column.id) || defaultCellTemplate;\n context: { column: column, element: element, $implicit: element }\n \"\n ></ng-container>\n </td>\n </ng-container>\n\n <!-- Expanded Content Column - The row is made up of this one column that spans across all columns -->\n <ng-container *ngIf=\"!!expandableDef\" [matColumnDef]=\"expandableColumnDef\">\n <td mat-cell *matCellDef=\"let element\" [attr.colspan]=\"columns.length + 1\">\n <div class=\"mad-data-table-expandable-area\" [@detailExpand]=\"element === expandedElement ? 'expanded' : 'collapsed'\">\n <ng-container\n *ngTemplateOutlet=\"\n getCustomExpandableTemplate() || defaultCellTemplate;\n context: { column: element, element: element, $implicit: element }\n \"\n ></ng-container>\n </div>\n </td>\n </ng-container>\n\n <!-- header row where cells will be injected -->\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <!-- data row where cells will be injected -->\n <tr\n mat-row\n [class.clickable-table-row]=\"!row.parentId && selectionEmitMode !== 'NONE'\"\n *matRowDef=\"let row; columns: columnIds\"\n (click)=\"onExpand($event, row)\"\n ></tr>\n <ng-container *ngIf=\"!!expandableDef\">\n <tr mat-row *matRowDef=\"let element; columns: [expandableColumnDef]\" class=\"mad-data-table-expandable-row\"></tr>\n </ng-container>\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell noDataText columnBasedFilter\" [attr.colspan]=\"columnIds.length\">\n {{ translateLabels ? (noDataText | translate) : noDataText }}\n </td>\n </tr>\n </table>\n</div>\n<div class=\"mad-data-table-bottom-area\">\n <div class=\"mad-data-table-bottom-info-area\">\n <!-- column settings: 1 definition -->\n <mad-icon-button *ngIf=\"editableColumnDefinitions?.length === 1\" (click)=\"onColumnSettings()\">\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button *ngIf=\"(editableColumnDefinitions?.length || 0) > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\">\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button *ngIf=\"(viewableColumnDefinitions?.length || 0) > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\">\n <mat-icon>preview</mat-icon>\n </mad-icon-button>\n </div>\n\n <!-- Pagination -->\n <mat-paginator\n [style.display]=\"paginationEnabled ? 'block' : 'none'\"\n [length]=\"pageLength\"\n [pageIndex]=\"pageIndex\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"onPageEvent($event)\"\n showFirstLastButtons\n >\n </mat-paginator>\n</div>\n\n<!-- No data alert -->\n<ng-template #noData>\n <div class=\"noDataText\">\n <div class=\"mad-datatable-spinner-wrapper\" *ngIf=\"loading\">\n <mat-spinner [diameter]=\"50\" [strokeWidth]=\"3\"></mat-spinner>\n </div>\n {{ translateLabels ? (noDataText | translate) : noDataText }}\n </div>\n</ng-template>\n\n<!-- default cell template -->\n<ng-template #defaultCellTemplate let-element=\"element\" let-column=\"column\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n</ng-template>\n\n<!-- custom cell templates injected from parent -->\n<ng-content></ng-content>\n", styles: [":host{display:flex;flex-direction:column;min-height:112px;flex:1 1 auto;background-color:#fff}.datatable-vertical-stretch-to-parent{flex:1;max-height:100%;width:100%;display:flex;flex-direction:column}.datatable-max-height-500{max-height:500px}.datatable-max-height-300{max-height:300px}.datatable-max-height,.datatable-max-height-500,.datatable-max-height-300{flex:1;width:100%;display:flex;flex-direction:column}.datatable{overflow:auto;flex:1 1 auto;height:100%;position:relative;width:100%}.datatable table{width:100%;min-height:140px;max-height:100%}.datatable table th,.datatable table td{width:auto;text-overflow:ellipsis;white-space:nowrap}.datatable table th{overflow:visible}.datatable table td{overflow:hidden}.layout-fixed table{table-layout:fixed}.layout-fixed table th{font-weight:700}.layout-fixed table td{white-space:normal;word-wrap:break-word}.text-right{text-align:right!important;padding-right:24px!important}.table-action-group{margin-right:.5em;margin-bottom:.5em}.row-action-cell{width:48px!important;padding-left:8px!important}.no-action-cell{width:8px!important;padding:0}.noDataText{width:100%;text-align:center;position:relative}.noDataText.columnBasedFilter{padding-top:10px}.mad-datatable-action-bar{display:flex;justify-content:space-between;align-items:baseline}.mad-datatable-checkbox-container{margin-right:8px;margin-left:8px}.mad-datatable-spinner-wrapper{background-color:#fff;opacity:.8;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:99999;pointer-events:unset}.mad-data-table-expandable-row{height:0;display:contents;padding:0}.mad-data-table-expandable-row td{border-top-color:transparent;border-bottom-color:transparent}.mad-data-table-expandable-area{overflow:hidden;display:flex;width:100%}.mad-data-table-bottom-area{display:flex;flex-direction:row}.mad-data-table-bottom-area .mad-data-table-bottom-info-area{display:flex;flex:1}.mat-mdc-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.no-pointer-events{pointer-events:none}.active-column-definition{color:#000;background-color:#f5f5f5}.mad-dt-child-cell{color:#0009}\n"] }]
|
|
2963
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$3.MatDialog }, { type: DataTablePersistenceService, decorators: [{
|
|
2964
|
+
type: Inject,
|
|
2965
|
+
args: [MAD_DATA_TABLE_PERSISTENCE_SERVICE]
|
|
2966
|
+
}] }, { type: undefined, decorators: [{
|
|
2967
|
+
type: Inject,
|
|
2968
|
+
args: [MAD_DATA_TABLE_GLOBAL_CONFIGURATION]
|
|
2969
|
+
}] }], propDecorators: { id: [{
|
|
2970
|
+
type: Input
|
|
2971
|
+
}], filterLabel: [{
|
|
2274
2972
|
type: Input
|
|
2275
2973
|
}], filterPlaceholder: [{
|
|
2276
2974
|
type: Input
|
|
@@ -2278,6 +2976,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
2278
2976
|
type: Input
|
|
2279
2977
|
}], filterColumnsPlaceHolder: [{
|
|
2280
2978
|
type: Input
|
|
2979
|
+
}], showEmptyTable: [{
|
|
2980
|
+
type: Input
|
|
2281
2981
|
}], noDataText: [{
|
|
2282
2982
|
type: Input
|
|
2283
2983
|
}], columnSettingsModalTitleLabel: [{
|
|
@@ -2296,51 +2996,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
2296
2996
|
type: Input
|
|
2297
2997
|
}], tableClass: [{
|
|
2298
2998
|
type: Input
|
|
2299
|
-
}],
|
|
2999
|
+
}], translateLabels: [{
|
|
2300
3000
|
type: Input
|
|
2301
|
-
}],
|
|
3001
|
+
}], useAsync: [{
|
|
2302
3002
|
type: Input
|
|
2303
|
-
}],
|
|
3003
|
+
}], stateful: [{
|
|
3004
|
+
type: Input
|
|
3005
|
+
}], loading: [{
|
|
3006
|
+
type: Input
|
|
3007
|
+
}], tableData: [{
|
|
2304
3008
|
type: Input
|
|
2305
3009
|
}], idGenerator: [{
|
|
2306
3010
|
type: Input
|
|
2307
3011
|
}], parentIdGenerator: [{
|
|
2308
3012
|
type: Input
|
|
2309
|
-
}],
|
|
3013
|
+
}], defaultSort: [{
|
|
2310
3014
|
type: Input
|
|
2311
|
-
}],
|
|
3015
|
+
}], externalFilter: [{
|
|
2312
3016
|
type: Input
|
|
2313
|
-
}],
|
|
3017
|
+
}], paginationEnabled: [{
|
|
2314
3018
|
type: Input
|
|
2315
|
-
}],
|
|
3019
|
+
}], page: [{
|
|
2316
3020
|
type: Input
|
|
2317
|
-
}],
|
|
3021
|
+
}], pageSizeOptions: [{
|
|
2318
3022
|
type: Input
|
|
2319
|
-
}],
|
|
3023
|
+
}], actions: [{
|
|
2320
3024
|
type: Input
|
|
2321
|
-
}],
|
|
3025
|
+
}], selectionEmitType: [{
|
|
2322
3026
|
type: Input
|
|
2323
|
-
}],
|
|
3027
|
+
}], showDeleteFilterAction: [{
|
|
2324
3028
|
type: Input
|
|
2325
|
-
}],
|
|
3029
|
+
}], disableRowClick: [{
|
|
2326
3030
|
type: Input
|
|
2327
|
-
}],
|
|
3031
|
+
}], deleteDefinitionAllowed: [{
|
|
2328
3032
|
type: Input
|
|
2329
|
-
}],
|
|
3033
|
+
}], selection: [{
|
|
2330
3034
|
type: Input
|
|
2331
|
-
}],
|
|
3035
|
+
}], filterEnabled: [{
|
|
2332
3036
|
type: Input
|
|
2333
|
-
}],
|
|
3037
|
+
}], filterMode: [{
|
|
2334
3038
|
type: Input
|
|
2335
|
-
}],
|
|
3039
|
+
}], filterValue: [{
|
|
2336
3040
|
type: Input
|
|
2337
|
-
}],
|
|
3041
|
+
}], externalPaginator: [{
|
|
3042
|
+
type: Input
|
|
3043
|
+
}], defaultPageSize: [{
|
|
3044
|
+
type: Input
|
|
3045
|
+
}], selectionEmitMode: [{
|
|
2338
3046
|
type: Input
|
|
2339
3047
|
}], forceMode: [{
|
|
2340
3048
|
type: Input
|
|
3049
|
+
}], forceSelectionMode: [{
|
|
3050
|
+
type: Input
|
|
3051
|
+
}], displayedColumns: [{
|
|
3052
|
+
type: Input
|
|
3053
|
+
}], displayedColumnDefinition: [{
|
|
3054
|
+
type: Input
|
|
3055
|
+
}], columnDefinitions: [{
|
|
3056
|
+
type: Input
|
|
3057
|
+
}], allColumns: [{
|
|
3058
|
+
type: Input
|
|
3059
|
+
}], actionEvent: [{
|
|
3060
|
+
type: Output
|
|
3061
|
+
}], selectionEvent: [{
|
|
3062
|
+
type: Output
|
|
2341
3063
|
}], sortEvent: [{
|
|
2342
3064
|
type: Output
|
|
2343
|
-
}],
|
|
3065
|
+
}], filterEvent: [{
|
|
2344
3066
|
type: Output
|
|
2345
3067
|
}], pageEvent: [{
|
|
2346
3068
|
type: Output
|
|
@@ -2352,73 +3074,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
2352
3074
|
type: Output
|
|
2353
3075
|
}], paginator: [{
|
|
2354
3076
|
type: ViewChild,
|
|
2355
|
-
args: [MatPaginator
|
|
3077
|
+
args: [MatPaginator]
|
|
2356
3078
|
}], sort: [{
|
|
2357
3079
|
type: ViewChild,
|
|
2358
|
-
args: [MatSort
|
|
3080
|
+
args: [MatSort]
|
|
3081
|
+
}], filter: [{
|
|
3082
|
+
type: ViewChild,
|
|
3083
|
+
args: [DataTableFilter]
|
|
3084
|
+
}], columnDefs: [{
|
|
3085
|
+
type: ContentChildren,
|
|
3086
|
+
args: [DataTableTemplateColumnDefinition]
|
|
3087
|
+
}], expandableDef: [{
|
|
3088
|
+
type: ContentChild,
|
|
3089
|
+
args: [DataTableTemplateExpandableCellDefinition]
|
|
2359
3090
|
}] } });
|
|
2360
3091
|
|
|
2361
|
-
class DataTableModule {
|
|
2362
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2363
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: DataTableModule, declarations: [DataTableComponent, DataTableColumnsModalComponent], imports: [CommonModule,
|
|
2364
|
-
MatButtonModule,
|
|
2365
|
-
MatIconModule,
|
|
2366
|
-
MatFormFieldModule,
|
|
2367
|
-
MatInputModule,
|
|
2368
|
-
MatMenuModule,
|
|
2369
|
-
MatPaginatorModule,
|
|
2370
|
-
MatSortModule,
|
|
2371
|
-
MatTableModule,
|
|
2372
|
-
MatProgressSpinnerModule,
|
|
2373
|
-
ButtonModule,
|
|
2374
|
-
TranslateModule,
|
|
2375
|
-
MatCheckboxModule,
|
|
2376
|
-
MatBadgeModule,
|
|
2377
|
-
DragDropModule,
|
|
2378
|
-
FormsModule], exports: [DataTableComponent, DataTableColumnsModalComponent] }); }
|
|
2379
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableModule, imports: [CommonModule,
|
|
2380
|
-
MatButtonModule,
|
|
2381
|
-
MatIconModule,
|
|
2382
|
-
MatFormFieldModule,
|
|
2383
|
-
MatInputModule,
|
|
2384
|
-
MatMenuModule,
|
|
2385
|
-
MatPaginatorModule,
|
|
2386
|
-
MatSortModule,
|
|
2387
|
-
MatTableModule,
|
|
2388
|
-
MatProgressSpinnerModule,
|
|
2389
|
-
ButtonModule,
|
|
2390
|
-
TranslateModule,
|
|
2391
|
-
MatCheckboxModule,
|
|
2392
|
-
MatBadgeModule,
|
|
2393
|
-
DragDropModule,
|
|
2394
|
-
FormsModule] }); }
|
|
2395
|
-
}
|
|
2396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: DataTableModule, decorators: [{
|
|
2397
|
-
type: NgModule,
|
|
2398
|
-
args: [{
|
|
2399
|
-
declarations: [DataTableComponent, DataTableColumnsModalComponent],
|
|
2400
|
-
imports: [
|
|
2401
|
-
CommonModule,
|
|
2402
|
-
MatButtonModule,
|
|
2403
|
-
MatIconModule,
|
|
2404
|
-
MatFormFieldModule,
|
|
2405
|
-
MatInputModule,
|
|
2406
|
-
MatMenuModule,
|
|
2407
|
-
MatPaginatorModule,
|
|
2408
|
-
MatSortModule,
|
|
2409
|
-
MatTableModule,
|
|
2410
|
-
MatProgressSpinnerModule,
|
|
2411
|
-
ButtonModule,
|
|
2412
|
-
TranslateModule,
|
|
2413
|
-
MatCheckboxModule,
|
|
2414
|
-
MatBadgeModule,
|
|
2415
|
-
DragDropModule,
|
|
2416
|
-
FormsModule,
|
|
2417
|
-
],
|
|
2418
|
-
exports: [DataTableComponent, DataTableColumnsModalComponent],
|
|
2419
|
-
}]
|
|
2420
|
-
}] });
|
|
2421
|
-
|
|
2422
3092
|
class StepHeaderComponent extends CdkStepHeader {
|
|
2423
3093
|
constructor(_focusMonitor, _elementRef) {
|
|
2424
3094
|
super(_elementRef);
|
|
@@ -2624,7 +3294,7 @@ class StepperComponent extends CdkStepper {
|
|
|
2624
3294
|
_stepIsNavigable(index, step) {
|
|
2625
3295
|
return step.completed || this.selectedIndex === index || !this.linear;
|
|
2626
3296
|
}
|
|
2627
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: StepperComponent, deps: [{ token: i3$
|
|
3297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: StepperComponent, deps: [{ token: i3$3.Directionality, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2628
3298
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: StepperComponent, selector: "mad-stepper", inputs: { nextButtonLabel: "nextButtonLabel", doneButtonLabel: "doneButtonLabel" }, outputs: { animationDone: "animationDone" }, host: { attributes: { "role": "tablist" }, properties: { "class.stepper-vertical": "true", "attr.aria-orientation": "\"vertical\"" } }, providers: [{ provide: CdkStepper, useExisting: StepperComponent }], queries: [{ propertyName: "_steps", predicate: StepComponent, descendants: true }], viewQueries: [{ propertyName: "_stepHeader", predicate: StepHeaderComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- Vertical stepper -->\n<ng-container>\n <div *ngFor=\"let step of steps; let i = index; let isLast = last; let isFirst = first\">\n <ng-container [ngTemplateOutlet]=\"stepTemplate\" [ngTemplateOutletContext]=\"{ step: step, i: i }\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div\n class=\"vertical-stepper-content\"\n role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\"\n >\n <div class=\"vertical-content\">\n <ng-container\n [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{\n step: step,\n i: i,\n last: isLast,\n first: isFirst,\n nextBtnLbl: this.nextButtonLabel,\n doneBtnLbl: this.doneButtonLabel\n }\"\n ></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mad-step-header\n class=\"mat-vertical-stepper-header\"\n (click)=\"step.selectAndMarkAsTouched(i)\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"!step.ariaLabel && step.ariaLabelledby ? step.ariaLabelledby : null\"\n [attr.aria-disabled]=\"_stepIsNavigable(i, step) ? null : true\"\n [index]=\"i\"\n [completed]=\"step.completed\"\n [hasError]=\"step.hasError\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"_stepIsNavigable(i, step)\"\n [optional]=\"step.optional\"\n [closed]=\"step.stepClosed\"\n [errorMessage]=\"step.errorMessage\"\n ></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey;flex-direction:column;box-sizing:border-box;display:flex}.step-content,.step-buttons{padding:2em}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: StepHeaderComponent, selector: "mad-step-header", inputs: ["color", "index", "label", "state", "errorMessage", "selected", "active", "optional", "hasError", "completed", "closed"] }], animations: [madStepperAnimations.verticalStepTransition], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2629
3299
|
}
|
|
2630
3300
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: StepperComponent, decorators: [{
|
|
@@ -2634,7 +3304,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
2634
3304
|
'[attr.aria-orientation]': '"vertical"',
|
|
2635
3305
|
role: 'tablist',
|
|
2636
3306
|
}, animations: [madStepperAnimations.verticalStepTransition], providers: [{ provide: CdkStepper, useExisting: StepperComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- Vertical stepper -->\n<ng-container>\n <div *ngFor=\"let step of steps; let i = index; let isLast = last; let isFirst = first\">\n <ng-container [ngTemplateOutlet]=\"stepTemplate\" [ngTemplateOutletContext]=\"{ step: step, i: i }\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div\n class=\"vertical-stepper-content\"\n role=\"tabpanel\"\n [@stepTransition]=\"_getAnimationDirection(i)\"\n (@stepTransition.done)=\"_animationDone.next($event)\"\n [id]=\"_getStepContentId(i)\"\n [attr.aria-labelledby]=\"_getStepLabelId(i)\"\n [attr.aria-expanded]=\"selectedIndex === i\"\n >\n <div class=\"vertical-content\">\n <ng-container\n [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{\n step: step,\n i: i,\n last: isLast,\n first: isFirst,\n nextBtnLbl: this.nextButtonLabel,\n doneBtnLbl: this.doneButtonLabel\n }\"\n ></ng-container>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template let-step=\"step\" let-i=\"i\" #stepTemplate>\n <mad-step-header\n class=\"mat-vertical-stepper-header\"\n (click)=\"step.selectAndMarkAsTouched(i)\"\n (keydown)=\"_onKeydown($event)\"\n [tabIndex]=\"_getFocusIndex() === i ? 0 : -1\"\n [id]=\"_getStepLabelId(i)\"\n [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"steps.length\"\n [attr.aria-controls]=\"_getStepContentId(i)\"\n [attr.aria-selected]=\"selectedIndex == i\"\n [attr.aria-label]=\"step.ariaLabel || null\"\n [attr.aria-labelledby]=\"!step.ariaLabel && step.ariaLabelledby ? step.ariaLabelledby : null\"\n [attr.aria-disabled]=\"_stepIsNavigable(i, step) ? null : true\"\n [index]=\"i\"\n [completed]=\"step.completed\"\n [hasError]=\"step.hasError\"\n [state]=\"_getIndicatorType(i, step.state)\"\n [label]=\"step.stepLabel || step.label\"\n [selected]=\"selectedIndex === i\"\n [active]=\"_stepIsNavigable(i, step)\"\n [optional]=\"step.optional\"\n [closed]=\"step.stepClosed\"\n [errorMessage]=\"step.errorMessage\"\n ></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}.vertical-content-container{border:none}[dir=rtl] .vertical-content-container{margin-left:0;margin-right:36px}.vertical-stepper-content{overflow:hidden;outline:0}.vertical-content{padding:0 24px}.step-container{border-left:1px solid lightgrey;border-right:1px solid lightgrey;border-bottom:1px solid lightgrey;flex-direction:column;box-sizing:border-box;display:flex}.step-content,.step-buttons{padding:2em}\n"] }]
|
|
2637
|
-
}], ctorParameters: () => [{ type: i3$
|
|
3307
|
+
}], ctorParameters: () => [{ type: i3$3.Directionality, decorators: [{
|
|
2638
3308
|
type: Optional
|
|
2639
3309
|
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { animationDone: [{
|
|
2640
3310
|
type: Output
|
|
@@ -3165,11 +3835,11 @@ class ToolbarComponent {
|
|
|
3165
3835
|
return this.getToolbarActions().filter((value) => !!value.importantAction).length > 0;
|
|
3166
3836
|
}
|
|
3167
3837
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$5.BreakpointObserver }, { token: i2$4.Title }, { token: ToolbarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3168
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ToolbarComponent, selector: "mad-toolbar", ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink(getBackAction())\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\" *ngIf=\"isRouterLink(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n <a (click)=\"mainAction.action()\" *ngIf=\"isAction(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n *ngIf=\"isRouterLink(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n <mad-material-action-button\n *ngIf=\"isAction(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n \"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '⁠' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button\n *ngIf=\"i >= (hasImportantToolbarActions() ? 0 : 1)\"\n mat-menu-item\n (click)=\"action.action()\"\n [title]=\"action.actionName\"\n >\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8
|
|
3838
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ToolbarComponent, selector: "mad-toolbar", ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink(getBackAction())\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\" *ngIf=\"isRouterLink(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n <a (click)=\"mainAction.action()\" *ngIf=\"isAction(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n *ngIf=\"isRouterLink(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n <mad-material-action-button\n *ngIf=\"isAction(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n \"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '⁠' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button\n *ngIf=\"i >= (hasImportantToolbarActions() ? 0 : 1)\"\n mat-menu-item\n (click)=\"action.action()\"\n [title]=\"action.actionName\"\n >\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: ["actionName", "id", "icon", "routerLink", "liftHigher", "liftHigher2"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: i14.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
|
|
3169
3839
|
}
|
|
3170
3840
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
3171
3841
|
type: Component,
|
|
3172
|
-
args: [{ selector: 'mad-toolbar', template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink(getBackAction())\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\" *ngIf=\"isRouterLink(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n <a (click)=\"mainAction.action()\" *ngIf=\"isAction(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n *ngIf=\"isRouterLink(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n <mad-material-action-button\n *ngIf=\"isAction(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n \"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '⁠' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button\n *ngIf=\"i >= (hasImportantToolbarActions() ? 0 : 1)\"\n mat-menu-item\n (click)=\"action.action()\"\n [title]=\"action.actionName\"\n >\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"] }]
|
|
3842
|
+
args: [{ selector: 'mad-toolbar', template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a [href]=\"getBackAction().href\" *ngIf=\"isAbsoluteLink(getBackAction())\">\n <button [id]=\"'go-back'\" class=\"go-back-button\" color=\"primary\" mat-icon-button>\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n <a (click)=\"getBackAction().action()\" *ngIf=\"isAction(getBackAction())\">\n <button [id]=\"'go-back'\" color=\"primary\" mat-icon-button class=\"go-back-button\">\n <mat-icon>{{ getBackAction().matIcon }}</mat-icon>\n </button>\n </a>\n\n <span class=\"toolbar-title\">{{ getTitle() }}</span>\n\n <ng-container *ngFor=\"let mainAction of getMainActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(mainAction) | async\">\n <div *ngIf=\"!(isHandset$ | async)\">\n <a [routerLink]=\"mainAction.routerLink\" *ngIf=\"isRouterLink(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n <a (click)=\"mainAction.action()\" *ngIf=\"isAction(mainAction)\">\n <mad-primary-button [id]=\"mainAction.matIcon\" style=\"margin-left: 56px\" [matTooltip]=\"mainAction.tooltip\">\n <mat-icon>{{ mainAction.matIcon }}</mat-icon>\n {{ mainAction.actionName }}\n </mad-primary-button>\n </a>\n </div>\n <div *ngIf=\"isHandset$ | async\">\n <mad-material-action-button\n *ngIf=\"isRouterLink(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n [routerLink]=\"mainAction.routerLink\"\n [id]=\"mainAction.matIcon\"\n />\n <mad-material-action-button\n *ngIf=\"isAction(getBackAction())\"\n [actionName]=\"mainAction.actionName\"\n [icon]=\"mainAction.matIcon\"\n [liftHigher]=\"mainAction.liftHigherOnMobile\"\n [liftHigher2]=\"i > 0\"\n (click)=\"mainAction.action()\"\n [id]=\"mainAction.matIcon\"\n />\n </div>\n </ng-container>\n </ng-container>\n\n <div class=\"right-aligned no-print\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <mad-icon-button\n (click)=\"action.action()\"\n *ngIf=\"\n (!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) ||\n i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0 : 1) : 2) ||\n !!action.importantAction\n \"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\"\n >\n <mat-icon\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n matBadgePosition=\"below after\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n >{{ action.matIcon }}</mat-icon\n >\n </mad-icon-button>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"(isHandset$ | async) || getToolbarActionsAlwaysAsMenu()\">\n <ng-container *ngIf=\"getToolbarActions().length > 2\">\n <mad-icon-button type=\"button\" [matMenuTriggerFor]=\"burgerMenu\" [matTooltip]=\"getToolbarActionsMenuTitle()\">\n <mat-icon\n matBadgeColor=\"warn\"\n [matBadge]=\"showBadgeForMenu() ? '⁠' : null\"\n matBadgeSize=\"small\"\n matBadgePosition=\"above after\"\n >more_vert\n </mat-icon>\n </mad-icon-button>\n <mat-menu #burgerMenu=\"matMenu\" class=\"no-print toolbar-menu\">\n <ng-container *ngFor=\"let action of getToolbarActions(); let i = index\">\n <ng-container *ngIf=\"!action.importantAction\">\n <ng-container *ngIf=\"hasPermission(action) | async\">\n <button\n *ngIf=\"i >= (hasImportantToolbarActions() ? 0 : 1)\"\n mat-menu-item\n (click)=\"action.action()\"\n [title]=\"action.actionName\"\n >\n <mat-icon\n color=\"primary\"\n [matBadgeColor]=\"action.badge ? action.badge.color : 'primary'\"\n [matBadge]=\"action.badge ? action.badge.value : null\"\n matBadgePosition=\"below after\"\n >{{ action.matIcon }}</mat-icon\n >\n {{ action.actionName }}\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </mat-menu>\n </ng-container>\n </ng-container>\n </div>\n</mat-toolbar>\n", styles: ["mat-toolbar{background:white}.content-toolbar{height:57px;border-bottom:1px solid #dcdcdc}.right-aligned{overflow:hidden;margin-left:auto;margin-right:0}.go-back-button{padding-left:0;padding-right:0}.toolbar-title{margin-right:72px}::ng-deep .mat-badge-content{bottom:-7px!important;right:-7px!important}\n"] }]
|
|
3173
3843
|
}], ctorParameters: () => [{ type: i1$5.BreakpointObserver }, { type: i2$4.Title }, { type: ToolbarService }] });
|
|
3174
3844
|
|
|
3175
3845
|
class ToolbarModule {
|
|
@@ -3356,7 +4026,7 @@ class FileUploadComponent {
|
|
|
3356
4026
|
window.open(window.URL.createObjectURL(file));
|
|
3357
4027
|
}
|
|
3358
4028
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3359
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: FileUploadComponent, isStandalone: true, selector: "mad-file-upload", inputs: { id: "id", multiple: "multiple", accept: "accept", text: "text", showFileList: "showFileList" }, outputs: { fileEmitter: "fileEmitter", errorEmitter: "errorEmitter" }, ngImport: i0, template: "<mat-card\n (click)=\"fileInput.click()\"\n (onFileDropped)=\"uploadFile($event)\"\n class=\"uploadFileContainer\"\n madDragAndDrop\n id=\"uploadFileContainer\"\n>\n <input\n #fileInput\n (change)=\"uploadFile($event.target.files)\"\n (click)=\"fileInput.value = null\"\n [accept]=\"acceptForInput\"\n [id]=\"id\"\n [multiple]=\"multiple\"\n hidden\n type=\"file\"\n />\n <mat-card-content>\n <mat-icon>vertical_align_top</mat-icon>\n {{ text ? text : 'Upload' }}\n </mat-card-content>\n</mat-card>\n\n<ng-container *ngIf=\"showFileList\">\n <mat-chip-listbox>\n <mat-chip *ngFor=\"let file of fileList\" (click)=\"openFile(file)\" class=\"download\">{{ file.name }}</mat-chip>\n </mat-chip-listbox>\n</ng-container>\n", styles: [".uploadFileContainer{background-repeat:no-repeat;background-position:center;height:100px;margin:0;border:2px dashed var(--main-primary)}.uploadFileContainer:hover{cursor:pointer;background-color:var(--selection-background)!important;opacity:.8}.uploadFileContainer,.mat-mdc-card-content{display:flex;justify-content:center;align-items:center}.download{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i2$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i2$1.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DragAndDropDirectiveDirective, selector: "[madDragAndDrop]", outputs: ["onFileDropped"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$
|
|
4029
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: FileUploadComponent, isStandalone: true, selector: "mad-file-upload", inputs: { id: "id", multiple: "multiple", accept: "accept", text: "text", showFileList: "showFileList" }, outputs: { fileEmitter: "fileEmitter", errorEmitter: "errorEmitter" }, ngImport: i0, template: "<mat-card\n (click)=\"fileInput.click()\"\n (onFileDropped)=\"uploadFile($event)\"\n class=\"uploadFileContainer\"\n madDragAndDrop\n id=\"uploadFileContainer\"\n>\n <input\n #fileInput\n (change)=\"uploadFile($event.target.files)\"\n (click)=\"fileInput.value = null\"\n [accept]=\"acceptForInput\"\n [id]=\"id\"\n [multiple]=\"multiple\"\n hidden\n type=\"file\"\n />\n <mat-card-content>\n <mat-icon>vertical_align_top</mat-icon>\n {{ text ? text : 'Upload' }}\n </mat-card-content>\n</mat-card>\n\n<ng-container *ngIf=\"showFileList\">\n <mat-chip-listbox>\n <mat-chip *ngFor=\"let file of fileList\" (click)=\"openFile(file)\" class=\"download\">{{ file.name }}</mat-chip>\n </mat-chip-listbox>\n</ng-container>\n", styles: [".uploadFileContainer{background-repeat:no-repeat;background-position:center;height:100px;margin:0;border:2px dashed var(--main-primary)}.uploadFileContainer:hover{cursor:pointer;background-color:var(--selection-background)!important;opacity:.8}.uploadFileContainer,.mat-mdc-card-content{display:flex;justify-content:center;align-items:center}.download{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i2$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i2$1.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: DragAndDropDirectiveDirective, selector: "[madDragAndDrop]", outputs: ["onFileDropped"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i4$2.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disabled", "disableRipple", "tabIndex", "role", "id", "aria-label", "aria-description", "value", "removable", "highlighted"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i4$2.MatChipListbox, selector: "mat-chip-listbox", inputs: ["tabIndex", "multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }] }); }
|
|
3360
4030
|
}
|
|
3361
4031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: FileUploadComponent, decorators: [{
|
|
3362
4032
|
type: Component,
|
|
@@ -3385,5 +4055,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
3385
4055
|
* Generated bundle index. Do not edit.
|
|
3386
4056
|
*/
|
|
3387
4057
|
|
|
3388
|
-
export { BaseQuickListComponent, ButtonModule, CardComponent, CardModule, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelContainerSidebarComponent, ContentPanelModule, DangerButtonComponent, DataTableColumnsModalComponent, DataTableComponent,
|
|
4058
|
+
export { BaseQuickListComponent, ButtonModule, CardComponent, CardModule, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelContainerSidebarComponent, ContentPanelModule, DangerButtonComponent, DataTableActionType, DataTableColumnsModalComponent, DataTableComponent, DataTablePersistenceService, DataTableTemplateCellDefinition, DataTableTemplateColumnDefinition, DataTableTemplateExpandableCellDefinition, DataTableTemplateExpandableColumnDefinition, FileUploadComponent, FlowbarComponent, FlowbarModule, IconButtonComponent, LinkButtonComponent, MAD_DATA_TABLE_GLOBAL_CONFIGURATION, MAD_DATA_TABLE_PERSISTENCE_SERVICE, MadBasicButton, MadButtonDirective, MadButtonGroupComponent, MainContainerComponent, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldDirective, NumericFieldModule, OutlineButtonComponent, PrimaryButtonComponent, QuickListCompactComponent, QuickListComponent, QuickListModule, ReactiveFormQuickListCompactComponent, ReactiveFormQuickListComponent, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, SidebarComponent, SidebarItemComponent, SidebarModule, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, TableComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, ToolbarComponent, ToolbarModule, ToolbarService, madStepperAnimations };
|
|
3389
4059
|
//# sourceMappingURL=porscheinformatik-material-addons.mjs.map
|