@porscheinformatik/material-addons 10.4.0 → 14.0.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/fesm2015/porscheinformatik-material-addons.mjs +2984 -0
- package/fesm2015/porscheinformatik-material-addons.mjs.map +1 -0
- package/lib/button/button.d.ts +7 -0
- package/lib/button/button.d.ts.map +1 -0
- package/lib/button/button.module.d.ts +15 -0
- package/lib/button/button.module.d.ts.map +1 -0
- package/lib/button/danger-button/danger-button.component.d.ts +4 -0
- package/lib/button/danger-button/danger-button.component.d.ts.map +1 -0
- package/lib/button/flat-button/link-button.component.d.ts +4 -0
- package/lib/button/flat-button/link-button.component.d.ts.map +1 -0
- package/lib/button/icon-button/icon-button.component.d.ts +4 -0
- package/lib/button/icon-button/icon-button.component.d.ts.map +1 -0
- package/lib/button/mad-basic-button.d.ts +5 -1
- package/lib/button/mad-basic-button.d.ts.map +1 -0
- package/lib/button/outline-button/outline-button.component.d.ts +4 -0
- package/lib/button/outline-button/outline-button.component.d.ts.map +1 -0
- package/lib/button/primary-button/primary-button.component.d.ts +4 -0
- package/lib/button/primary-button/primary-button.component.d.ts.map +1 -0
- package/lib/card/card.component.d.ts +4 -0
- package/lib/card/card.component.d.ts.map +1 -0
- package/lib/card/card.d.ts +2 -0
- package/lib/card/card.d.ts.map +1 -0
- package/lib/card/card.module.d.ts +12 -0
- package/lib/card/card.module.d.ts.map +1 -0
- package/lib/content-panel/content-header/content-header.component.d.ts +4 -0
- package/lib/content-panel/content-header/content-header.component.d.ts.map +1 -0
- package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts +4 -0
- package/lib/content-panel/content-panel-container/content-panel-container.component.d.ts.map +1 -0
- package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts +4 -0
- package/lib/content-panel/content-panel-container-content/content-panel-container-content.component.d.ts.map +1 -0
- package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts +4 -0
- package/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.d.ts.map +1 -0
- package/lib/content-panel/content-panel.module.d.ts +11 -0
- package/lib/content-panel/content-panel.module.d.ts.map +1 -0
- package/lib/content-panel/main-container/main-container.component.d.ts +4 -0
- package/lib/content-panel/main-container/main-container.component.d.ts.map +1 -0
- package/lib/data-table/data-table-action-type.d.ts +1 -0
- package/lib/data-table/data-table-action-type.d.ts.map +1 -0
- package/lib/data-table/data-table-action.d.ts +1 -0
- package/lib/data-table/data-table-action.d.ts.map +1 -0
- package/lib/data-table/data-table-column-definition.d.ts +1 -0
- package/lib/data-table/data-table-column-definition.d.ts.map +1 -0
- package/lib/data-table/data-table-column.d.ts +1 -0
- package/lib/data-table/data-table-column.d.ts.map +1 -0
- package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts +4 -0
- package/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.d.ts.map +1 -0
- package/lib/data-table/data-table.component.d.ts +4 -0
- package/lib/data-table/data-table.component.d.ts.map +1 -0
- package/lib/data-table/data-table.d.ts +3 -0
- package/lib/data-table/data-table.d.ts.map +1 -0
- package/lib/data-table/data-table.module.d.ts +23 -0
- package/lib/data-table/data-table.module.d.ts.map +1 -0
- package/lib/flowbar/flowbar.component.d.ts +4 -0
- package/lib/flowbar/flowbar.component.d.ts.map +1 -0
- package/lib/flowbar/flowbar.module.d.ts +8 -0
- package/lib/flowbar/flowbar.module.d.ts.map +1 -0
- package/lib/material-action-button/material-action-button.component.d.ts +4 -0
- package/lib/material-action-button/material-action-button.component.d.ts.map +1 -0
- package/lib/material-action-button/material-action-button.module.d.ts +11 -0
- package/lib/material-action-button/material-action-button.module.d.ts.map +1 -0
- package/lib/material-addons.module.d.ts +13 -0
- package/lib/material-addons.module.d.ts.map +1 -0
- package/lib/numeric-field/number-format.service.d.ts +4 -0
- package/lib/numeric-field/number-format.service.d.ts.map +1 -0
- package/lib/numeric-field/numeric-field.d.ts +2 -0
- package/lib/numeric-field/numeric-field.d.ts.map +1 -0
- package/lib/numeric-field/numeric-field.directive.d.ts +4 -0
- package/lib/numeric-field/numeric-field.directive.d.ts.map +1 -0
- package/lib/numeric-field/numeric-field.module.d.ts +6 -0
- package/lib/numeric-field/numeric-field.module.d.ts.map +1 -0
- package/lib/quick-list/base-quick-list.component.d.ts +5 -0
- package/lib/quick-list/base-quick-list.component.d.ts.map +1 -0
- package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts +4 -0
- package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts.map +1 -0
- package/lib/quick-list/quick-list.component.d.ts +4 -0
- package/lib/quick-list/quick-list.component.d.ts.map +1 -0
- package/lib/quick-list/quick-list.d.ts +4 -0
- package/lib/quick-list/quick-list.d.ts.map +1 -0
- package/lib/quick-list/quick-list.module.d.ts +12 -0
- package/lib/quick-list/quick-list.module.d.ts.map +1 -0
- package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts +4 -0
- package/lib/readonly/readonly-form-field/readonly-form-field.component.d.ts.map +1 -0
- package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts +4 -0
- package/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.d.ts.map +1 -0
- package/lib/readonly/readonly-form-field.module.d.ts +13 -0
- package/lib/readonly/readonly-form-field.module.d.ts.map +1 -0
- package/lib/stepper/mad-stepper-animation.d.ts +1 -0
- package/lib/stepper/mad-stepper-animation.d.ts.map +1 -0
- package/lib/stepper/step-header/step-header.component.d.ts +4 -0
- package/lib/stepper/step-header/step-header.component.d.ts.map +1 -0
- package/lib/stepper/stepper.component.d.ts +7 -1
- package/lib/stepper/stepper.component.d.ts.map +1 -0
- package/lib/stepper/stepper.module.d.ts +12 -0
- package/lib/stepper/stepper.module.d.ts.map +1 -0
- package/lib/table/column-header.d.ts +1 -0
- package/lib/table/column-header.d.ts.map +1 -0
- package/lib/table/table-action.d.ts +1 -0
- package/lib/table/table-action.d.ts.map +1 -0
- package/lib/table/table.component.d.ts +4 -0
- package/lib/table/table.component.d.ts.map +1 -0
- package/lib/table/table.d.ts +2 -0
- package/lib/table/table.d.ts.map +1 -0
- package/lib/table/table.module.d.ts +16 -0
- package/lib/table/table.module.d.ts.map +1 -0
- package/lib/throttle-click/throttle-click.directive.d.ts +4 -0
- package/lib/throttle-click/throttle-click.directive.d.ts.map +1 -0
- package/lib/throttle-click/throttle-click.module.d.ts +7 -0
- package/lib/throttle-click/throttle-click.module.d.ts.map +1 -0
- package/lib/toolbar/toolbar-action.interface.d.ts +1 -0
- package/lib/toolbar/toolbar-action.interface.d.ts.map +1 -0
- package/lib/toolbar/toolbar.component.d.ts +4 -0
- package/lib/toolbar/toolbar.component.d.ts.map +1 -0
- package/lib/toolbar/toolbar.module.d.ts +16 -0
- package/lib/toolbar/toolbar.module.d.ts.map +1 -0
- package/lib/toolbar/toolbar.service.d.ts +4 -0
- package/lib/toolbar/toolbar.service.d.ts.map +1 -0
- package/package.json +29 -16
- package/public-api.d.ts +5 -0
- package/themes/common/styles.scss +23 -22
- package/bundles/porscheinformatik-material-addons.umd.js +0 -3299
- package/bundles/porscheinformatik-material-addons.umd.js.map +0 -1
- package/bundles/porscheinformatik-material-addons.umd.min.js +0 -17
- package/bundles/porscheinformatik-material-addons.umd.min.js.map +0 -1
- package/esm2015/lib/button/button.module.js +0 -21
- package/esm2015/lib/button/danger-button/danger-button.component.js +0 -25
- package/esm2015/lib/button/flat-button/link-button.component.js +0 -25
- package/esm2015/lib/button/icon-button/icon-button.component.js +0 -25
- package/esm2015/lib/button/mad-basic-button.js +0 -28
- package/esm2015/lib/button/outline-button/outline-button.component.js +0 -25
- package/esm2015/lib/button/primary-button/primary-button.component.js +0 -25
- package/esm2015/lib/card/card.component.js +0 -86
- package/esm2015/lib/card/card.module.js +0 -18
- package/esm2015/lib/content-panel/content-header/content-header.component.js +0 -11
- package/esm2015/lib/content-panel/content-panel-container/content-panel-container.component.js +0 -11
- package/esm2015/lib/content-panel/content-panel-container-content/content-panel-container-content.component.js +0 -11
- package/esm2015/lib/content-panel/content-panel-container-footer/content-panel-container-footer.component.js +0 -11
- package/esm2015/lib/content-panel/content-panel.module.js +0 -29
- package/esm2015/lib/content-panel/main-container/main-container.component.js +0 -11
- package/esm2015/lib/data-table/data-table-action-type.js +0 -6
- package/esm2015/lib/data-table/data-table-action.js +0 -1
- package/esm2015/lib/data-table/data-table-column-definition.js +0 -1
- package/esm2015/lib/data-table/data-table-column.js +0 -1
- package/esm2015/lib/data-table/data-table-columns-modal/data-table-columns-modal.component.js +0 -93
- package/esm2015/lib/data-table/data-table.component.js +0 -459
- package/esm2015/lib/data-table/data-table.js +0 -1
- package/esm2015/lib/data-table/data-table.module.js +0 -46
- package/esm2015/lib/flowbar/flowbar.component.js +0 -182
- package/esm2015/lib/flowbar/flowbar.module.js +0 -14
- package/esm2015/lib/material-action-button/material-action-button.component.js +0 -25
- package/esm2015/lib/material-action-button/material-action-button.module.js +0 -17
- package/esm2015/lib/material-addons.module.js +0 -26
- package/esm2015/lib/numeric-field/number-format.service.js +0 -137
- package/esm2015/lib/numeric-field/numeric-field.directive.js +0 -275
- package/esm2015/lib/numeric-field/numeric-field.module.js +0 -19
- package/esm2015/lib/quick-list/base-quick-list.component.js +0 -89
- package/esm2015/lib/quick-list/quick-list-compact/quick-list-compact.component.js +0 -18
- package/esm2015/lib/quick-list/quick-list.component.js +0 -19
- package/esm2015/lib/quick-list/quick-list.module.js +0 -18
- package/esm2015/lib/readonly/readonly-form-field/readonly-form-field.component.js +0 -131
- package/esm2015/lib/readonly/readonly-form-field-wrapper/readonly-form-field-wrapper.component.js +0 -164
- package/esm2015/lib/readonly/readonly-form-field.module.js +0 -19
- package/esm2015/lib/stepper/mad-stepper-animation.js +0 -13
- package/esm2015/lib/stepper/step-header/step-header.component.js +0 -75
- package/esm2015/lib/stepper/stepper.component.js +0 -169
- package/esm2015/lib/stepper/stepper.module.js +0 -18
- package/esm2015/lib/table/column-header.js +0 -1
- package/esm2015/lib/table/table-action.js +0 -1
- package/esm2015/lib/table/table.component.js +0 -106
- package/esm2015/lib/table/table.js +0 -1
- package/esm2015/lib/table/table.module.js +0 -33
- package/esm2015/lib/throttle-click/throttle-click.directive.js +0 -32
- package/esm2015/lib/throttle-click/throttle-click.module.js +0 -13
- package/esm2015/lib/toolbar/toolbar-action.interface.js +0 -1
- package/esm2015/lib/toolbar/toolbar.component.js +0 -71
- package/esm2015/lib/toolbar/toolbar.module.js +0 -33
- package/esm2015/lib/toolbar/toolbar.service.js +0 -127
- package/esm2015/porscheinformatik-material-addons.js +0 -19
- package/esm2015/public-api.js +0 -37
- package/fesm2015/porscheinformatik-material-addons.js +0 -2656
- package/fesm2015/porscheinformatik-material-addons.js.map +0 -1
- package/porscheinformatik-material-addons.d.ts +0 -19
- package/porscheinformatik-material-addons.metadata.json +0 -1
|
@@ -0,0 +1,2984 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input, NgModule, HostBinding, ElementRef, ViewChild, LOCALE_ID, Injectable, Inject, EventEmitter, forwardRef, Directive, Output, HostListener, TemplateRef, ContentChild, ViewChildren, ViewEncapsulation, ChangeDetectionStrategy, QueryList, Optional, ContentChildren } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@angular/router';
|
|
6
|
+
import { RouterModule, NavigationEnd } from '@angular/router';
|
|
7
|
+
import * as i1$2 from '@angular/material/button';
|
|
8
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
+
import * as i2 from '@angular/material/icon';
|
|
10
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
11
|
+
import * as i5 from '@angular/material/tooltip';
|
|
12
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
|
+
import * as i3 from '@angular/material/form-field';
|
|
14
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
15
|
+
import * as i4 from '@angular/material/input';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import * as i5$1 from '@angular/forms';
|
|
18
|
+
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
19
|
+
import { of, Subject, Subscription } from 'rxjs';
|
|
20
|
+
import * as i1$3 from '@angular/cdk/layout';
|
|
21
|
+
import { Breakpoints } from '@angular/cdk/layout';
|
|
22
|
+
import { map, throttleTime, switchMap, tap, startWith, takeUntil, distinctUntilChanged } from 'rxjs/operators';
|
|
23
|
+
import * as i2$2 from '@angular/platform-browser';
|
|
24
|
+
import * as i2$1 from '@ngx-translate/core';
|
|
25
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
26
|
+
import * as i6 from '@angular/material/menu';
|
|
27
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
28
|
+
import * as i8 from '@angular/material/toolbar';
|
|
29
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
30
|
+
import * as i14 from '@angular/material/badge';
|
|
31
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
32
|
+
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
33
|
+
import * as i2$3 from '@angular/material/card';
|
|
34
|
+
import { MatCardModule } from '@angular/material/card';
|
|
35
|
+
import * as i8$1 from '@angular/material/table';
|
|
36
|
+
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
37
|
+
import * as i6$1 from '@angular/material/paginator';
|
|
38
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
39
|
+
import * as i7 from '@angular/material/sort';
|
|
40
|
+
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
41
|
+
import * as i1$4 from '@angular/material/dialog';
|
|
42
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
43
|
+
import * as i10 from '@angular/cdk/drag-drop';
|
|
44
|
+
import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
|
|
45
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
46
|
+
import { v4 } from 'uuid';
|
|
47
|
+
import * as i10$1 from '@angular/material/progress-spinner';
|
|
48
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
49
|
+
import * as i13 from '@angular/material/checkbox';
|
|
50
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
51
|
+
import { CdkStepHeader, STEP_STATE, CdkStep, CdkStepper, CdkStepperModule } from '@angular/cdk/stepper';
|
|
52
|
+
import * as i1$5 from '@angular/cdk/a11y';
|
|
53
|
+
import * as i4$1 from '@angular/flex-layout';
|
|
54
|
+
import { FlexModule } from '@angular/flex-layout';
|
|
55
|
+
import * as i4$2 from '@angular/cdk/bidi';
|
|
56
|
+
import * as i2$4 from '@angular/material/stepper';
|
|
57
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
58
|
+
|
|
59
|
+
class MaterialActionButtonComponent {
|
|
60
|
+
constructor() {
|
|
61
|
+
this.icon = 'add';
|
|
62
|
+
// Sets the lower padding higher providing some bottom space for a fixed paginator
|
|
63
|
+
this.liftHigher = true;
|
|
64
|
+
this.liftHigher2 = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
MaterialActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
+
MaterialActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MaterialActionButtonComponent, selector: "mad-material-action-button", inputs: { actionName: "actionName", id: "id", icon: "icon", routerLink: "routerLink", liftHigher: "liftHigher", liftHigher2: "liftHigher2" }, ngImport: i0, template: "<div class=\"material-action-button {{ liftHigher ? 'lift-higher' : '' }} {{ liftHigher2 ? 'lift-higher-2' : '' }}\">\n <a [routerLink]=\"routerLink\">\n <button [id]=\"id\" mat-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"primary\" *ngIf=\"!liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n <button [id]=\"id\" mat-mini-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"accent\" *ngIf=\"liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n </a>\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonComponent, decorators: [{
|
|
70
|
+
type: Component,
|
|
71
|
+
args: [{ selector: 'mad-material-action-button', template: "<div class=\"material-action-button {{ liftHigher ? 'lift-higher' : '' }} {{ liftHigher2 ? 'lift-higher-2' : '' }}\">\n <a [routerLink]=\"routerLink\">\n <button [id]=\"id\" mat-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"primary\" *ngIf=\"!liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n <button [id]=\"id\" mat-mini-fab [matTooltipPosition]=\"'left'\" [matTooltip]=\"actionName\" color=\"accent\" *ngIf=\"liftHigher2\">\n <mat-icon>{{ icon }}</mat-icon>\n </button>\n </a>\n</div>\n", styles: [".material-action-button{position:fixed;bottom:20px;right:20px;z-index:100;display:flex;flex-direction:column-reverse;align-items:center}.lift-higher{bottom:61px}.lift-higher-2{right:28px;bottom:121px}\n"] }]
|
|
72
|
+
}], propDecorators: { actionName: [{
|
|
73
|
+
type: Input
|
|
74
|
+
}], id: [{
|
|
75
|
+
type: Input
|
|
76
|
+
}], icon: [{
|
|
77
|
+
type: Input
|
|
78
|
+
}], routerLink: [{
|
|
79
|
+
type: Input
|
|
80
|
+
}], liftHigher: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}], liftHigher2: [{
|
|
83
|
+
type: Input
|
|
84
|
+
}] } });
|
|
85
|
+
|
|
86
|
+
class MaterialActionButtonModule {
|
|
87
|
+
}
|
|
88
|
+
MaterialActionButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
89
|
+
MaterialActionButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, declarations: [MaterialActionButtonComponent], imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule], exports: [MaterialActionButtonComponent] });
|
|
90
|
+
MaterialActionButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule] });
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialActionButtonModule, decorators: [{
|
|
92
|
+
type: NgModule,
|
|
93
|
+
args: [{
|
|
94
|
+
declarations: [MaterialActionButtonComponent],
|
|
95
|
+
imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule],
|
|
96
|
+
exports: [MaterialActionButtonComponent],
|
|
97
|
+
}]
|
|
98
|
+
}] });
|
|
99
|
+
|
|
100
|
+
class MadBasicButton {
|
|
101
|
+
constructor() {
|
|
102
|
+
this.disableClick = (e) => e.stopPropagation();
|
|
103
|
+
}
|
|
104
|
+
get pointerEvent() {
|
|
105
|
+
return this.disabled ? 'none' : 'auto';
|
|
106
|
+
}
|
|
107
|
+
get opacity() {
|
|
108
|
+
return this.disabled ? '0.35' : '1';
|
|
109
|
+
}
|
|
110
|
+
ngOnChanges() {
|
|
111
|
+
this.disableButton();
|
|
112
|
+
}
|
|
113
|
+
disableButton() {
|
|
114
|
+
if (this.disabled) {
|
|
115
|
+
this.button.nativeElement.addEventListener('click', this.disableClick);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.button.nativeElement.removeEventListener('click', this.disableClick);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
MadBasicButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MadBasicButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
+
MadBasicButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MadBasicButton, selector: "ng-component", host: { properties: { "style.pointer-events": "this.pointerEvent", "style.opacity": "this.opacity" } }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MadBasicButton, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{
|
|
127
|
+
template: ''
|
|
128
|
+
}]
|
|
129
|
+
}], propDecorators: { pointerEvent: [{
|
|
130
|
+
type: HostBinding,
|
|
131
|
+
args: ['style.pointer-events']
|
|
132
|
+
}], opacity: [{
|
|
133
|
+
type: HostBinding,
|
|
134
|
+
args: ['style.opacity']
|
|
135
|
+
}] } });
|
|
136
|
+
|
|
137
|
+
class DangerButtonComponent extends MadBasicButton {
|
|
138
|
+
constructor() {
|
|
139
|
+
super();
|
|
140
|
+
this.title = '';
|
|
141
|
+
super.button = this.button;
|
|
142
|
+
super.disabled = this.disabled;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
DangerButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DangerButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
146
|
+
DangerButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DangerButtonComponent, selector: "mad-danger-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-raised-button color=\"warn\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DangerButtonComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'mad-danger-button', template: "<button mat-raised-button color=\"warn\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
|
|
150
|
+
}], ctorParameters: function () { return []; }, propDecorators: { type: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], disabled: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], title: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], button: [{
|
|
157
|
+
type: ViewChild,
|
|
158
|
+
args: ['btn', { read: ElementRef, static: true }]
|
|
159
|
+
}] } });
|
|
160
|
+
|
|
161
|
+
class LinkButtonComponent extends MadBasicButton {
|
|
162
|
+
constructor() {
|
|
163
|
+
super();
|
|
164
|
+
this.title = '';
|
|
165
|
+
super.button = this.button;
|
|
166
|
+
super.disabled = this.disabled;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
LinkButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: LinkButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
170
|
+
LinkButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: LinkButtonComponent, selector: "mad-link-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button [title]=\"title\" [type]=\"type\" color=\"primary\" #btn mat-button>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: LinkButtonComponent, decorators: [{
|
|
172
|
+
type: Component,
|
|
173
|
+
args: [{ selector: 'mad-link-button', template: "<button [title]=\"title\" [type]=\"type\" color=\"primary\" #btn mat-button>\n <ng-content></ng-content>\n</button>\n" }]
|
|
174
|
+
}], ctorParameters: function () { return []; }, propDecorators: { type: [{
|
|
175
|
+
type: Input
|
|
176
|
+
}], disabled: [{
|
|
177
|
+
type: Input
|
|
178
|
+
}], title: [{
|
|
179
|
+
type: Input
|
|
180
|
+
}], button: [{
|
|
181
|
+
type: ViewChild,
|
|
182
|
+
args: ['btn', { read: ElementRef, static: true }]
|
|
183
|
+
}] } });
|
|
184
|
+
|
|
185
|
+
class IconButtonComponent extends MadBasicButton {
|
|
186
|
+
constructor() {
|
|
187
|
+
super();
|
|
188
|
+
this.title = '';
|
|
189
|
+
super.button = this.button;
|
|
190
|
+
super.disabled = this.disabled;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
IconButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
194
|
+
IconButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: IconButtonComponent, selector: "mad-icon-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-icon-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: IconButtonComponent, decorators: [{
|
|
196
|
+
type: Component,
|
|
197
|
+
args: [{ selector: 'mad-icon-button', template: "<button mat-icon-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
|
|
198
|
+
}], ctorParameters: function () { return []; }, propDecorators: { type: [{
|
|
199
|
+
type: Input
|
|
200
|
+
}], disabled: [{
|
|
201
|
+
type: Input
|
|
202
|
+
}], title: [{
|
|
203
|
+
type: Input
|
|
204
|
+
}], button: [{
|
|
205
|
+
type: ViewChild,
|
|
206
|
+
args: ['btn', { read: ElementRef, static: true }]
|
|
207
|
+
}] } });
|
|
208
|
+
|
|
209
|
+
class OutlineButtonComponent extends MadBasicButton {
|
|
210
|
+
constructor() {
|
|
211
|
+
super();
|
|
212
|
+
this.title = '';
|
|
213
|
+
super.button = this.button;
|
|
214
|
+
super.disabled = this.disabled;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
OutlineButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: OutlineButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
218
|
+
OutlineButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-stroked-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: OutlineButtonComponent, decorators: [{
|
|
220
|
+
type: Component,
|
|
221
|
+
args: [{ selector: 'mad-outline-button', template: "<button mat-stroked-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
|
|
222
|
+
}], ctorParameters: function () { return []; }, propDecorators: { type: [{
|
|
223
|
+
type: Input
|
|
224
|
+
}], disabled: [{
|
|
225
|
+
type: Input
|
|
226
|
+
}], title: [{
|
|
227
|
+
type: Input
|
|
228
|
+
}], button: [{
|
|
229
|
+
type: ViewChild,
|
|
230
|
+
args: ['btn', { read: ElementRef, static: true }]
|
|
231
|
+
}] } });
|
|
232
|
+
|
|
233
|
+
class PrimaryButtonComponent extends MadBasicButton {
|
|
234
|
+
constructor() {
|
|
235
|
+
super();
|
|
236
|
+
this.title = '';
|
|
237
|
+
super.button = this.button;
|
|
238
|
+
super.disabled = this.disabled;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
PrimaryButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: PrimaryButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
242
|
+
PrimaryButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: PrimaryButtonComponent, selector: "mad-primary-button", inputs: { type: "type", disabled: "disabled", title: "title" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["btn"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<button mat-raised-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n", styles: [""], dependencies: [{ kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: PrimaryButtonComponent, decorators: [{
|
|
244
|
+
type: Component,
|
|
245
|
+
args: [{ selector: 'mad-primary-button', template: "<button mat-raised-button color=\"primary\" [type]=\"type\" [title]=\"title\" #btn>\n <ng-content></ng-content>\n</button>\n" }]
|
|
246
|
+
}], ctorParameters: function () { return []; }, propDecorators: { type: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], disabled: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}], title: [{
|
|
251
|
+
type: Input
|
|
252
|
+
}], button: [{
|
|
253
|
+
type: ViewChild,
|
|
254
|
+
args: ['btn', { read: ElementRef, static: true }]
|
|
255
|
+
}] } });
|
|
256
|
+
|
|
257
|
+
class ButtonModule {
|
|
258
|
+
}
|
|
259
|
+
ButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
260
|
+
ButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, declarations: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent], imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule], exports: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent] });
|
|
261
|
+
ButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule] });
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ButtonModule, decorators: [{
|
|
263
|
+
type: NgModule,
|
|
264
|
+
args: [{
|
|
265
|
+
declarations: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent],
|
|
266
|
+
imports: [CommonModule, RouterModule, MatButtonModule, MatIconModule, MatTooltipModule],
|
|
267
|
+
exports: [PrimaryButtonComponent, OutlineButtonComponent, LinkButtonComponent, DangerButtonComponent, IconButtonComponent],
|
|
268
|
+
}]
|
|
269
|
+
}] });
|
|
270
|
+
|
|
271
|
+
class NumberFormatService {
|
|
272
|
+
constructor(locale) {
|
|
273
|
+
this.allowedKeys = [];
|
|
274
|
+
// try to get the current formatting
|
|
275
|
+
const localeDecimalSeparator = (1.1).toLocaleString(locale).charAt(1);
|
|
276
|
+
this.decimalSeparator = localeDecimalSeparator === ',' ? ',' : '.';
|
|
277
|
+
this.groupingSeparator = localeDecimalSeparator === ',' ? '.' : ',';
|
|
278
|
+
this.allowedKeys = [...NumberFormatService.NUMBERS, NumberFormatService.NEGATIVE, this.decimalSeparator];
|
|
279
|
+
}
|
|
280
|
+
static valueIsSet(value) {
|
|
281
|
+
return typeof value !== 'undefined' && value !== null && (typeof value !== 'string' || value.length !== 0);
|
|
282
|
+
}
|
|
283
|
+
format(value, options) {
|
|
284
|
+
return NumberFormatService.valueIsSet(value)
|
|
285
|
+
? this.formatNumber(value.toString().replace(new RegExp('[.]', 'g'), this.decimalSeparator), options)
|
|
286
|
+
: '';
|
|
287
|
+
}
|
|
288
|
+
formatNumber(value, options) {
|
|
289
|
+
const autofillDecimals = this.valueOrDefault(options === null || options === void 0 ? void 0 : options.autofillDecimals, NumberFormatService.DEFAULT_AUTOFILL_DECIMALS);
|
|
290
|
+
const decimalPlaces = this.valueOrDefault(options === null || options === void 0 ? void 0 : options.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
|
|
291
|
+
const finalFormatting = this.valueOrDefault(options === null || options === void 0 ? void 0 : options.finalFormatting, NumberFormatService.DEFAULT_FINAL_FORMATTING);
|
|
292
|
+
let result = this.strip(value, { decimalPlaces, removeLeadingZeros: finalFormatting });
|
|
293
|
+
/* add grouping separator */
|
|
294
|
+
const decimalIndex = result.indexOf(this.decimalSeparator);
|
|
295
|
+
const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
|
|
296
|
+
let i = decimalIndex > -1 ? decimalIndex : result.length;
|
|
297
|
+
while (i > (isNegative ? 4 : 3)) {
|
|
298
|
+
i -= 3;
|
|
299
|
+
result = result.substring(0, i) + this.groupingSeparator + result.substring(i, result.length);
|
|
300
|
+
}
|
|
301
|
+
if (finalFormatting) {
|
|
302
|
+
if (decimalPlaces > 0 && !!result) {
|
|
303
|
+
/* autofill decimal places */
|
|
304
|
+
let actualDecimalIndex = result.indexOf(this.decimalSeparator);
|
|
305
|
+
if (autofillDecimals) {
|
|
306
|
+
if (actualDecimalIndex === -1) {
|
|
307
|
+
actualDecimalIndex = result.length;
|
|
308
|
+
result += this.decimalSeparator;
|
|
309
|
+
}
|
|
310
|
+
result = this.addMissingLeadingZero(result, actualDecimalIndex);
|
|
311
|
+
actualDecimalIndex = result.indexOf(this.decimalSeparator);
|
|
312
|
+
const actualDecimalPlaces = result.length - actualDecimalIndex - 1;
|
|
313
|
+
for (let j = 0; j < decimalPlaces - actualDecimalPlaces; j++) {
|
|
314
|
+
result += '0';
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
result = this.addMissingLeadingZero(result, actualDecimalIndex);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
strip(value, options) {
|
|
325
|
+
const decimalPlaces = this.valueOrDefault(options === null || options === void 0 ? void 0 : options.decimalPlaces, NumberFormatService.DEFAULT_DECIMAL_PLACES);
|
|
326
|
+
const removeLeadingZeros = this.valueOrDefault(options === null || options === void 0 ? void 0 : options.removeLeadingZeros, NumberFormatService.DEFAULT_REMOVE_LEADING_ZEROS);
|
|
327
|
+
let result = '';
|
|
328
|
+
let indexDecimalSep = -1;
|
|
329
|
+
let j = -1;
|
|
330
|
+
let ignoredChars = 0;
|
|
331
|
+
for (const char of value) {
|
|
332
|
+
j++;
|
|
333
|
+
if (this.allowedKeys.includes(char)) {
|
|
334
|
+
if (char === this.decimalSeparator) {
|
|
335
|
+
if (decimalPlaces === 0) {
|
|
336
|
+
/* dismiss content after a decimal separator, when no places allowed */
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
else if (indexDecimalSep > -1) {
|
|
340
|
+
/* ignore subsequent decimal separators */
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
indexDecimalSep = j;
|
|
344
|
+
}
|
|
345
|
+
if (char === '0' && removeLeadingZeros) {
|
|
346
|
+
/* remove leading zero only if it's not the only zero in the 'value' string */
|
|
347
|
+
if ((result.length === 0 && j + 1 !== value.length) || result === NumberFormatService.NEGATIVE) {
|
|
348
|
+
ignoredChars++;
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (char === NumberFormatService.NEGATIVE && j > 0) {
|
|
353
|
+
/* dismiss content after a negative sign not on first position */
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
if (indexDecimalSep > -1 && result.length + ignoredChars > indexDecimalSep + decimalPlaces) {
|
|
357
|
+
/* dismiss content after maximum decimal places reached */
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
result += char;
|
|
361
|
+
}
|
|
362
|
+
else if (char === this.groupingSeparator) {
|
|
363
|
+
if (indexDecimalSep === -1) {
|
|
364
|
+
ignoredChars++;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
/* dismiss content after a invalid character */
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return result;
|
|
373
|
+
}
|
|
374
|
+
addMissingLeadingZero(result, actualDecimalIndex) {
|
|
375
|
+
const isNegative = result.startsWith(NumberFormatService.NEGATIVE);
|
|
376
|
+
/* autoadd a zero before decimal separator, when it's missing */
|
|
377
|
+
if (actualDecimalIndex === 0) {
|
|
378
|
+
result = '0' + result;
|
|
379
|
+
}
|
|
380
|
+
/* autoadd a zero before decimal separator, when it's missing, for negative values */
|
|
381
|
+
if (actualDecimalIndex === 1 && isNegative) {
|
|
382
|
+
result = result[0] + '0' + result.substring(1, result.length);
|
|
383
|
+
}
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
386
|
+
valueOrDefault(value, defaultValue) {
|
|
387
|
+
return NumberFormatService.valueIsSet(value) ? value : defaultValue;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
NumberFormatService.NEGATIVE = '-';
|
|
391
|
+
NumberFormatService.NUMBERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
392
|
+
NumberFormatService.DEFAULT_FINAL_FORMATTING = true;
|
|
393
|
+
NumberFormatService.DEFAULT_DECIMAL_PLACES = 2;
|
|
394
|
+
NumberFormatService.DEFAULT_AUTOFILL_DECIMALS = false;
|
|
395
|
+
NumberFormatService.DEFAULT_REMOVE_LEADING_ZEROS = false;
|
|
396
|
+
NumberFormatService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
397
|
+
NumberFormatService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, providedIn: 'any' });
|
|
398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumberFormatService, decorators: [{
|
|
399
|
+
type: Injectable,
|
|
400
|
+
args: [{
|
|
401
|
+
providedIn: 'any',
|
|
402
|
+
}]
|
|
403
|
+
}], ctorParameters: function () {
|
|
404
|
+
return [{ type: undefined, decorators: [{
|
|
405
|
+
type: Inject,
|
|
406
|
+
args: [LOCALE_ID]
|
|
407
|
+
}] }];
|
|
408
|
+
} });
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Read-only mat-form-field representation of provided value
|
|
412
|
+
*
|
|
413
|
+
* @author Stefan Laesser
|
|
414
|
+
*/
|
|
415
|
+
class ReadOnlyFormFieldComponent {
|
|
416
|
+
constructor(changeDetector, renderer, numberFormatService) {
|
|
417
|
+
this.changeDetector = changeDetector;
|
|
418
|
+
this.renderer = renderer;
|
|
419
|
+
this.numberFormatService = numberFormatService;
|
|
420
|
+
this.textAlign = 'left';
|
|
421
|
+
this.formatNumber = false;
|
|
422
|
+
this.decimalPlaces = 2;
|
|
423
|
+
this.roundValue = false;
|
|
424
|
+
this.autofillDecimals = false;
|
|
425
|
+
this.unit = null;
|
|
426
|
+
this.unitPosition = 'left';
|
|
427
|
+
this.errorMessage = null;
|
|
428
|
+
this.multiline = false;
|
|
429
|
+
this.rows = 3;
|
|
430
|
+
/*
|
|
431
|
+
* If shrinkIfEmpty is set to "false", nothing changes
|
|
432
|
+
* If set to "true" and multiline is also "true", the textarea will
|
|
433
|
+
* shrink to one row, if value is empty/null/undefined.
|
|
434
|
+
* Otherwise, the defined rows-value will be used
|
|
435
|
+
*/
|
|
436
|
+
this.shrinkIfEmpty = false;
|
|
437
|
+
this.errorMatcher = {
|
|
438
|
+
isErrorState: () => !!this.errorMessage,
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
ngOnChanges(_) {
|
|
442
|
+
if (!NumberFormatService.valueIsSet(this.value)) {
|
|
443
|
+
this.value = '-';
|
|
444
|
+
if (this.shrinkIfEmpty) {
|
|
445
|
+
this.rows = 1;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else if (this.formatNumber && typeof this.value === 'number') {
|
|
449
|
+
this.value = this.numberFormatService.format(this.value, {
|
|
450
|
+
decimalPlaces: this.decimalPlaces,
|
|
451
|
+
finalFormatting: true,
|
|
452
|
+
autofillDecimals: this.autofillDecimals,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
this.changeDetector.detectChanges();
|
|
456
|
+
}
|
|
457
|
+
// TODO direct copy from NumericFieldDirective
|
|
458
|
+
ngAfterViewChecked() {
|
|
459
|
+
this.injectUnitSymbol();
|
|
460
|
+
}
|
|
461
|
+
injectUnitSymbol() {
|
|
462
|
+
// Need to inject the unit symbol when the input element width is set to its actual value,
|
|
463
|
+
// otherwise the icon wont show in the correct position
|
|
464
|
+
if (!!this.unit && !this.unitSpan && this.inputEl.nativeElement.offsetWidth !== 0) {
|
|
465
|
+
// Get the input wrapper and apply necessary styles
|
|
466
|
+
const inputWrapper = this.inputEl.nativeElement.parentNode.parentNode;
|
|
467
|
+
// Create the span with unit symbol and apply necessary styles
|
|
468
|
+
this.unitSpan = this.renderer.createElement('span');
|
|
469
|
+
if (this.unitPosition === 'left') {
|
|
470
|
+
this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
|
|
471
|
+
this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
|
|
472
|
+
this.renderer.insertBefore(inputWrapper, this.unitSpan, inputWrapper.children[0]);
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
|
|
476
|
+
this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
|
|
477
|
+
this.renderer.appendChild(inputWrapper, this.unitSpan);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
// special handling to move unit symbol along with display value
|
|
481
|
+
if (!!this.unitSpan && this.textAlign === 'left' && this.unitPosition === 'right') {
|
|
482
|
+
const inputStyles = window.getComputedStyle(this.inputEl.nativeElement.parentElement, null);
|
|
483
|
+
this.unitSpan.style.position = 'absolute';
|
|
484
|
+
this.unitSpan.style.marginTop = inputStyles.getPropertyValue('border-top-width');
|
|
485
|
+
this.unitSpan.style.paddingTop = inputStyles.getPropertyValue('padding-top');
|
|
486
|
+
this.unitSpan.style.paddingBottom = inputStyles.getPropertyValue('padding-bottom');
|
|
487
|
+
if (!this.textSpan) {
|
|
488
|
+
this.textSpan = document.createElement('span');
|
|
489
|
+
document.body.appendChild(this.textSpan);
|
|
490
|
+
this.textSpan.style.font = inputStyles.getPropertyValue('font');
|
|
491
|
+
this.textSpan.style.fontSize = inputStyles.getPropertyValue('font-size');
|
|
492
|
+
this.textSpan.style.height = 'auto';
|
|
493
|
+
this.textSpan.style.width = 'auto';
|
|
494
|
+
this.textSpan.style.position = 'absolute';
|
|
495
|
+
this.textSpan.style.top = '0';
|
|
496
|
+
this.textSpan.style.whiteSpace = 'no-wrap';
|
|
497
|
+
this.textSpan.style.visibility = 'hidden';
|
|
498
|
+
}
|
|
499
|
+
this.textSpan.innerHTML = this.value;
|
|
500
|
+
const width = Math.min(this.inputEl.nativeElement.clientWidth - this.unitSpan.clientWidth, Math.ceil(this.textSpan.clientWidth));
|
|
501
|
+
this.unitSpan.style.left = width + 'px';
|
|
502
|
+
}
|
|
503
|
+
// always reset unit symbol
|
|
504
|
+
if (!!this.unitSpan) {
|
|
505
|
+
this.unitSpan.textContent = this.unit;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
ReadOnlyFormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Component });
|
|
510
|
+
ReadOnlyFormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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" }, viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-form-field class=\"form-group\" appearance=\"none\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\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: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.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: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldComponent, decorators: [{
|
|
512
|
+
type: Component,
|
|
513
|
+
args: [{ selector: 'mad-readonly-form-field', template: "<mat-form-field class=\"form-group\" appearance=\"none\">\n <mat-label>{{ label }}</mat-label>\n <input\n *ngIf=\"!multiline\"\n [ngModel]=\"value\"\n [ngClass]=\"'text-' + textAlign\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n #inputEl\n />\n\n <textarea\n *ngIf=\"multiline\"\n [rows]=\"rows\"\n [ngModel]=\"value\"\n class=\"multiline\"\n [errorStateMatcher]=\"errorMatcher\"\n [id]=\"id\"\n readonly\n matInput\n ></textarea>\n <mat-error>{{ errorMessage }}</mat-error>\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"] }]
|
|
514
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: NumberFormatService }]; }, propDecorators: { value: [{
|
|
515
|
+
type: Input,
|
|
516
|
+
args: ['value']
|
|
517
|
+
}], label: [{
|
|
518
|
+
type: Input,
|
|
519
|
+
args: ['label']
|
|
520
|
+
}], textAlign: [{
|
|
521
|
+
type: Input,
|
|
522
|
+
args: ['textAlign']
|
|
523
|
+
}], formatNumber: [{
|
|
524
|
+
type: Input,
|
|
525
|
+
args: ['formatNumber']
|
|
526
|
+
}], decimalPlaces: [{
|
|
527
|
+
type: Input,
|
|
528
|
+
args: ['decimalPlaces']
|
|
529
|
+
}], roundValue: [{
|
|
530
|
+
type: Input,
|
|
531
|
+
args: ['roundDisplayValue']
|
|
532
|
+
}], autofillDecimals: [{
|
|
533
|
+
type: Input,
|
|
534
|
+
args: ['autofillDecimals']
|
|
535
|
+
}], unit: [{
|
|
536
|
+
type: Input,
|
|
537
|
+
args: ['unit']
|
|
538
|
+
}], unitPosition: [{
|
|
539
|
+
type: Input,
|
|
540
|
+
args: ['unitPosition']
|
|
541
|
+
}], errorMessage: [{
|
|
542
|
+
type: Input,
|
|
543
|
+
args: ['errorMessage']
|
|
544
|
+
}], multiline: [{
|
|
545
|
+
type: Input
|
|
546
|
+
}], rows: [{
|
|
547
|
+
type: Input
|
|
548
|
+
}], id: [{
|
|
549
|
+
type: Input
|
|
550
|
+
}], shrinkIfEmpty: [{
|
|
551
|
+
type: Input
|
|
552
|
+
}], inputEl: [{
|
|
553
|
+
type: ViewChild,
|
|
554
|
+
args: ['inputEl']
|
|
555
|
+
}] } });
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Wraps a mat-form-field to replace it by a readOnly representation if necessary
|
|
559
|
+
*
|
|
560
|
+
* @author Stefan Laesser
|
|
561
|
+
*/
|
|
562
|
+
class ReadOnlyFormFieldWrapperComponent {
|
|
563
|
+
constructor(changeDetector, elementRef) {
|
|
564
|
+
this.changeDetector = changeDetector;
|
|
565
|
+
this.elementRef = elementRef;
|
|
566
|
+
/**
|
|
567
|
+
* If set to "false", the contained mat-form-field is rendered in all it's glory.
|
|
568
|
+
* If set to "true", a readonly representation of the value is shown using the mat-form-fields label.
|
|
569
|
+
*/
|
|
570
|
+
this.readonly = true;
|
|
571
|
+
this.textAlign = 'left';
|
|
572
|
+
this.formatNumber = false;
|
|
573
|
+
this.decimalPlaces = 2;
|
|
574
|
+
this.roundValue = false;
|
|
575
|
+
this.autofillDecimals = false;
|
|
576
|
+
this.unit = null;
|
|
577
|
+
this.unitPosition = 'left';
|
|
578
|
+
this.errorMessage = null;
|
|
579
|
+
/**
|
|
580
|
+
* If set to "false", a readonly input will be rendered.
|
|
581
|
+
* If set to "true", a readonly textarea will be rendered instead.
|
|
582
|
+
*/
|
|
583
|
+
this.multiline = false;
|
|
584
|
+
/**
|
|
585
|
+
* Defines the rows for the readonly textarea.
|
|
586
|
+
*/
|
|
587
|
+
this.rows = 3;
|
|
588
|
+
/**
|
|
589
|
+
* If shrinkIfEmpty is set to "false", nothing changes
|
|
590
|
+
* If set to "true" and multiline is also "true", the textarea will
|
|
591
|
+
* shrink to one row, if value is empty/null/undefined.
|
|
592
|
+
* Otherwise, the defined rows-value will be used
|
|
593
|
+
*/
|
|
594
|
+
this.shrinkIfEmpty = false;
|
|
595
|
+
this.toolTipForInputEnabled = false;
|
|
596
|
+
}
|
|
597
|
+
ngOnInit() {
|
|
598
|
+
this.doRendering();
|
|
599
|
+
}
|
|
600
|
+
ngAfterViewInit() {
|
|
601
|
+
this.setReadonlyFieldStyle();
|
|
602
|
+
this.doRendering();
|
|
603
|
+
}
|
|
604
|
+
ngAfterViewChecked() {
|
|
605
|
+
this.setReadonlyFieldStyle();
|
|
606
|
+
this.setTooltipForOverflownField();
|
|
607
|
+
}
|
|
608
|
+
ngOnChanges(_) {
|
|
609
|
+
this.doRendering();
|
|
610
|
+
}
|
|
611
|
+
getLabel() {
|
|
612
|
+
if (!this.label) {
|
|
613
|
+
this.extractLabel();
|
|
614
|
+
}
|
|
615
|
+
return this.label;
|
|
616
|
+
}
|
|
617
|
+
doRendering() {
|
|
618
|
+
if (!this.originalContent) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
if (!this.readonly) {
|
|
622
|
+
this.correctWidth();
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
this.changeDetector.detectChanges();
|
|
626
|
+
}
|
|
627
|
+
extractLabel() {
|
|
628
|
+
if (!this.originalContent || !this.originalContent.nativeElement) {
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
const labelElement = this.originalContent.nativeElement.querySelector('mat-label');
|
|
632
|
+
this.label = labelElement ? labelElement.innerHTML : 'mat-label is missing!';
|
|
633
|
+
}
|
|
634
|
+
correctWidth() {
|
|
635
|
+
const formField = this.originalContent.nativeElement.querySelector('mat-form-field');
|
|
636
|
+
if (formField) {
|
|
637
|
+
formField.setAttribute('style', 'width:100%');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
setReadonlyFieldStyle() {
|
|
641
|
+
var _a, _b;
|
|
642
|
+
const input = (_b = (_a = this.readOnlyContentWrapper) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
643
|
+
if (input) {
|
|
644
|
+
const textOverFlowStyleValue = this.getTextOverFlowStyleValue();
|
|
645
|
+
if (textOverFlowStyleValue) {
|
|
646
|
+
input.setAttribute('style', 'text-overflow: ' + textOverFlowStyleValue);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
// Ellipsis is enabled by default as text-overflow behaviour
|
|
651
|
+
getTextOverFlowStyleValue() {
|
|
652
|
+
var _a, _b;
|
|
653
|
+
// it works only if the style is added to the component directly. Should find a way for get it from the calculated
|
|
654
|
+
// style. Than it would be possible to define the text-overflow in css for the whole application
|
|
655
|
+
const textOverflow = (_b = (_a = this.elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.style.textOverflow;
|
|
656
|
+
if (!textOverflow) {
|
|
657
|
+
return 'ellipsis';
|
|
658
|
+
}
|
|
659
|
+
return textOverflow;
|
|
660
|
+
}
|
|
661
|
+
setTooltipForOverflownField() {
|
|
662
|
+
var _a, _b;
|
|
663
|
+
if (this.isEllipsisForTextOverflowEnabled()) {
|
|
664
|
+
const input = (_b = (_a = this.readOnlyContentWrapper) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('input');
|
|
665
|
+
if (input) {
|
|
666
|
+
this.toolTipForInputEnabled = this.isTextOverflown(input);
|
|
667
|
+
if (this.toolTipForInputEnabled) {
|
|
668
|
+
this.toolTipText = this.calculateToolTipText();
|
|
669
|
+
}
|
|
670
|
+
this.changeDetector.detectChanges();
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
isEllipsisForTextOverflowEnabled() {
|
|
675
|
+
return this.getTextOverFlowStyleValue() === 'ellipsis';
|
|
676
|
+
}
|
|
677
|
+
isTextOverflown(input) {
|
|
678
|
+
if (input) {
|
|
679
|
+
return input.offsetWidth < input.scrollWidth;
|
|
680
|
+
}
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
calculateToolTipText() {
|
|
684
|
+
if (!this.unit) {
|
|
685
|
+
return this.value;
|
|
686
|
+
}
|
|
687
|
+
return this.unitPosition === 'left' ? this.unit + ' ' + this.value : this.value + ' ' + this.unit;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
ReadOnlyFormFieldWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
691
|
+
ReadOnlyFormFieldWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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" }, 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 matTooltip=\"{{toolTipText}}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{!toolTipForInputEnabled}}\">\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: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", 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"] }] });
|
|
692
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldWrapperComponent, decorators: [{
|
|
693
|
+
type: Component,
|
|
694
|
+
args: [{ selector: 'mad-readonly-form-field-wrapper', 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 matTooltip=\"{{toolTipText}}\"\n matTooltipPosition=\"right\"\n matTooltipClass=\"custom-tooltip\"\n matTooltipDisabled=\"{{!toolTipForInputEnabled}}\">\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"] }]
|
|
695
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { originalContent: [{
|
|
696
|
+
type: ViewChild,
|
|
697
|
+
args: ['contentWrapper', { static: false }]
|
|
698
|
+
}], readOnlyContentWrapper: [{
|
|
699
|
+
type: ViewChild,
|
|
700
|
+
args: ['readOnlyContentWrapper', { static: false }]
|
|
701
|
+
}], readonly: [{
|
|
702
|
+
type: Input
|
|
703
|
+
}], value: [{
|
|
704
|
+
type: Input,
|
|
705
|
+
args: ['value']
|
|
706
|
+
}], textAlign: [{
|
|
707
|
+
type: Input,
|
|
708
|
+
args: ['textAlign']
|
|
709
|
+
}], formatNumber: [{
|
|
710
|
+
type: Input,
|
|
711
|
+
args: ['formatNumber']
|
|
712
|
+
}], decimalPlaces: [{
|
|
713
|
+
type: Input,
|
|
714
|
+
args: ['decimalPlaces']
|
|
715
|
+
}], roundValue: [{
|
|
716
|
+
type: Input,
|
|
717
|
+
args: ['roundDisplayValue']
|
|
718
|
+
}], autofillDecimals: [{
|
|
719
|
+
type: Input,
|
|
720
|
+
args: ['autofillDecimals']
|
|
721
|
+
}], unit: [{
|
|
722
|
+
type: Input,
|
|
723
|
+
args: ['unit']
|
|
724
|
+
}], unitPosition: [{
|
|
725
|
+
type: Input,
|
|
726
|
+
args: ['unitPosition']
|
|
727
|
+
}], errorMessage: [{
|
|
728
|
+
type: Input,
|
|
729
|
+
args: ['errorMessage']
|
|
730
|
+
}], id: [{
|
|
731
|
+
type: Input
|
|
732
|
+
}], multiline: [{
|
|
733
|
+
type: Input
|
|
734
|
+
}], rows: [{
|
|
735
|
+
type: Input
|
|
736
|
+
}], shrinkIfEmpty: [{
|
|
737
|
+
type: Input
|
|
738
|
+
}] } });
|
|
739
|
+
|
|
740
|
+
class ReadOnlyFormFieldModule {
|
|
741
|
+
}
|
|
742
|
+
ReadOnlyFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
743
|
+
ReadOnlyFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, declarations: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent], imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule], exports: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent] });
|
|
744
|
+
ReadOnlyFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule] });
|
|
745
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ReadOnlyFormFieldModule, decorators: [{
|
|
746
|
+
type: NgModule,
|
|
747
|
+
args: [{
|
|
748
|
+
declarations: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent],
|
|
749
|
+
imports: [CommonModule, RouterModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule],
|
|
750
|
+
exports: [ReadOnlyFormFieldComponent, ReadOnlyFormFieldWrapperComponent],
|
|
751
|
+
}]
|
|
752
|
+
}] });
|
|
753
|
+
|
|
754
|
+
class ToolbarService {
|
|
755
|
+
constructor(router, translate) {
|
|
756
|
+
this.router = router;
|
|
757
|
+
this.translate = translate;
|
|
758
|
+
this.mainActions = []; // shown on the left, next to title, as big buttons
|
|
759
|
+
this.toolbarActions = []; // shown on the right as icons
|
|
760
|
+
this.toolbarActionsAlwaysAsMenu = false; // show the mobile view (burger menu) for toolbar actions
|
|
761
|
+
this.toolbarActionsMenuTitle = 'More'; // title of the burger menu
|
|
762
|
+
this.routerSubscription = this.router.events.subscribe(routingEvent => {
|
|
763
|
+
if (routingEvent instanceof NavigationEnd) {
|
|
764
|
+
if (this.currentUrl !== routingEvent.urlAfterRedirects) {
|
|
765
|
+
this.clearToolbarActions();
|
|
766
|
+
this.clearMainActions();
|
|
767
|
+
delete this.backAction;
|
|
768
|
+
delete this.dataTitle;
|
|
769
|
+
}
|
|
770
|
+
this.currentUrl = router.url;
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
get toolbarTitle() {
|
|
775
|
+
return this.title;
|
|
776
|
+
}
|
|
777
|
+
set toolbarTitle(toolbarTitle) {
|
|
778
|
+
this.title = toolbarTitle;
|
|
779
|
+
}
|
|
780
|
+
ngOnDestroy() {
|
|
781
|
+
if (this.routerSubscription) {
|
|
782
|
+
this.routerSubscription.unsubscribe();
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
getToolbarActions() {
|
|
786
|
+
return this.toolbarActions;
|
|
787
|
+
}
|
|
788
|
+
addToolbarAction(action) {
|
|
789
|
+
this.translate
|
|
790
|
+
.get(action.i18nActionKey)
|
|
791
|
+
.toPromise()
|
|
792
|
+
.then(translated => {
|
|
793
|
+
action.actionName = translated;
|
|
794
|
+
this.toolbarActions.push(action);
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
setDataTitle(dataTitle) {
|
|
798
|
+
this.dataTitle = dataTitle;
|
|
799
|
+
}
|
|
800
|
+
setToolbarActionsAlwaysAsMenu(toolbarActionsAlwaysAsMenu) {
|
|
801
|
+
this.toolbarActionsAlwaysAsMenu = toolbarActionsAlwaysAsMenu;
|
|
802
|
+
}
|
|
803
|
+
getToolbarActionsAlwaysAsMenu() {
|
|
804
|
+
return this.toolbarActionsAlwaysAsMenu;
|
|
805
|
+
}
|
|
806
|
+
getDataTitle() {
|
|
807
|
+
return this.dataTitle;
|
|
808
|
+
}
|
|
809
|
+
clearToolbarActions() {
|
|
810
|
+
this.toolbarActions = [];
|
|
811
|
+
}
|
|
812
|
+
getMainActions() {
|
|
813
|
+
return this.mainActions;
|
|
814
|
+
}
|
|
815
|
+
getBackAction() {
|
|
816
|
+
return this.backAction;
|
|
817
|
+
}
|
|
818
|
+
setToolbarActionsMenuTitle(toolbarActionsMenuTitle) {
|
|
819
|
+
this.toolbarActionsMenuTitle = toolbarActionsMenuTitle;
|
|
820
|
+
}
|
|
821
|
+
getToolbarActionsMenuTitle() {
|
|
822
|
+
return this.toolbarActionsMenuTitle;
|
|
823
|
+
}
|
|
824
|
+
addMainAction(mainAction) {
|
|
825
|
+
this.translate
|
|
826
|
+
.get(mainAction.i18nActionKey)
|
|
827
|
+
.toPromise()
|
|
828
|
+
.then(translated => {
|
|
829
|
+
mainAction.actionName = translated;
|
|
830
|
+
this.mainActions.push(mainAction);
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Per default the goBackRoute is a routerLink. But if a href should be used (for absolute browser routing) then isAbsoluteUrl can be set to true.
|
|
835
|
+
*/
|
|
836
|
+
addBackAction(goBackRoute, isAbsoluteUrl = false) {
|
|
837
|
+
this.backAction = {
|
|
838
|
+
matIcon: 'keyboard_backspace',
|
|
839
|
+
i18nActionKey: '',
|
|
840
|
+
};
|
|
841
|
+
if (!isAbsoluteUrl) {
|
|
842
|
+
this.backAction.routerLink = goBackRoute;
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
this.backAction.href = goBackRoute;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
addSimpleBackButton(overrideIfPresent = false) {
|
|
849
|
+
if (this.getBackAction() && !overrideIfPresent) {
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
this.backAction = {
|
|
853
|
+
matIcon: 'keyboard_backspace',
|
|
854
|
+
i18nActionKey: '',
|
|
855
|
+
action() {
|
|
856
|
+
window.history.back();
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
clearMainActions() {
|
|
861
|
+
this.mainActions = [];
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
ToolbarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, deps: [{ token: i1$1.Router }, { token: i2$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
865
|
+
ToolbarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, providedIn: 'root' });
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarService, decorators: [{
|
|
867
|
+
type: Injectable,
|
|
868
|
+
args: [{
|
|
869
|
+
providedIn: 'root',
|
|
870
|
+
}]
|
|
871
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i2$1.TranslateService }]; } });
|
|
872
|
+
|
|
873
|
+
class ToolbarComponent {
|
|
874
|
+
constructor(breakpointObserver, titleService, toolbarService) {
|
|
875
|
+
this.breakpointObserver = breakpointObserver;
|
|
876
|
+
this.titleService = titleService;
|
|
877
|
+
this.toolbarService = toolbarService;
|
|
878
|
+
this.isHandset$ = this.breakpointObserver.observe([Breakpoints.Handset]).pipe(map(result => result.matches));
|
|
879
|
+
}
|
|
880
|
+
getTitle() {
|
|
881
|
+
const dataTitle = this.toolbarService.getDataTitle();
|
|
882
|
+
const toolbarTitle = this.toolbarService.toolbarTitle;
|
|
883
|
+
const title = !toolbarTitle || toolbarTitle.length <= 0 ? this.titleService.getTitle() : toolbarTitle;
|
|
884
|
+
return !dataTitle || dataTitle.length <= 0 ? title : title + ': ' + dataTitle;
|
|
885
|
+
}
|
|
886
|
+
getToolbarActions() {
|
|
887
|
+
return this.toolbarService.getToolbarActions();
|
|
888
|
+
}
|
|
889
|
+
getMainActions() {
|
|
890
|
+
return this.toolbarService.getMainActions();
|
|
891
|
+
}
|
|
892
|
+
hasPermission(action) {
|
|
893
|
+
if (!action || !action.showIf) {
|
|
894
|
+
return of(true);
|
|
895
|
+
}
|
|
896
|
+
return action.showIf;
|
|
897
|
+
}
|
|
898
|
+
isRouterLink() {
|
|
899
|
+
return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().routerLink;
|
|
900
|
+
}
|
|
901
|
+
isAbsoluteLink() {
|
|
902
|
+
return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().href;
|
|
903
|
+
}
|
|
904
|
+
isAction() {
|
|
905
|
+
return this.toolbarService.getBackAction() && !!this.toolbarService.getBackAction().action;
|
|
906
|
+
}
|
|
907
|
+
getBackAction() {
|
|
908
|
+
return this.toolbarService.getBackAction();
|
|
909
|
+
}
|
|
910
|
+
getToolbarActionsAlwaysAsMenu() {
|
|
911
|
+
return this.toolbarService.getToolbarActionsAlwaysAsMenu();
|
|
912
|
+
}
|
|
913
|
+
getToolbarActionsMenuTitle() {
|
|
914
|
+
return this.toolbarService.getToolbarActionsMenuTitle();
|
|
915
|
+
}
|
|
916
|
+
showBadgeForMenu() {
|
|
917
|
+
return (this.getToolbarActions()
|
|
918
|
+
.slice(1) // the first icon is not shown in menu
|
|
919
|
+
.filter(value => value.badge && value.badge.value).length > 0);
|
|
920
|
+
}
|
|
921
|
+
hasImportantToolbarActions() {
|
|
922
|
+
return this.getToolbarActions().filter(value => !!value.importantAction).length > 0;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$3.BreakpointObserver }, { token: i2$2.Title }, { token: ToolbarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
926
|
+
ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ToolbarComponent, selector: "mad-toolbar", ngImport: i0, template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\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()\">\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()\">\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\">\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 [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 </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=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0:1) : 2) || !!action.importantAction\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\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 </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\">\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 *ngIf=\"i >= (hasImportantToolbarActions() ? 0:1)\" mat-menu-item (click)=\"action.action()\">\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: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i2.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]", 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: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
928
|
+
type: Component,
|
|
929
|
+
args: [{ selector: 'mad-toolbar', template: "<mat-toolbar class=\"content-toolbar\">\n <a [routerLink]=\"getBackAction().routerLink\" *ngIf=\"isRouterLink()\">\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()\">\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()\">\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\">\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 [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 </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=\"(!(isHandset$ | async) && !getToolbarActionsAlwaysAsMenu()) || i < (getToolbarActions().length > 2 ? (hasImportantToolbarActions() ? 0:1) : 2) || !!action.importantAction\"\n [id]=\"action.matIcon\"\n [matTooltip]=\"action.actionName\"\n type=\"button\">\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 </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\">\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 *ngIf=\"i >= (hasImportantToolbarActions() ? 0:1)\" mat-menu-item (click)=\"action.action()\">\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"] }]
|
|
930
|
+
}], ctorParameters: function () { return [{ type: i1$3.BreakpointObserver }, { type: i2$2.Title }, { type: ToolbarService }]; } });
|
|
931
|
+
|
|
932
|
+
class ToolbarModule {
|
|
933
|
+
}
|
|
934
|
+
ToolbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
935
|
+
ToolbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, declarations: [ToolbarComponent], imports: [CommonModule,
|
|
936
|
+
RouterModule,
|
|
937
|
+
MatMenuModule,
|
|
938
|
+
MatButtonModule,
|
|
939
|
+
MatToolbarModule,
|
|
940
|
+
MatIconModule,
|
|
941
|
+
MaterialActionButtonModule,
|
|
942
|
+
MatTooltipModule,
|
|
943
|
+
ButtonModule,
|
|
944
|
+
MatBadgeModule], exports: [ToolbarComponent] });
|
|
945
|
+
ToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, imports: [CommonModule,
|
|
946
|
+
RouterModule,
|
|
947
|
+
MatMenuModule,
|
|
948
|
+
MatButtonModule,
|
|
949
|
+
MatToolbarModule,
|
|
950
|
+
MatIconModule,
|
|
951
|
+
MaterialActionButtonModule,
|
|
952
|
+
MatTooltipModule,
|
|
953
|
+
ButtonModule,
|
|
954
|
+
MatBadgeModule] });
|
|
955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ToolbarModule, decorators: [{
|
|
956
|
+
type: NgModule,
|
|
957
|
+
args: [{
|
|
958
|
+
declarations: [ToolbarComponent],
|
|
959
|
+
imports: [
|
|
960
|
+
CommonModule,
|
|
961
|
+
RouterModule,
|
|
962
|
+
MatMenuModule,
|
|
963
|
+
MatButtonModule,
|
|
964
|
+
MatToolbarModule,
|
|
965
|
+
MatIconModule,
|
|
966
|
+
MaterialActionButtonModule,
|
|
967
|
+
MatTooltipModule,
|
|
968
|
+
ButtonModule,
|
|
969
|
+
MatBadgeModule,
|
|
970
|
+
],
|
|
971
|
+
exports: [ToolbarComponent],
|
|
972
|
+
}]
|
|
973
|
+
}] });
|
|
974
|
+
|
|
975
|
+
/*
|
|
976
|
+
* Copyright (c) 2018-2020 Porsche Informatik. All Rights Reserved.
|
|
977
|
+
* This software is released under MIT license.
|
|
978
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
979
|
+
*/
|
|
980
|
+
const BACK_KEYCODE = 8;
|
|
981
|
+
const SPACE_KEYCODE = 32;
|
|
982
|
+
const DEL_KEYCODE = 46;
|
|
983
|
+
const CONTROL_KEYCODES_UPPER_BORDER = 46;
|
|
984
|
+
const OTHER_CONTROL_KEYS = new Set([224, 91, 93]);
|
|
985
|
+
class NumericFieldDirective {
|
|
986
|
+
constructor(renderer, inputEl, numberFormatService) {
|
|
987
|
+
this.renderer = renderer;
|
|
988
|
+
this.inputEl = inputEl;
|
|
989
|
+
this.numberFormatService = numberFormatService;
|
|
990
|
+
this.textAlign = 'right';
|
|
991
|
+
this.decimalPlaces = 2;
|
|
992
|
+
this.roundValue = false;
|
|
993
|
+
this.autofillDecimals = false;
|
|
994
|
+
this.unit = null;
|
|
995
|
+
this.unitPosition = 'right';
|
|
996
|
+
this.numericValueChanged = new EventEmitter();
|
|
997
|
+
this.displayValue = '';
|
|
998
|
+
this.originalValue = NaN;
|
|
999
|
+
/* Control Values Accessor Stuff below */
|
|
1000
|
+
// eslint-disable-next-line
|
|
1001
|
+
this.onChange = () => { };
|
|
1002
|
+
// eslint-disable-next-line
|
|
1003
|
+
this.onTouched = () => { };
|
|
1004
|
+
}
|
|
1005
|
+
set numericValue(value) {
|
|
1006
|
+
if (this._numericValue !== value && !(isNaN(this._numericValue) && (isNaN(value) || value === null))) {
|
|
1007
|
+
this.originalValue = value;
|
|
1008
|
+
// Don't roundOrTruncate if value was set to empty otherwise input value will be set to 0 instead of empty
|
|
1009
|
+
// which happens when an input is being reset
|
|
1010
|
+
this._numericValue = value === null || value === undefined ? value : this.roundOrTruncate(value); // eslint-disable-line
|
|
1011
|
+
this.handleInputChanged();
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
registerOnChange(fn) {
|
|
1015
|
+
this.onChange = fn;
|
|
1016
|
+
}
|
|
1017
|
+
registerOnTouched(fn) {
|
|
1018
|
+
this.onTouched = fn;
|
|
1019
|
+
}
|
|
1020
|
+
setDisabledState() {
|
|
1021
|
+
// Dont need to implement since its just a directive
|
|
1022
|
+
}
|
|
1023
|
+
writeValue(value) {
|
|
1024
|
+
this.numericValue = value;
|
|
1025
|
+
}
|
|
1026
|
+
ngOnInit() {
|
|
1027
|
+
/* needs to be parsed as number explicitly as it comes as string from user input */
|
|
1028
|
+
this.decimalPlaces = parseInt(this.decimalPlaces.toString(), 10);
|
|
1029
|
+
this.inputChangeListener = this.renderer.listen(this.inputEl.nativeElement, 'blur', event => {
|
|
1030
|
+
this.formatInput(event.target, true);
|
|
1031
|
+
});
|
|
1032
|
+
this.keyupListener = this.renderer.listen(this.inputEl.nativeElement, 'keyup', event => {
|
|
1033
|
+
if (event.keyCode === BACK_KEYCODE || (event.keyCode >= CONTROL_KEYCODES_UPPER_BORDER && !OTHER_CONTROL_KEYS.has(event.keyCode))) {
|
|
1034
|
+
this.formatInput(event.target, false);
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
this.keydownListener = this.renderer.listen(this.inputEl.nativeElement, 'keydown', event => {
|
|
1038
|
+
const value = event.target.value;
|
|
1039
|
+
if (this.numberFormatService.allowedKeys.includes(event.key) ||
|
|
1040
|
+
(event.keyCode <= CONTROL_KEYCODES_UPPER_BORDER && event.keyCode > 0 && event.keyCode !== SPACE_KEYCODE) ||
|
|
1041
|
+
event.metaKey ||
|
|
1042
|
+
event.ctrlKey ||
|
|
1043
|
+
event.altKey) {
|
|
1044
|
+
/* allow negative sign only as first character and none exists outside of text selection */
|
|
1045
|
+
const indexNegativeSign = value.indexOf(NumberFormatService.NEGATIVE);
|
|
1046
|
+
if (event.key === NumberFormatService.NEGATIVE &&
|
|
1047
|
+
(event.target.selectionStart > 0 || indexNegativeSign > -1) &&
|
|
1048
|
+
(event.target.selectionStart === event.target.selectionEnd ||
|
|
1049
|
+
!(indexNegativeSign >= event.target.selectionStart && indexNegativeSign <= event.target.selectionEnd))) {
|
|
1050
|
+
return false;
|
|
1051
|
+
}
|
|
1052
|
+
/* no duplicate decimal separators */
|
|
1053
|
+
const indexDecimalSep = value.indexOf(this.numberFormatService.decimalSeparator);
|
|
1054
|
+
if (event.key === this.numberFormatService.decimalSeparator &&
|
|
1055
|
+
(indexDecimalSep > -1 || this.decimalPlaces === 0) &&
|
|
1056
|
+
(event.target.selectionStart === event.target.selectionEnd ||
|
|
1057
|
+
!(indexDecimalSep >= event.target.selectionStart && indexDecimalSep <= event.target.selectionEnd))) {
|
|
1058
|
+
return false;
|
|
1059
|
+
}
|
|
1060
|
+
/* prevent too many decimal places */
|
|
1061
|
+
if (NumberFormatService.NUMBERS.includes(event.key) &&
|
|
1062
|
+
indexDecimalSep > -1 &&
|
|
1063
|
+
indexDecimalSep < event.target.selectionStart &&
|
|
1064
|
+
event.target.selectionStart === event.target.selectionEnd &&
|
|
1065
|
+
value.length > indexDecimalSep + this.decimalPlaces) {
|
|
1066
|
+
return false;
|
|
1067
|
+
}
|
|
1068
|
+
/* when deleting thousand separator, remove the digit before or after it */
|
|
1069
|
+
const cursorStart = event.target.selectionStart;
|
|
1070
|
+
if (cursorStart === event.target.selectionEnd) {
|
|
1071
|
+
if (event.keyCode === BACK_KEYCODE && value.substr(cursorStart - 1, 1) === this.numberFormatService.groupingSeparator) {
|
|
1072
|
+
event.target.value = value.substring(0, cursorStart - 2) + value.substring(cursorStart - 1, value.length);
|
|
1073
|
+
event.target.selectionStart = event.target.selectionEnd = cursorStart - 1;
|
|
1074
|
+
return false;
|
|
1075
|
+
}
|
|
1076
|
+
else if (event.keyCode === DEL_KEYCODE && value.substr(cursorStart, 1) === this.numberFormatService.groupingSeparator) {
|
|
1077
|
+
event.target.value = value.substring(0, cursorStart + 1) + value.substring(cursorStart + 2, value.length);
|
|
1078
|
+
event.target.selectionStart = event.target.selectionEnd = cursorStart + 1;
|
|
1079
|
+
return false;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
this.originalValue = NaN;
|
|
1083
|
+
}
|
|
1084
|
+
else {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1087
|
+
return true;
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
ngOnDestroy() {
|
|
1091
|
+
this.detachListener();
|
|
1092
|
+
}
|
|
1093
|
+
ngAfterViewChecked() {
|
|
1094
|
+
this.injectUnitSymbol();
|
|
1095
|
+
}
|
|
1096
|
+
handleInputChanged() {
|
|
1097
|
+
// Call in set timeout to avoid Expression has changed after it has been checked error.
|
|
1098
|
+
// Sometimes the value changes because we cut off decimal places
|
|
1099
|
+
setTimeout(() => {
|
|
1100
|
+
this.updateInput(this.numberFormatService.format(this._numericValue, {
|
|
1101
|
+
decimalPlaces: this.decimalPlaces,
|
|
1102
|
+
finalFormatting: false,
|
|
1103
|
+
autofillDecimals: this.autofillDecimals,
|
|
1104
|
+
}));
|
|
1105
|
+
}, 1);
|
|
1106
|
+
}
|
|
1107
|
+
formatInput(element, finalFormatting) {
|
|
1108
|
+
const cursorPos = element.selectionStart;
|
|
1109
|
+
const length = element.value.length;
|
|
1110
|
+
const setCursor = this.displayValue !== element.value;
|
|
1111
|
+
const textFormatted = this.numberFormatService.formatNumber(element.value, {
|
|
1112
|
+
decimalPlaces: this.decimalPlaces,
|
|
1113
|
+
finalFormatting,
|
|
1114
|
+
autofillDecimals: this.autofillDecimals,
|
|
1115
|
+
});
|
|
1116
|
+
// special handling to move unit symbol along with display value
|
|
1117
|
+
if (this.textAlign === 'left' && this.unitPosition === 'right') {
|
|
1118
|
+
const inputStyles = window.getComputedStyle(this.inputEl.nativeElement.parentElement, null);
|
|
1119
|
+
this.unitSpan.style.position = 'absolute';
|
|
1120
|
+
this.unitSpan.style.marginTop = inputStyles.getPropertyValue('border-top-width');
|
|
1121
|
+
this.unitSpan.style.paddingTop = inputStyles.getPropertyValue('padding-top');
|
|
1122
|
+
this.unitSpan.style.paddingBottom = inputStyles.getPropertyValue('padding-bottom');
|
|
1123
|
+
if (!this.textSpan) {
|
|
1124
|
+
this.textSpan = document.createElement('span');
|
|
1125
|
+
document.body.appendChild(this.textSpan);
|
|
1126
|
+
this.textSpan.style.font = inputStyles.getPropertyValue('font');
|
|
1127
|
+
this.textSpan.style.fontSize = inputStyles.getPropertyValue('font-size');
|
|
1128
|
+
this.textSpan.style.height = 'auto';
|
|
1129
|
+
this.textSpan.style.width = 'auto';
|
|
1130
|
+
this.textSpan.style.position = 'absolute';
|
|
1131
|
+
this.textSpan.style.top = '0';
|
|
1132
|
+
this.textSpan.style.whiteSpace = 'no-wrap';
|
|
1133
|
+
this.textSpan.style.visibility = 'hidden';
|
|
1134
|
+
}
|
|
1135
|
+
this.textSpan.innerHTML = textFormatted;
|
|
1136
|
+
const width = Math.min(this.inputEl.nativeElement.clientWidth - this.unitSpan.clientWidth, Math.ceil(this.textSpan.clientWidth));
|
|
1137
|
+
this.unitSpan.style.left = width + 'px';
|
|
1138
|
+
}
|
|
1139
|
+
this.updateInput(textFormatted);
|
|
1140
|
+
if (setCursor) {
|
|
1141
|
+
element.selectionStart = element.selectionEnd = Math.max(cursorPos + element.value.length - length, 0);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
updateInput(value) {
|
|
1145
|
+
this.displayValue = value;
|
|
1146
|
+
this.inputEl.nativeElement.value = value;
|
|
1147
|
+
this._numericValue = parseFloat(this.numberFormatService.strip(value, { decimalPlaces: this.decimalPlaces }).replace(this.numberFormatService.decimalSeparator, '.'));
|
|
1148
|
+
if (this._numericValue !== this.roundOrTruncate(this.originalValue)) {
|
|
1149
|
+
this.originalValue = this._numericValue;
|
|
1150
|
+
this.numericValueChanged.emit(this._numericValue);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
getValueForFormControl() {
|
|
1154
|
+
this.formatInput(this.inputEl.nativeElement, false);
|
|
1155
|
+
if (isNaN(this._numericValue)) {
|
|
1156
|
+
// Return undefined instead of NaN to support the default required validator.
|
|
1157
|
+
return undefined; // eslint-disable-line
|
|
1158
|
+
}
|
|
1159
|
+
return this._numericValue;
|
|
1160
|
+
}
|
|
1161
|
+
injectUnitSymbol() {
|
|
1162
|
+
// Need to inject the unit symbol when the input element width is set to its actual value,
|
|
1163
|
+
// otherwise the icon wont show in the correct position
|
|
1164
|
+
if (!!this.unit && !this.unitSpan && this.inputEl.nativeElement.offsetWidth !== 0) {
|
|
1165
|
+
// Get the input wrapper and apply necessary styles
|
|
1166
|
+
const inputWrapper = this.inputEl.nativeElement.parentNode.parentNode;
|
|
1167
|
+
// Create the span with unit symbol and apply necessary styles
|
|
1168
|
+
this.unitSpan = this.renderer.createElement('span');
|
|
1169
|
+
if (this.unitPosition === 'left') {
|
|
1170
|
+
this.renderer.setAttribute(this.unitSpan, 'matPrefix', '');
|
|
1171
|
+
this.renderer.setStyle(this.unitSpan, 'padding-right', '5px');
|
|
1172
|
+
this.renderer.insertBefore(inputWrapper, this.unitSpan, inputWrapper.children[0]);
|
|
1173
|
+
}
|
|
1174
|
+
else {
|
|
1175
|
+
this.renderer.setAttribute(this.unitSpan, 'matSuffix', '');
|
|
1176
|
+
this.renderer.setStyle(this.unitSpan, 'padding-left', '5px');
|
|
1177
|
+
this.renderer.appendChild(inputWrapper, this.unitSpan);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
// do not display unit symbol if the unit should move along display value
|
|
1181
|
+
if (!!this.unitSpan && this.textAlign === 'left' && this.unitPosition === 'right') {
|
|
1182
|
+
if (NumberFormatService.valueIsSet(this.displayValue)) {
|
|
1183
|
+
this.unitSpan.style.display = 'unset';
|
|
1184
|
+
}
|
|
1185
|
+
else {
|
|
1186
|
+
this.unitSpan.style.display = 'none';
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
// always reset unit symbol
|
|
1190
|
+
if (!!this.unitSpan) {
|
|
1191
|
+
this.unitSpan.textContent = this.unit;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
detachListener() {
|
|
1195
|
+
if (this.inputChangeListener) {
|
|
1196
|
+
this.inputChangeListener();
|
|
1197
|
+
delete this.inputChangeListener;
|
|
1198
|
+
}
|
|
1199
|
+
if (this.keydownListener) {
|
|
1200
|
+
this.keydownListener();
|
|
1201
|
+
delete this.keydownListener;
|
|
1202
|
+
}
|
|
1203
|
+
if (this.keyupListener) {
|
|
1204
|
+
this.keyupListener();
|
|
1205
|
+
delete this.keyupListener;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
roundOrTruncate(value) {
|
|
1209
|
+
const method = this.roundValue ? 'round' : value < 0 ? 'ceil' : 'floor';
|
|
1210
|
+
return Math[method](value * Math.pow(10, this.decimalPlaces)) / Math.pow(10, this.decimalPlaces);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
NumericFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: NumberFormatService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1214
|
+
NumericFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: NumericFieldDirective, selector: "[madNumericField]", inputs: { textAlign: "textAlign", decimalPlaces: "decimalPlaces", roundValue: ["roundDisplayValue", "roundValue"], autofillDecimals: "autofillDecimals", unit: "unit", unitPosition: "unitPosition", numericValue: "numericValue" }, outputs: { numericValueChanged: "numericValueChange" }, host: { listeners: { "change": "onChange(getValueForFormControl())", "input": "onChange(getValueForFormControl())", "blur": "onTouched()" }, properties: { "class.text-right": "textAlign === \"right\"" } }, providers: [
|
|
1215
|
+
{
|
|
1216
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1217
|
+
useExisting: forwardRef(() => NumericFieldDirective),
|
|
1218
|
+
multi: true,
|
|
1219
|
+
},
|
|
1220
|
+
], ngImport: i0 });
|
|
1221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldDirective, decorators: [{
|
|
1222
|
+
type: Directive,
|
|
1223
|
+
args: [{
|
|
1224
|
+
selector: '[madNumericField]',
|
|
1225
|
+
host: {
|
|
1226
|
+
'[class.text-right]': 'textAlign === "right"',
|
|
1227
|
+
'(change)': 'onChange(getValueForFormControl())',
|
|
1228
|
+
'(input)': 'onChange(getValueForFormControl())',
|
|
1229
|
+
'(blur)': 'onTouched()',
|
|
1230
|
+
},
|
|
1231
|
+
providers: [
|
|
1232
|
+
{
|
|
1233
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1234
|
+
useExisting: forwardRef(() => NumericFieldDirective),
|
|
1235
|
+
multi: true,
|
|
1236
|
+
},
|
|
1237
|
+
],
|
|
1238
|
+
}]
|
|
1239
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: NumberFormatService }]; }, propDecorators: { textAlign: [{
|
|
1240
|
+
type: Input,
|
|
1241
|
+
args: ['textAlign']
|
|
1242
|
+
}], decimalPlaces: [{
|
|
1243
|
+
type: Input,
|
|
1244
|
+
args: ['decimalPlaces']
|
|
1245
|
+
}], roundValue: [{
|
|
1246
|
+
type: Input,
|
|
1247
|
+
args: ['roundDisplayValue']
|
|
1248
|
+
}], autofillDecimals: [{
|
|
1249
|
+
type: Input,
|
|
1250
|
+
args: ['autofillDecimals']
|
|
1251
|
+
}], unit: [{
|
|
1252
|
+
type: Input,
|
|
1253
|
+
args: ['unit']
|
|
1254
|
+
}], unitPosition: [{
|
|
1255
|
+
type: Input,
|
|
1256
|
+
args: ['unitPosition']
|
|
1257
|
+
}], numericValueChanged: [{
|
|
1258
|
+
type: Output,
|
|
1259
|
+
args: ['numericValueChange']
|
|
1260
|
+
}], numericValue: [{
|
|
1261
|
+
type: Input,
|
|
1262
|
+
args: ['numericValue']
|
|
1263
|
+
}] } });
|
|
1264
|
+
|
|
1265
|
+
class NumericFieldModule {
|
|
1266
|
+
static forRoot() {
|
|
1267
|
+
return {
|
|
1268
|
+
ngModule: NumericFieldModule,
|
|
1269
|
+
providers: [NumberFormatService],
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
NumericFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1274
|
+
NumericFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, declarations: [NumericFieldDirective], exports: [NumericFieldDirective] });
|
|
1275
|
+
NumericFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, providers: [NumberFormatService] });
|
|
1276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: NumericFieldModule, decorators: [{
|
|
1277
|
+
type: NgModule,
|
|
1278
|
+
args: [{
|
|
1279
|
+
providers: [NumberFormatService],
|
|
1280
|
+
declarations: [NumericFieldDirective],
|
|
1281
|
+
exports: [NumericFieldDirective],
|
|
1282
|
+
}]
|
|
1283
|
+
}] });
|
|
1284
|
+
|
|
1285
|
+
class ThrottleClickDirective {
|
|
1286
|
+
constructor() {
|
|
1287
|
+
this.throttleTime = 300;
|
|
1288
|
+
this.throttleClick = new EventEmitter();
|
|
1289
|
+
this.clicks = new Subject();
|
|
1290
|
+
}
|
|
1291
|
+
clickEvent(event) {
|
|
1292
|
+
event.preventDefault();
|
|
1293
|
+
event.stopPropagation();
|
|
1294
|
+
this.clicks.next(event);
|
|
1295
|
+
}
|
|
1296
|
+
ngOnInit() {
|
|
1297
|
+
this.subscription = this.clicks.pipe(throttleTime(this.throttleTime)).subscribe(e => this.throttleClick.emit(e));
|
|
1298
|
+
}
|
|
1299
|
+
ngOnDestroy() {
|
|
1300
|
+
this.subscription.unsubscribe();
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
ThrottleClickDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1304
|
+
ThrottleClickDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.2", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: { throttleTime: "throttleTime" }, outputs: { throttleClick: "throttleClick" }, host: { listeners: { "click": "clickEvent($event)" } }, ngImport: i0 });
|
|
1305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickDirective, decorators: [{
|
|
1306
|
+
type: Directive,
|
|
1307
|
+
args: [{
|
|
1308
|
+
selector: '[madThrottleClick]',
|
|
1309
|
+
}]
|
|
1310
|
+
}], propDecorators: { throttleTime: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], throttleClick: [{
|
|
1313
|
+
type: Output
|
|
1314
|
+
}], clickEvent: [{
|
|
1315
|
+
type: HostListener,
|
|
1316
|
+
args: ['click', ['$event']]
|
|
1317
|
+
}] } });
|
|
1318
|
+
|
|
1319
|
+
class CardComponent {
|
|
1320
|
+
constructor() {
|
|
1321
|
+
this.cancelDisabled = false;
|
|
1322
|
+
this.cancelText = 'NOT SET';
|
|
1323
|
+
this.readonly = true;
|
|
1324
|
+
this.editText = 'NOT SET';
|
|
1325
|
+
this.expandable = true;
|
|
1326
|
+
this.expanded = true;
|
|
1327
|
+
this.saveDisabled = false;
|
|
1328
|
+
this.saveText = 'NOT SET';
|
|
1329
|
+
this.editMode = false;
|
|
1330
|
+
this.additionalActionText = '';
|
|
1331
|
+
this.edit = new EventEmitter();
|
|
1332
|
+
this.cancel = new EventEmitter();
|
|
1333
|
+
this.save = new EventEmitter();
|
|
1334
|
+
this.additionalAction = new EventEmitter();
|
|
1335
|
+
}
|
|
1336
|
+
onCancel() {
|
|
1337
|
+
this.cancel.emit(undefined);
|
|
1338
|
+
}
|
|
1339
|
+
onEdit() {
|
|
1340
|
+
this.edit.emit(undefined);
|
|
1341
|
+
this.expanded = true;
|
|
1342
|
+
}
|
|
1343
|
+
onSave() {
|
|
1344
|
+
this.save.emit(undefined);
|
|
1345
|
+
}
|
|
1346
|
+
toggleCollapse() {
|
|
1347
|
+
this.expanded = !this.expanded;
|
|
1348
|
+
}
|
|
1349
|
+
additionalActionClicked() {
|
|
1350
|
+
this.additionalAction.emit(undefined);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1354
|
+
CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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>\n <mat-card-title>\n {{ title }}\n <mad-icon-button (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n </mat-card-title>\n <span>\n <mad-icon-button (click)=\"additionalActionClicked()\" *ngIf=\"additionalActionIcon\" [title]=\"additionalActionText\" type=\"button\">\n <mat-icon>{{additionalActionIcon}}</mat-icon>\n </mad-icon-button>\n <mad-icon-button [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </span>\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 [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: ["mat-card-header{display:flex;flex-direction:row;justify-content:space-between}mat-card-header mat-card-title{justify-content:space-between}mat-card-header mat-card-title:hover{background:unset!important}mat-card-header h3{margin:0 .25em 0 0;float:left;line-height:40px;font-weight:700}.mat-card-actions{margin-left:0;margin-right:0}.mat-card>.mat-card-actions:last-child{margin-bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i2$3.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i2$3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i2$3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: i2$3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "component", type: i2.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"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: ThrottleClickDirective, selector: "[madThrottleClick]", inputs: ["throttleTime"], outputs: ["throttleClick"] }], animations: [
|
|
1355
|
+
trigger('collapseExpandAnimation', [
|
|
1356
|
+
transition(':enter', [
|
|
1357
|
+
style({ opacity: 0, height: 0, overflow: 'hidden' }),
|
|
1358
|
+
animate('100ms', style({
|
|
1359
|
+
opacity: 1,
|
|
1360
|
+
height: '*',
|
|
1361
|
+
})),
|
|
1362
|
+
]),
|
|
1363
|
+
transition(':leave', [
|
|
1364
|
+
style({ opacity: 1, height: '*', overflow: 'hidden' }),
|
|
1365
|
+
animate('100ms', style({
|
|
1366
|
+
opacity: 0,
|
|
1367
|
+
height: 0,
|
|
1368
|
+
})),
|
|
1369
|
+
]),
|
|
1370
|
+
]),
|
|
1371
|
+
trigger('rotateIcon', [
|
|
1372
|
+
state('true', style({ transform: 'rotate(0)' })),
|
|
1373
|
+
state('false', style({ transform: 'rotate(180deg)' })),
|
|
1374
|
+
transition('true => false', animate('100ms ease-out')),
|
|
1375
|
+
transition('false => true', animate('100ms ease-in')),
|
|
1376
|
+
]),
|
|
1377
|
+
] });
|
|
1378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardComponent, decorators: [{
|
|
1379
|
+
type: Component,
|
|
1380
|
+
args: [{ selector: 'mad-card', animations: [
|
|
1381
|
+
trigger('collapseExpandAnimation', [
|
|
1382
|
+
transition(':enter', [
|
|
1383
|
+
style({ opacity: 0, height: 0, overflow: 'hidden' }),
|
|
1384
|
+
animate('100ms', style({
|
|
1385
|
+
opacity: 1,
|
|
1386
|
+
height: '*',
|
|
1387
|
+
})),
|
|
1388
|
+
]),
|
|
1389
|
+
transition(':leave', [
|
|
1390
|
+
style({ opacity: 1, height: '*', overflow: 'hidden' }),
|
|
1391
|
+
animate('100ms', style({
|
|
1392
|
+
opacity: 0,
|
|
1393
|
+
height: 0,
|
|
1394
|
+
})),
|
|
1395
|
+
]),
|
|
1396
|
+
]),
|
|
1397
|
+
trigger('rotateIcon', [
|
|
1398
|
+
state('true', style({ transform: 'rotate(0)' })),
|
|
1399
|
+
state('false', style({ transform: 'rotate(180deg)' })),
|
|
1400
|
+
transition('true => false', animate('100ms ease-out')),
|
|
1401
|
+
transition('false => true', animate('100ms ease-in')),
|
|
1402
|
+
]),
|
|
1403
|
+
], template: "<mat-card>\n <mat-card-header>\n <mat-card-title>\n {{ title }}\n <mad-icon-button (click)=\"toggleCollapse()\" *ngIf=\"expandable && !editMode\">\n <mat-icon [@rotateIcon]=\"!expanded\">keyboard_arrow_down</mat-icon>\n </mad-icon-button>\n </mat-card-title>\n <span>\n <mad-icon-button (click)=\"additionalActionClicked()\" *ngIf=\"additionalActionIcon\" [title]=\"additionalActionText\" type=\"button\">\n <mat-icon>{{additionalActionIcon}}</mat-icon>\n </mad-icon-button>\n <mad-icon-button [title]=\"editText\" (click)=\"onEdit()\" *ngIf=\"!readonly && !editMode\">\n <mat-icon>create</mat-icon>\n </mad-icon-button>\n </span>\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 [title]=\"saveText\" [disabled]=\"saveDisabled\" (throttleClick)=\"onSave()\" madThrottleClick>\n {{ saveText }}\n </mad-primary-button>\n <mad-outline-button [title]=\"cancelText\" [disabled]=\"cancelDisabled\" (click)=\"onCancel()\">\n {{ cancelText }}\n </mad-outline-button>\n </mat-card-actions>\n</mat-card>\n", styles: ["mat-card-header{display:flex;flex-direction:row;justify-content:space-between}mat-card-header mat-card-title{justify-content:space-between}mat-card-header mat-card-title:hover{background:unset!important}mat-card-header h3{margin:0 .25em 0 0;float:left;line-height:40px;font-weight:700}.mat-card-actions{margin-left:0;margin-right:0}.mat-card>.mat-card-actions:last-child{margin-bottom:0}\n"] }]
|
|
1404
|
+
}], propDecorators: { cancelDisabled: [{
|
|
1405
|
+
type: Input
|
|
1406
|
+
}], cancelText: [{
|
|
1407
|
+
type: Input
|
|
1408
|
+
}], readonly: [{
|
|
1409
|
+
type: Input
|
|
1410
|
+
}], editText: [{
|
|
1411
|
+
type: Input
|
|
1412
|
+
}], expandable: [{
|
|
1413
|
+
type: Input
|
|
1414
|
+
}], expanded: [{
|
|
1415
|
+
type: Input
|
|
1416
|
+
}], saveDisabled: [{
|
|
1417
|
+
type: Input
|
|
1418
|
+
}], saveText: [{
|
|
1419
|
+
type: Input
|
|
1420
|
+
}], title: [{
|
|
1421
|
+
type: Input
|
|
1422
|
+
}], editMode: [{
|
|
1423
|
+
type: Input
|
|
1424
|
+
}], additionalActionIcon: [{
|
|
1425
|
+
type: Input
|
|
1426
|
+
}], additionalActionText: [{
|
|
1427
|
+
type: Input
|
|
1428
|
+
}], edit: [{
|
|
1429
|
+
type: Output
|
|
1430
|
+
}], cancel: [{
|
|
1431
|
+
type: Output
|
|
1432
|
+
}], save: [{
|
|
1433
|
+
type: Output
|
|
1434
|
+
}], additionalAction: [{
|
|
1435
|
+
type: Output
|
|
1436
|
+
}] } });
|
|
1437
|
+
|
|
1438
|
+
class ThrottleClickModule {
|
|
1439
|
+
}
|
|
1440
|
+
ThrottleClickModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1441
|
+
ThrottleClickModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, declarations: [ThrottleClickDirective], imports: [CommonModule], exports: [ThrottleClickDirective] });
|
|
1442
|
+
ThrottleClickModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, imports: [CommonModule] });
|
|
1443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ThrottleClickModule, decorators: [{
|
|
1444
|
+
type: NgModule,
|
|
1445
|
+
args: [{
|
|
1446
|
+
declarations: [ThrottleClickDirective],
|
|
1447
|
+
imports: [CommonModule],
|
|
1448
|
+
exports: [ThrottleClickDirective],
|
|
1449
|
+
}]
|
|
1450
|
+
}] });
|
|
1451
|
+
|
|
1452
|
+
class CardModule {
|
|
1453
|
+
}
|
|
1454
|
+
CardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1455
|
+
CardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: CardModule, declarations: [CardComponent], imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule], exports: [CardComponent] });
|
|
1456
|
+
CardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule] });
|
|
1457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: CardModule, decorators: [{
|
|
1458
|
+
type: NgModule,
|
|
1459
|
+
args: [{
|
|
1460
|
+
declarations: [CardComponent],
|
|
1461
|
+
imports: [CommonModule, MatCardModule, MatIconModule, ButtonModule, MatButtonModule, ThrottleClickModule],
|
|
1462
|
+
exports: [CardComponent],
|
|
1463
|
+
}]
|
|
1464
|
+
}] });
|
|
1465
|
+
|
|
1466
|
+
class BaseQuickListComponent {
|
|
1467
|
+
constructor(changeDetectorRef) {
|
|
1468
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1469
|
+
this.allItems = [];
|
|
1470
|
+
this.addLabel = 'NOT SET';
|
|
1471
|
+
this.addPossible = true;
|
|
1472
|
+
this.removePossible = true;
|
|
1473
|
+
this.blankItem = {};
|
|
1474
|
+
this.added = new EventEmitter();
|
|
1475
|
+
this.removed = new EventEmitter();
|
|
1476
|
+
}
|
|
1477
|
+
ngOnInit() {
|
|
1478
|
+
this.addEventFunction = this.addItem.bind(this);
|
|
1479
|
+
if (this.minItems) {
|
|
1480
|
+
for (let n = this.allItems.length; n < this.minItems; n++) {
|
|
1481
|
+
this.interalAddItem();
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
ngAfterViewInit() {
|
|
1486
|
+
setTimeout(() => this.setFocusOnAdd(), 1);
|
|
1487
|
+
}
|
|
1488
|
+
addItem() {
|
|
1489
|
+
const newItem = this.interalAddItem();
|
|
1490
|
+
if (!!newItem) {
|
|
1491
|
+
this.added.emit(newItem);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
removeItem(item) {
|
|
1495
|
+
if (this.isDeleteAllowed()) {
|
|
1496
|
+
this.allItems.splice(this.allItems.indexOf(item), 1);
|
|
1497
|
+
this.removed.emit(item);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
setFocusOnAdd() {
|
|
1501
|
+
this.rowCountFocus = this.itemRows.length;
|
|
1502
|
+
this.itemRows.changes.subscribe((els) => {
|
|
1503
|
+
if (els.length > this.rowCountFocus && !!els.last) {
|
|
1504
|
+
const firstFocusable = els.last.nativeElement.querySelector("button, a, input, select, textarea, [tabindex]:not([tabindex='-1'])");
|
|
1505
|
+
if (firstFocusable) {
|
|
1506
|
+
firstFocusable.focus();
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
this.rowCountFocus = els.length;
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
isAddAllowed() {
|
|
1513
|
+
return this.addPossible && (!this.maxItems || this.allItems.length < this.maxItems);
|
|
1514
|
+
}
|
|
1515
|
+
isDeleteAllowed() {
|
|
1516
|
+
return this.removePossible && (!this.minItems || this.allItems.length > this.minItems);
|
|
1517
|
+
}
|
|
1518
|
+
interalAddItem() {
|
|
1519
|
+
if (this.isAddAllowed()) {
|
|
1520
|
+
const newItem = Object.assign({}, this.blankItem);
|
|
1521
|
+
// creates ids in the form of "n5kdz1pljl8"
|
|
1522
|
+
newItem.id = Math.random()
|
|
1523
|
+
.toString(36)
|
|
1524
|
+
.substring(2);
|
|
1525
|
+
this.allItems.push(newItem);
|
|
1526
|
+
this.changeDetectorRef.detectChanges();
|
|
1527
|
+
return newItem;
|
|
1528
|
+
}
|
|
1529
|
+
return null;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
BaseQuickListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseQuickListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1533
|
+
BaseQuickListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: BaseQuickListComponent, selector: "mad-base-quick-list", inputs: { allItems: "allItems", addLabel: "addLabel", addPossible: "addPossible", removePossible: "removePossible", blankItem: "blankItem", readonly: "readonly", maxItems: "maxItems", minItems: "minItems" }, outputs: { added: "added", removed: "removed" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "itemRows", predicate: ["row"], descendants: true }], ngImport: i0, template: '', isInline: true });
|
|
1534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseQuickListComponent, decorators: [{
|
|
1535
|
+
type: Component,
|
|
1536
|
+
args: [{ selector: 'mad-base-quick-list', template: '' }]
|
|
1537
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { allItems: [{
|
|
1538
|
+
type: Input
|
|
1539
|
+
}], addLabel: [{
|
|
1540
|
+
type: Input
|
|
1541
|
+
}], addPossible: [{
|
|
1542
|
+
type: Input
|
|
1543
|
+
}], removePossible: [{
|
|
1544
|
+
type: Input
|
|
1545
|
+
}], blankItem: [{
|
|
1546
|
+
type: Input
|
|
1547
|
+
}], readonly: [{
|
|
1548
|
+
type: Input
|
|
1549
|
+
}], maxItems: [{
|
|
1550
|
+
type: Input
|
|
1551
|
+
}], minItems: [{
|
|
1552
|
+
type: Input
|
|
1553
|
+
}], added: [{
|
|
1554
|
+
type: Output
|
|
1555
|
+
}], removed: [{
|
|
1556
|
+
type: Output
|
|
1557
|
+
}], itemTemplate: [{
|
|
1558
|
+
type: ContentChild,
|
|
1559
|
+
args: [TemplateRef]
|
|
1560
|
+
}], itemRows: [{
|
|
1561
|
+
type: ViewChildren,
|
|
1562
|
+
args: ['row']
|
|
1563
|
+
}] } });
|
|
1564
|
+
|
|
1565
|
+
class QuickListCompactComponent extends BaseQuickListComponent {
|
|
1566
|
+
constructor(changeDetectorRef) {
|
|
1567
|
+
super(changeDetectorRef);
|
|
1568
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
QuickListCompactComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListCompactComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1572
|
+
QuickListCompactComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: QuickListCompactComponent, selector: "mad-quick-list-compact", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems; let isLast = last;\">\n <div class=\"flex-container\" *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n <mad-icon-button *ngIf=\"!readonly && isLast\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly && !this.allItems.length\"\n (click)=\"addItem()\"\n [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] });
|
|
1573
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListCompactComponent, decorators: [{
|
|
1574
|
+
type: Component,
|
|
1575
|
+
args: [{ selector: 'mad-quick-list-compact', template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems; let isLast = last;\">\n <div class=\"flex-container\" *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n <mad-icon-button *ngIf=\"!readonly && isLast\" [disabled]=\"!isAddAllowed()\" (click)=\"addItem()\">\n <mat-icon>add_circle_outline</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly && !this.allItems.length\"\n (click)=\"addItem()\"\n [disabled]=\"!isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n" }]
|
|
1576
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
1577
|
+
|
|
1578
|
+
// Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
|
|
1579
|
+
class QuickListComponent extends BaseQuickListComponent {
|
|
1580
|
+
constructor(changeDetectorRef) {
|
|
1581
|
+
super(changeDetectorRef);
|
|
1582
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
QuickListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1586
|
+
QuickListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: QuickListComponent, selector: "mad-quick-list", usesInheritance: true, ngImport: i0, template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: LinkButtonComponent, selector: "mad-link-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }] });
|
|
1587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListComponent, decorators: [{
|
|
1588
|
+
type: Component,
|
|
1589
|
+
args: [{ selector: 'mad-quick-list', template: "<h3>\n <ng-content select=\"label\"></ng-content>\n</h3>\n<ng-container *ngFor=\"let item of allItems\">\n <div *ngIf=\"itemTemplate\" #row>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n <mad-icon-button *ngIf=\"!readonly && isDeleteAllowed()\" (click)=\"removeItem(item)\">\n <mat-icon>delete</mat-icon>\n </mad-icon-button>\n </div>\n</ng-container>\n<mad-link-button *ngIf=\"!readonly\" (click)=\"addItem()\"\n [disabled]=\"!addPossible || !isAddAllowed()\">\n {{ addLabel }}\n</mad-link-button>\n" }]
|
|
1590
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
1591
|
+
|
|
1592
|
+
class QuickListModule {
|
|
1593
|
+
}
|
|
1594
|
+
QuickListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1595
|
+
QuickListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent], imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule], exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent] });
|
|
1596
|
+
QuickListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule] });
|
|
1597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: QuickListModule, decorators: [{
|
|
1598
|
+
type: NgModule,
|
|
1599
|
+
args: [{
|
|
1600
|
+
declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent],
|
|
1601
|
+
imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule],
|
|
1602
|
+
exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent],
|
|
1603
|
+
}]
|
|
1604
|
+
}] });
|
|
1605
|
+
|
|
1606
|
+
class TableComponent {
|
|
1607
|
+
constructor() {
|
|
1608
|
+
var _a;
|
|
1609
|
+
this.columns = [];
|
|
1610
|
+
this.filterLabel = 'NOT SET';
|
|
1611
|
+
this.filterPlaceholder = 'NOT SET';
|
|
1612
|
+
this.pageSizeOptions = [5, 10, 15];
|
|
1613
|
+
this.defaultPageSize = ((_a = this.pageSizeOptions) === null || _a === void 0 ? void 0 : _a[0]) || 10;
|
|
1614
|
+
this.rowActions = [];
|
|
1615
|
+
this.tableActions = [];
|
|
1616
|
+
this.tableAction = new EventEmitter();
|
|
1617
|
+
this.rowAction = new EventEmitter();
|
|
1618
|
+
this.sortEvent = new EventEmitter();
|
|
1619
|
+
this.ACTION_COLUMN_NAME = '__action__';
|
|
1620
|
+
this.isFilterEnabled = false;
|
|
1621
|
+
this.isPaginationEnabled = false;
|
|
1622
|
+
}
|
|
1623
|
+
set displayedData(data) {
|
|
1624
|
+
if (!this.dataSource) {
|
|
1625
|
+
this.dataSource = new MatTableDataSource(data);
|
|
1626
|
+
}
|
|
1627
|
+
else {
|
|
1628
|
+
this.dataSource.data = data;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
set paginationEnabled(isPaginationEnabled) {
|
|
1632
|
+
this.isPaginationEnabled = isPaginationEnabled;
|
|
1633
|
+
// eslint-disable-next-line
|
|
1634
|
+
const pageSize = this.isPaginationEnabled ? this.defaultPageSize : Number.MAX_VALUE;
|
|
1635
|
+
if (this.dataSource.paginator) {
|
|
1636
|
+
this.dataSource.paginator._changePageSize(pageSize);
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
set filterEnabled(isFilterEnabled) {
|
|
1640
|
+
this.isFilterEnabled = isFilterEnabled;
|
|
1641
|
+
this.setFilterValue(undefined);
|
|
1642
|
+
}
|
|
1643
|
+
ngOnInit() {
|
|
1644
|
+
this.columnNames = this.columns.map(column => column.label);
|
|
1645
|
+
this.isRowClickable = this.rowActions.length > 0;
|
|
1646
|
+
if (this.isRowClickable) {
|
|
1647
|
+
this.columnNames.unshift(this.ACTION_COLUMN_NAME);
|
|
1648
|
+
this.defaultAction = this.rowActions[0];
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
ngAfterViewInit() {
|
|
1652
|
+
this.dataSource.paginator = this.paginator;
|
|
1653
|
+
this.dataSource.sort = this.sort;
|
|
1654
|
+
// set custom filter predicate to enable search for multiple search strings:
|
|
1655
|
+
// e.g. "one two three"
|
|
1656
|
+
this.dataSource.filterPredicate = (data, filter) => !filter || filter.split(/\s+/).every(term => !!Object.keys(data).find(key => data[key].includes(term)));
|
|
1657
|
+
}
|
|
1658
|
+
onFilter(value) {
|
|
1659
|
+
this.setFilterValue(value);
|
|
1660
|
+
}
|
|
1661
|
+
onRowEvent(event, row, action = this.defaultAction) {
|
|
1662
|
+
if (!!action && !this.isClickOnRowMenuIcon(event)) {
|
|
1663
|
+
this.rowAction.emit(Object.assign(Object.assign({}, action), { outputRow: row }));
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
onSortingEvent(sortingParams) {
|
|
1667
|
+
this.sortEvent.emit(sortingParams);
|
|
1668
|
+
}
|
|
1669
|
+
onTableAction(tableAction) {
|
|
1670
|
+
if (!!tableAction) {
|
|
1671
|
+
this.tableAction.emit(tableAction);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
setFilterValue(value) {
|
|
1675
|
+
this.dataSource.filter = value === null || value === void 0 ? void 0 : value.trim().toLowerCase();
|
|
1676
|
+
}
|
|
1677
|
+
isClickOnRowMenuIcon(event) {
|
|
1678
|
+
var _a;
|
|
1679
|
+
return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.classList.contains('mat-icon');
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1683
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.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", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], 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$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i8$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8$1.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"] }] });
|
|
1684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableComponent, decorators: [{
|
|
1685
|
+
type: Component,
|
|
1686
|
+
args: [{ selector: 'mad-table', 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"] }]
|
|
1687
|
+
}], propDecorators: { columns: [{
|
|
1688
|
+
type: Input
|
|
1689
|
+
}], filterLabel: [{
|
|
1690
|
+
type: Input
|
|
1691
|
+
}], filterPlaceholder: [{
|
|
1692
|
+
type: Input
|
|
1693
|
+
}], noDataText: [{
|
|
1694
|
+
type: Input
|
|
1695
|
+
}], pageSizeOptions: [{
|
|
1696
|
+
type: Input
|
|
1697
|
+
}], defaultPageSize: [{
|
|
1698
|
+
type: Input
|
|
1699
|
+
}], rowActions: [{
|
|
1700
|
+
type: Input
|
|
1701
|
+
}], tableActions: [{
|
|
1702
|
+
type: Input
|
|
1703
|
+
}], tableAction: [{
|
|
1704
|
+
type: Output
|
|
1705
|
+
}], rowAction: [{
|
|
1706
|
+
type: Output
|
|
1707
|
+
}], sortEvent: [{
|
|
1708
|
+
type: Output
|
|
1709
|
+
}], paginator: [{
|
|
1710
|
+
type: ViewChild,
|
|
1711
|
+
args: [MatPaginator, { static: false }]
|
|
1712
|
+
}], sort: [{
|
|
1713
|
+
type: ViewChild,
|
|
1714
|
+
args: [MatSort, { static: true }]
|
|
1715
|
+
}], displayedData: [{
|
|
1716
|
+
type: Input
|
|
1717
|
+
}], paginationEnabled: [{
|
|
1718
|
+
type: Input
|
|
1719
|
+
}], filterEnabled: [{
|
|
1720
|
+
type: Input
|
|
1721
|
+
}] } });
|
|
1722
|
+
|
|
1723
|
+
class TableModule {
|
|
1724
|
+
}
|
|
1725
|
+
TableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1726
|
+
TableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: TableModule, declarations: [TableComponent], imports: [CommonModule,
|
|
1727
|
+
MatButtonModule,
|
|
1728
|
+
MatIconModule,
|
|
1729
|
+
MatFormFieldModule,
|
|
1730
|
+
MatInputModule,
|
|
1731
|
+
MatMenuModule,
|
|
1732
|
+
MatPaginatorModule,
|
|
1733
|
+
MatSortModule,
|
|
1734
|
+
MatTableModule,
|
|
1735
|
+
ButtonModule], exports: [TableComponent] });
|
|
1736
|
+
TableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, imports: [CommonModule,
|
|
1737
|
+
MatButtonModule,
|
|
1738
|
+
MatIconModule,
|
|
1739
|
+
MatFormFieldModule,
|
|
1740
|
+
MatInputModule,
|
|
1741
|
+
MatMenuModule,
|
|
1742
|
+
MatPaginatorModule,
|
|
1743
|
+
MatSortModule,
|
|
1744
|
+
MatTableModule,
|
|
1745
|
+
ButtonModule] });
|
|
1746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: TableModule, decorators: [{
|
|
1747
|
+
type: NgModule,
|
|
1748
|
+
args: [{
|
|
1749
|
+
declarations: [TableComponent],
|
|
1750
|
+
imports: [
|
|
1751
|
+
CommonModule,
|
|
1752
|
+
MatButtonModule,
|
|
1753
|
+
MatIconModule,
|
|
1754
|
+
MatFormFieldModule,
|
|
1755
|
+
MatInputModule,
|
|
1756
|
+
MatMenuModule,
|
|
1757
|
+
MatPaginatorModule,
|
|
1758
|
+
MatSortModule,
|
|
1759
|
+
MatTableModule,
|
|
1760
|
+
ButtonModule,
|
|
1761
|
+
],
|
|
1762
|
+
exports: [TableComponent],
|
|
1763
|
+
}]
|
|
1764
|
+
}] });
|
|
1765
|
+
|
|
1766
|
+
class DataTableColumnsModalComponent {
|
|
1767
|
+
constructor(dialogRef, data) {
|
|
1768
|
+
this.dialogRef = dialogRef;
|
|
1769
|
+
this.data = data;
|
|
1770
|
+
this.selectedColumns = [];
|
|
1771
|
+
this.availableColumns = [];
|
|
1772
|
+
this.filteredAvailableColumns = [];
|
|
1773
|
+
}
|
|
1774
|
+
ngOnInit() {
|
|
1775
|
+
this.definition = this.data.definition;
|
|
1776
|
+
for (const column of this.data.allColumns) {
|
|
1777
|
+
const columnId = column.id;
|
|
1778
|
+
const selectedColumnIds = this.definition.displayedColumns.map(col => col.id);
|
|
1779
|
+
if (selectedColumnIds.includes(columnId)) {
|
|
1780
|
+
this.selectedColumns.push(column);
|
|
1781
|
+
}
|
|
1782
|
+
else {
|
|
1783
|
+
this.availableColumns.push(column);
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
this.clearFilterValue();
|
|
1787
|
+
}
|
|
1788
|
+
onDrop(event) {
|
|
1789
|
+
if (event.previousContainer === event.container) {
|
|
1790
|
+
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
1791
|
+
}
|
|
1792
|
+
else {
|
|
1793
|
+
const itemIndex = this.findMatchingItemIndex(event.previousContainer, event.item);
|
|
1794
|
+
transferArrayItem(event.previousContainer.data, event.container.data, itemIndex, event.currentIndex);
|
|
1795
|
+
this.clearFilterValue();
|
|
1796
|
+
this.availableColumns.sort((a, b) => a.label.localeCompare(b.label));
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
onSave() {
|
|
1800
|
+
this.definition.displayedColumns = this.selectedColumns;
|
|
1801
|
+
const saveChange = {
|
|
1802
|
+
action: 'SAVE',
|
|
1803
|
+
definition: this.definition,
|
|
1804
|
+
};
|
|
1805
|
+
this.dialogRef.close(saveChange);
|
|
1806
|
+
}
|
|
1807
|
+
onDelete() {
|
|
1808
|
+
const deleteChange = {
|
|
1809
|
+
action: 'DELETE',
|
|
1810
|
+
definition: this.definition,
|
|
1811
|
+
};
|
|
1812
|
+
this.dialogRef.close(deleteChange);
|
|
1813
|
+
}
|
|
1814
|
+
onCancel() {
|
|
1815
|
+
this.dialogRef.close();
|
|
1816
|
+
}
|
|
1817
|
+
updateFilterValue() {
|
|
1818
|
+
var _a;
|
|
1819
|
+
if (((_a = this.searchFilter) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1820
|
+
this.filteredAvailableColumns = this.availableColumns.filter(c => c.label.toLowerCase().includes(this.searchFilter.toLowerCase()));
|
|
1821
|
+
}
|
|
1822
|
+
else {
|
|
1823
|
+
this.filteredAvailableColumns = [...this.availableColumns];
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
findMatchingItemIndex(previousContainer, item) {
|
|
1827
|
+
const itemId = item.element.nativeElement.id;
|
|
1828
|
+
const previousContainerItems = [...previousContainer.data];
|
|
1829
|
+
if ((previousContainerItems === null || previousContainerItems === void 0 ? void 0 : previousContainerItems.length) < 1) {
|
|
1830
|
+
return 0;
|
|
1831
|
+
}
|
|
1832
|
+
for (let itemIndex = 0; itemIndex < previousContainerItems.length; itemIndex++) {
|
|
1833
|
+
if (previousContainerItems[itemIndex].id === itemId) {
|
|
1834
|
+
return itemIndex;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
return 0;
|
|
1838
|
+
}
|
|
1839
|
+
clearFilterValue() {
|
|
1840
|
+
this.searchFilter = '';
|
|
1841
|
+
this.filteredAvailableColumns = [...this.availableColumns];
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
DataTableColumnsModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableColumnsModalComponent, deps: [{ token: i1$4.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1845
|
+
DataTableColumnsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: DataTableColumnsModalComponent, 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 <div class=\"column-drag-box\"\n *ngFor=\"let selectedColumn of selectedColumns; let i = index\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\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 matInput autocomplete=\"off\" (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data?.filterColumnsPlaceHolder | translate }}\" [(ngModel)]=\"searchFilter\"/>\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 <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\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)\">\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: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix]" }, { 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: PrimaryButtonComponent, selector: "mad-primary-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: DangerButtonComponent, selector: "mad-danger-button", inputs: ["type", "disabled", "title"] }, { kind: "directive", type: i10.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: i10.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: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
1846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableColumnsModalComponent, decorators: [{
|
|
1847
|
+
type: Component,
|
|
1848
|
+
args: [{ selector: 'mad-data-table-columns-modal.component', 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 <div class=\"column-drag-box\"\n *ngFor=\"let selectedColumn of selectedColumns; let i = index\"\n cdkDrag\n [id]=\"selectedColumn.id\"\n >\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 matInput autocomplete=\"off\" (keyup)=\"updateFilterValue()\"\n placeholder=\"{{ data?.filterColumnsPlaceHolder | translate }}\" [(ngModel)]=\"searchFilter\"/>\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 <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\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)\">\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"] }]
|
|
1849
|
+
}], ctorParameters: function () {
|
|
1850
|
+
return [{ type: i1$4.MatDialogRef }, { type: undefined, decorators: [{
|
|
1851
|
+
type: Inject,
|
|
1852
|
+
args: [MAT_DIALOG_DATA]
|
|
1853
|
+
}] }];
|
|
1854
|
+
} });
|
|
1855
|
+
|
|
1856
|
+
class DataTableActionType {
|
|
1857
|
+
}
|
|
1858
|
+
DataTableActionType.SINGLE = 'SINGLE';
|
|
1859
|
+
DataTableActionType.BATCH = 'BATCH';
|
|
1860
|
+
DataTableActionType.NONE = 'NONE';
|
|
1861
|
+
|
|
1862
|
+
class DataTableComponent {
|
|
1863
|
+
constructor(matDialog) {
|
|
1864
|
+
this.matDialog = matDialog;
|
|
1865
|
+
// Translations
|
|
1866
|
+
this.filterLabel = 'Filter';
|
|
1867
|
+
this.filterPlaceholder = '';
|
|
1868
|
+
this.filterColumnsLabel = 'Filter';
|
|
1869
|
+
this.filterColumnsPlaceHolder = 'Filter available columns';
|
|
1870
|
+
this.noDataText = 'No matching data found';
|
|
1871
|
+
this.columnSettingsModalTitleLabel = 'Column settings';
|
|
1872
|
+
this.selectedLabel = 'Selected columns';
|
|
1873
|
+
this.availableLabel = 'Available columns';
|
|
1874
|
+
this.saveLabel = 'Save';
|
|
1875
|
+
this.deleteLabel = 'Delete';
|
|
1876
|
+
this.cancelLabel = 'Cancel';
|
|
1877
|
+
this.infoTextLabel = 'Drag and drop a column to select or reorder it.';
|
|
1878
|
+
this.pageSizeOptions = [5, 10, 15];
|
|
1879
|
+
this.actions = [];
|
|
1880
|
+
this.deleteDefinitionAllowed = false;
|
|
1881
|
+
this.useAsync = false;
|
|
1882
|
+
this.sortEvent = new EventEmitter();
|
|
1883
|
+
this.actionEvent = new EventEmitter();
|
|
1884
|
+
this.pageEvent = new EventEmitter();
|
|
1885
|
+
this.allColumnsEvent = new EventEmitter();
|
|
1886
|
+
this.columnDefinitionChangeEvent = new EventEmitter();
|
|
1887
|
+
this.viewDefinitionChangeEvent = new EventEmitter();
|
|
1888
|
+
this.ACTION_COLUMN_NAME = '__action__';
|
|
1889
|
+
this.SINGLE = DataTableActionType.SINGLE;
|
|
1890
|
+
this.BATCH = DataTableActionType.BATCH;
|
|
1891
|
+
this.NONE = DataTableActionType.NONE;
|
|
1892
|
+
this.tableActions = [];
|
|
1893
|
+
this.rowActions = [];
|
|
1894
|
+
this.columns = [];
|
|
1895
|
+
this.allSelected = false;
|
|
1896
|
+
this.displayedDataMap = new Map();
|
|
1897
|
+
this.actualDataMap = new Map();
|
|
1898
|
+
this.selectionModel = new SelectionModel(true);
|
|
1899
|
+
this.allColumnDefinitions = [];
|
|
1900
|
+
this.isFilterEnabled = false;
|
|
1901
|
+
this.isPaginationEnabled = false;
|
|
1902
|
+
this.mode = this.NONE;
|
|
1903
|
+
this.isRowClickable = false;
|
|
1904
|
+
this.showColumnModal = false;
|
|
1905
|
+
this.isLoading = false;
|
|
1906
|
+
this.paginatorLength = 0;
|
|
1907
|
+
this.paginatorPageIndex = 0;
|
|
1908
|
+
this.paginatorPageSize = 50;
|
|
1909
|
+
}
|
|
1910
|
+
set displayedColumns(cols) {
|
|
1911
|
+
if (!this.displayedColumnDefinition) {
|
|
1912
|
+
this.columns = cols ? [...cols] : [];
|
|
1913
|
+
this.columnIds = this.columns.map(column => column.id);
|
|
1914
|
+
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
set displayedColumnDefinition(def) {
|
|
1918
|
+
this.selectedColumnDefinion = def;
|
|
1919
|
+
this.columns = def.displayedColumns;
|
|
1920
|
+
this.columnIds = this.columns.map(column => column.id);
|
|
1921
|
+
this.columnIds.unshift(this.ACTION_COLUMN_NAME);
|
|
1922
|
+
}
|
|
1923
|
+
set tableData(data) {
|
|
1924
|
+
if (!this.dataSource) {
|
|
1925
|
+
this.dataSource = new MatTableDataSource(data);
|
|
1926
|
+
}
|
|
1927
|
+
this.createDataMapsAndSetDisplayedDataSourceData(data);
|
|
1928
|
+
}
|
|
1929
|
+
set page(page) {
|
|
1930
|
+
this.paginatorPageIndex = page.pageIndex;
|
|
1931
|
+
this.paginatorPageSize = page.pageSize;
|
|
1932
|
+
this.paginatorLength = page.length;
|
|
1933
|
+
}
|
|
1934
|
+
set columnDefinitions(definitions) {
|
|
1935
|
+
var _a;
|
|
1936
|
+
this.editableColumnDefinitions = [];
|
|
1937
|
+
this.viewableColumnDefinitions = [];
|
|
1938
|
+
this.allColumnDefinitions = [...definitions];
|
|
1939
|
+
for (const definition of definitions) {
|
|
1940
|
+
if (definition.editable) {
|
|
1941
|
+
this.editableColumnDefinitions.push(definition);
|
|
1942
|
+
}
|
|
1943
|
+
if (((_a = definition.displayedColumns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1944
|
+
this.viewableColumnDefinitions.push(definition);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
set loading(isLoading) {
|
|
1949
|
+
this.isLoading = isLoading;
|
|
1950
|
+
}
|
|
1951
|
+
set defaultPageSize(defaultSize) {
|
|
1952
|
+
this.paginatorPageSize = defaultSize;
|
|
1953
|
+
}
|
|
1954
|
+
set externalPaginator(paginator) {
|
|
1955
|
+
this.extPaginator = paginator;
|
|
1956
|
+
}
|
|
1957
|
+
set paginationEnabled(isPaginationEnabled) {
|
|
1958
|
+
this.isPaginationEnabled = isPaginationEnabled;
|
|
1959
|
+
this.unsetPageSizeIfNecessary();
|
|
1960
|
+
}
|
|
1961
|
+
set allColumns(allColumns) {
|
|
1962
|
+
this.allAvailableColumns = allColumns;
|
|
1963
|
+
if (allColumns && this.showColumnModal) {
|
|
1964
|
+
this.openColumnModal();
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
set filterEnabled(isFilterEnabled) {
|
|
1968
|
+
this.isFilterEnabled = !this.useAsync ? isFilterEnabled : false;
|
|
1969
|
+
this.setFilterValue(undefined);
|
|
1970
|
+
}
|
|
1971
|
+
set forceMode(mode) {
|
|
1972
|
+
if (mode === this.SINGLE || mode === this.BATCH || mode === this.NONE) {
|
|
1973
|
+
this._forceMode = mode;
|
|
1974
|
+
this.mode = mode;
|
|
1975
|
+
this.setActions();
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
static compare(a, b, sort) {
|
|
1979
|
+
const x = a[sort.active];
|
|
1980
|
+
const y = b[sort.active];
|
|
1981
|
+
const ascending = sort.direction === 'asc';
|
|
1982
|
+
switch (typeof x) {
|
|
1983
|
+
case 'number':
|
|
1984
|
+
return DataTableComponent.compareNumber(x, y, ascending);
|
|
1985
|
+
case 'string':
|
|
1986
|
+
return DataTableComponent.compareString(x, y, ascending);
|
|
1987
|
+
case 'boolean':
|
|
1988
|
+
return DataTableComponent.compareBoolean(x, y, ascending);
|
|
1989
|
+
default:
|
|
1990
|
+
// cannot compare -> return equal
|
|
1991
|
+
return 0;
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
static compareNumber(x, y, ascending) {
|
|
1995
|
+
return ascending ? x - y : y - x;
|
|
1996
|
+
}
|
|
1997
|
+
static compareString(x, y, ascending) {
|
|
1998
|
+
return ascending ? x.localeCompare(y) : y.localeCompare(x);
|
|
1999
|
+
}
|
|
2000
|
+
static compareBoolean(x, y, ascending) {
|
|
2001
|
+
if (x === y) {
|
|
2002
|
+
return 0;
|
|
2003
|
+
}
|
|
2004
|
+
if (ascending) {
|
|
2005
|
+
// true first
|
|
2006
|
+
return x ? -1 : 1;
|
|
2007
|
+
}
|
|
2008
|
+
else {
|
|
2009
|
+
// false first
|
|
2010
|
+
return x ? 1 : -1;
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
static transformData(value, transformer, transformerParams) {
|
|
2014
|
+
if (!transformer || !(transformer instanceof Function)) {
|
|
2015
|
+
return value;
|
|
2016
|
+
}
|
|
2017
|
+
return transformer(value, transformerParams);
|
|
2018
|
+
}
|
|
2019
|
+
static generateRowId() {
|
|
2020
|
+
return v4();
|
|
2021
|
+
}
|
|
2022
|
+
static isClickOnRowMenuIcon(event) {
|
|
2023
|
+
var _a;
|
|
2024
|
+
return (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.classList.contains('mat-icon');
|
|
2025
|
+
}
|
|
2026
|
+
ngOnInit() {
|
|
2027
|
+
this.mode = this.getTableMode();
|
|
2028
|
+
this.setActions();
|
|
2029
|
+
if (this.mode !== this.NONE) {
|
|
2030
|
+
this.isRowClickable = true;
|
|
2031
|
+
this.defaultAction = this.rowActions[0];
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
ngAfterViewInit() {
|
|
2035
|
+
this.dataSource.paginator = this.paginator;
|
|
2036
|
+
this.dataSource.sort = this.sort;
|
|
2037
|
+
}
|
|
2038
|
+
onColumnSettings(definition) {
|
|
2039
|
+
this.showColumnModal = true;
|
|
2040
|
+
this.selectedDefinition = definition ? definition : this.allColumnDefinitions[0];
|
|
2041
|
+
if (this.allAvailableColumns) {
|
|
2042
|
+
this.openColumnModal();
|
|
2043
|
+
}
|
|
2044
|
+
else {
|
|
2045
|
+
// if no complete definitions have been loaded yet send an event so the app can load it
|
|
2046
|
+
this.allColumnsEvent.emit();
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
onViewDefinition(definition) {
|
|
2050
|
+
this.selectedDefinition = definition;
|
|
2051
|
+
this.viewDefinitionChangeEvent.emit(definition);
|
|
2052
|
+
}
|
|
2053
|
+
isCurrentDefinition(definition) {
|
|
2054
|
+
return this.selectedDefinition && this.selectedDefinition.id === definition.id;
|
|
2055
|
+
}
|
|
2056
|
+
get selectedCount() {
|
|
2057
|
+
var _a;
|
|
2058
|
+
return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.selected) ? this.selectionModel.selected.length : 0;
|
|
2059
|
+
}
|
|
2060
|
+
get rowCount() {
|
|
2061
|
+
return this.getAllDataSourceRowsOfCurrentPage() ? this.getAllDataSourceRowsOfCurrentPage().length : 0;
|
|
2062
|
+
}
|
|
2063
|
+
getAllDataSourceRowsOfCurrentPage() {
|
|
2064
|
+
var _a;
|
|
2065
|
+
return (_a = this.dataSource) === null || _a === void 0 ? void 0 : _a._pageData(this.dataSource.data);
|
|
2066
|
+
}
|
|
2067
|
+
getSelectedCount(actionType) {
|
|
2068
|
+
const count = this.selectedCount;
|
|
2069
|
+
if (actionType !== this.BATCH || count < 2) {
|
|
2070
|
+
return '';
|
|
2071
|
+
}
|
|
2072
|
+
return ' (' + count + ')';
|
|
2073
|
+
}
|
|
2074
|
+
isDisabled(actionType) {
|
|
2075
|
+
switch (actionType) {
|
|
2076
|
+
case this.SINGLE:
|
|
2077
|
+
return this.selectedCount !== 1;
|
|
2078
|
+
case this.BATCH:
|
|
2079
|
+
return this.selectedCount < 1;
|
|
2080
|
+
default:
|
|
2081
|
+
return false;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
onToggleSelectAll() {
|
|
2085
|
+
// clear all selection first
|
|
2086
|
+
this.selectionModel.clear();
|
|
2087
|
+
// toggle all checkbox
|
|
2088
|
+
this.allSelected = !this.allSelected;
|
|
2089
|
+
if (this.allSelected) {
|
|
2090
|
+
// select all rows of the current page
|
|
2091
|
+
this.getAllDataSourceRowsOfCurrentPage().forEach(row => {
|
|
2092
|
+
this.selectionModel.select('' + row.rowId);
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
isSelected(rowId) {
|
|
2097
|
+
return this.selectionModel.isSelected(rowId);
|
|
2098
|
+
}
|
|
2099
|
+
setFilterValue(value) {
|
|
2100
|
+
this.dataSource.filter = value === null || value === void 0 ? void 0 : value.trim().toLowerCase();
|
|
2101
|
+
}
|
|
2102
|
+
onRowCheckbox(event, row) {
|
|
2103
|
+
event.stopPropagation(); // no click event on row
|
|
2104
|
+
this.selectionModel.toggle(row.rowId);
|
|
2105
|
+
}
|
|
2106
|
+
onRowEvent(event, row, action = this.defaultAction) {
|
|
2107
|
+
switch (this.mode) {
|
|
2108
|
+
case this.BATCH:
|
|
2109
|
+
this.onRowCheckbox(event, row);
|
|
2110
|
+
break;
|
|
2111
|
+
case this.SINGLE:
|
|
2112
|
+
// emit the default action if the row (not the icon!) was clicked
|
|
2113
|
+
if (!!action && !DataTableComponent.isClickOnRowMenuIcon(event)) {
|
|
2114
|
+
const selected = [];
|
|
2115
|
+
// if ID-generator is provided, return the ID, else return the ACTUAL data
|
|
2116
|
+
selected.push(this.idGenerator ? row.rowId : this.actualDataMap.get(row.rowId));
|
|
2117
|
+
this.emitTableAction(action, selected);
|
|
2118
|
+
}
|
|
2119
|
+
break;
|
|
2120
|
+
default:
|
|
2121
|
+
// do nothing if mode is NONE (or null)
|
|
2122
|
+
return;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
onSortingEvent(sort) {
|
|
2126
|
+
if (this.useAsync) {
|
|
2127
|
+
this.sortEvent.emit(sort);
|
|
2128
|
+
}
|
|
2129
|
+
else {
|
|
2130
|
+
this.internalSort(sort);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
onPageEvent(event) {
|
|
2134
|
+
if (this.useAsync) {
|
|
2135
|
+
this.pageEvent.emit(event);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
onTableAction(tableAction) {
|
|
2139
|
+
if (!!tableAction) {
|
|
2140
|
+
const selection = [];
|
|
2141
|
+
for (const selected of this.selectionModel.selected) {
|
|
2142
|
+
selection.push(this.idGenerator ? selected : this.actualDataMap.get(selected));
|
|
2143
|
+
}
|
|
2144
|
+
tableAction.selected = selection;
|
|
2145
|
+
this.actionEvent.emit(tableAction);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
emitTableAction(action, selected) {
|
|
2149
|
+
const emitAction = Object.assign({}, action);
|
|
2150
|
+
if (action.type !== this.NONE) {
|
|
2151
|
+
emitAction.selected = [...selected];
|
|
2152
|
+
}
|
|
2153
|
+
this.actionEvent.emit(emitAction);
|
|
2154
|
+
}
|
|
2155
|
+
generateDisplayedDataElement(rowId, actualDataElement) {
|
|
2156
|
+
const displayedDataElement = {};
|
|
2157
|
+
displayedDataElement.rowId = rowId;
|
|
2158
|
+
for (const column of this.columns) {
|
|
2159
|
+
const actualValue = actualDataElement[column.dataPropertyName];
|
|
2160
|
+
displayedDataElement[column.dataPropertyName] = DataTableComponent.transformData(actualValue, column.transformer, column.transformerParams);
|
|
2161
|
+
}
|
|
2162
|
+
return displayedDataElement;
|
|
2163
|
+
}
|
|
2164
|
+
internalSort(sort) {
|
|
2165
|
+
const sortedData = [...this.dataSource.data].sort((a, b) => DataTableComponent.compare(a, b, sort));
|
|
2166
|
+
this.dataSource.data = [...sortedData];
|
|
2167
|
+
}
|
|
2168
|
+
setActions() {
|
|
2169
|
+
this.rowActions = [];
|
|
2170
|
+
this.tableActions = [];
|
|
2171
|
+
for (const action of this.actions) {
|
|
2172
|
+
if (this.mode !== action.hiddenInMode) {
|
|
2173
|
+
switch (action.type) {
|
|
2174
|
+
case this.SINGLE:
|
|
2175
|
+
if (this.mode === this.SINGLE) {
|
|
2176
|
+
this.rowActions.push(action);
|
|
2177
|
+
}
|
|
2178
|
+
else {
|
|
2179
|
+
this.tableActions.push(action);
|
|
2180
|
+
}
|
|
2181
|
+
break;
|
|
2182
|
+
case this.BATCH:
|
|
2183
|
+
if (this.mode !== this.SINGLE) {
|
|
2184
|
+
this.tableActions.push(action);
|
|
2185
|
+
}
|
|
2186
|
+
break;
|
|
2187
|
+
default:
|
|
2188
|
+
this.tableActions.push(action);
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
createDataMapsAndSetDisplayedDataSourceData(data) {
|
|
2194
|
+
const displayedDataList = [];
|
|
2195
|
+
this.actualDataMap.clear();
|
|
2196
|
+
this.displayedDataMap.clear();
|
|
2197
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
|
2198
|
+
for (const dataEntry of data) {
|
|
2199
|
+
const rowId = this.idGenerator ? this.idGenerator(dataEntry) : DataTableComponent.generateRowId();
|
|
2200
|
+
this.actualDataMap.set(rowId, dataEntry);
|
|
2201
|
+
const displayedDataElement = this.generateDisplayedDataElement(rowId, dataEntry);
|
|
2202
|
+
this.displayedDataMap.set(rowId, displayedDataElement);
|
|
2203
|
+
displayedDataList.push(displayedDataElement);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
this.dataSource.data = displayedDataList;
|
|
2207
|
+
this.unsetPageSizeIfNecessary();
|
|
2208
|
+
}
|
|
2209
|
+
openColumnModal() {
|
|
2210
|
+
const dialogData = {
|
|
2211
|
+
allColumns: this.allAvailableColumns,
|
|
2212
|
+
definition: this.selectedDefinition,
|
|
2213
|
+
deleteDefinitionAllowed: this.deleteDefinitionAllowed,
|
|
2214
|
+
filterColumnsLabel: this.filterColumnsLabel,
|
|
2215
|
+
filterColumnsPlaceHolder: this.filterColumnsPlaceHolder,
|
|
2216
|
+
noDataText: this.noDataText,
|
|
2217
|
+
titleLabel: this.columnSettingsModalTitleLabel,
|
|
2218
|
+
selectedLabel: this.selectedLabel,
|
|
2219
|
+
availableLabel: this.availableLabel,
|
|
2220
|
+
saveLabel: this.saveLabel,
|
|
2221
|
+
deleteLabel: this.deleteLabel,
|
|
2222
|
+
cancelLabel: this.cancelLabel,
|
|
2223
|
+
infoTextLabel: this.infoTextLabel,
|
|
2224
|
+
};
|
|
2225
|
+
const dialog = this.matDialog.open(DataTableColumnsModalComponent, { data: dialogData });
|
|
2226
|
+
dialog.afterClosed().subscribe(result => {
|
|
2227
|
+
// no event on CANCEL
|
|
2228
|
+
if (result) {
|
|
2229
|
+
this.columnDefinitionChangeEvent.emit(result);
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
getTableMode() {
|
|
2234
|
+
if (this._forceMode) {
|
|
2235
|
+
return this._forceMode;
|
|
2236
|
+
}
|
|
2237
|
+
if (!this.actions) {
|
|
2238
|
+
return this.NONE;
|
|
2239
|
+
}
|
|
2240
|
+
const distinctActionTypes = new Set();
|
|
2241
|
+
for (const rowAction of this.actions) {
|
|
2242
|
+
distinctActionTypes.add(rowAction.type);
|
|
2243
|
+
}
|
|
2244
|
+
if (distinctActionTypes.has(this.BATCH)) {
|
|
2245
|
+
return this.BATCH;
|
|
2246
|
+
}
|
|
2247
|
+
if (distinctActionTypes.has(this.SINGLE)) {
|
|
2248
|
+
return this.SINGLE;
|
|
2249
|
+
}
|
|
2250
|
+
return this.NONE;
|
|
2251
|
+
}
|
|
2252
|
+
unsetPageSizeIfNecessary() {
|
|
2253
|
+
if (!this.useAsync && !this.isPaginationEnabled) {
|
|
2254
|
+
const dataCount = this.dataSource.data ? this.dataSource.data.length : 0;
|
|
2255
|
+
this.paginatorPageSize = dataCount;
|
|
2256
|
+
this.paginatorLength = dataCount;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
DataTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableComponent, deps: [{ token: i1$4.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
2261
|
+
DataTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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", deleteDefinitionAllowed: "deleteDefinitionAllowed", useAsync: "useAsync", 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 {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\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\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *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 {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *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 {{ definition.label | translate }}\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 class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\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 {{ column.label | translate }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label | translate }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnIds\"\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\n *ngIf=\"this.editableColumnDefinitions?.length == 1\"\n (click)=\"onColumnSettings()\"\n >\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\"\n >\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\"\n >\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-button{width:10px}.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:16px}.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-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.active-column-definition{color:#000;background-color:#f5f5f5}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.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", exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i6.MatMenuContent, selector: "ng-template[matMenuContent]" }, { kind: "component", type: i6$1.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], 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$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i8$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i10$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: OutlineButtonComponent, selector: "mad-outline-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: IconButtonComponent, selector: "mad-icon-button", inputs: ["type", "disabled", "title"] }, { kind: "component", type: i13.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
|
|
2262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableComponent, decorators: [{
|
|
2263
|
+
type: Component,
|
|
2264
|
+
args: [{ selector: 'mad-data-table', 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 {{ tableAction.label | translate }} {{ getSelectedCount(tableAction.type) }}\n </mad-outline-button>\n </div>\n <!-- Table filter -->\n <mat-form-field *ngIf=\"isFilterEnabled\">\n <mat-label>{{ filterLabel | translate }}</mat-label>\n <input matInput autocomplete=\"off\" (keyup)=\"setFilterValue($event?.target?.value)\"\n placeholder=\"{{ filterPlaceholder }}\" />\n </mat-form-field>\n</div>\n\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\"\n (click)=\"onRowEvent($event, element, rowAction)\">\n {{ rowAction.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- editable definition menu -->\n<mat-menu #editableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *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 {{ definition.label | translate }}\n </button>\n </ng-template>\n</mat-menu>\n\n<!-- viewable definition menu -->\n<mat-menu #viewableDefinitionMenu=\"matMenu\">\n <ng-template matMenuContent>\n <button *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 {{ definition.label | translate }}\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 class=\"row-action-button\">\n <!-- BATCH: master checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (change)=\"onToggleSelectAll()\"\n [checked]=\"allSelected\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE / NONE: nothing in header row -->\n </th>\n <td mat-cell *matCellDef=\"let element\" class=\"row-action-button\">\n <!-- BATCH: row checkbox -->\n <div *ngIf=\"mode === BATCH\" class=\"mad-datatable-checkbox-container\">\n <mat-checkbox\n (click)=\"onRowCheckbox($event, element.rowId)\"\n [checked]=\"isSelected(element.rowId)\"\n >\n </mat-checkbox>\n </div>\n <!-- SINGLE: row action menu icon -->\n <mad-icon-button\n *ngIf=\"mode === SINGLE\"\n [matMenuTriggerData]=\"{ element: element }\" [matMenuTriggerFor]=\"rowActionMenu\"\n >\n <mat-icon>more_vert</mat-icon>\n </mad-icon-button>\n <!-- NONE: nothing -->\n </td>\n </ng-container>\n <!-- Columns with data -->\n <ng-container *ngFor=\"let column of columns\" [matColumnDef]=\"column.id\">\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 {{ column.label | translate }}\n </th>\n </ng-container>\n <ng-template #noSort>\n <th scope=\"col\" mat-header-cell *matHeaderCellDef [class.text-right]=\"column.isRightAligned\">\n {{ column.label | translate }}\n </th>\n </ng-template>\n <td mat-cell *matCellDef=\"let element\" [class.text-right]=\"column.isRightAligned\" [ngSwitch]=\"column.transformer\">\n <span>\n {{ element[column.dataPropertyName] }}\n </span>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"columnIds\"></tr>\n <tr\n mat-row\n [class.clickable-table-row]=\"isRowClickable\"\n (click)=\"onRowEvent($event, row)\"\n *matRowDef=\"let row; columns: columnIds\"\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\n *ngIf=\"this.editableColumnDefinitions?.length == 1\"\n (click)=\"onColumnSettings()\"\n >\n <mat-icon class=\"material-icons-outlined\">view_column</mat-icon>\n </mad-icon-button>\n <!-- column settings: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.editableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"editableDefinitionMenu\"\n >\n <mat-icon>view_column</mat-icon>\n </mad-icon-button>\n <!-- column view: multiple definitions -->\n <mad-icon-button\n *ngIf=\"this.viewableColumnDefinitions?.length > 0\" [matMenuTriggerFor]=\"viewableDefinitionMenu\"\n >\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-button{width:10px}.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:16px}.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-header-row th{position:sticky;top:0;background-color:#fff;z-index:1}.active-column-definition{color:#000;background-color:#f5f5f5}\n"] }]
|
|
2265
|
+
}], ctorParameters: function () { return [{ type: i1$4.MatDialog }]; }, propDecorators: { filterLabel: [{
|
|
2266
|
+
type: Input
|
|
2267
|
+
}], filterPlaceholder: [{
|
|
2268
|
+
type: Input
|
|
2269
|
+
}], filterColumnsLabel: [{
|
|
2270
|
+
type: Input
|
|
2271
|
+
}], filterColumnsPlaceHolder: [{
|
|
2272
|
+
type: Input
|
|
2273
|
+
}], noDataText: [{
|
|
2274
|
+
type: Input
|
|
2275
|
+
}], columnSettingsModalTitleLabel: [{
|
|
2276
|
+
type: Input
|
|
2277
|
+
}], selectedLabel: [{
|
|
2278
|
+
type: Input
|
|
2279
|
+
}], availableLabel: [{
|
|
2280
|
+
type: Input
|
|
2281
|
+
}], saveLabel: [{
|
|
2282
|
+
type: Input
|
|
2283
|
+
}], deleteLabel: [{
|
|
2284
|
+
type: Input
|
|
2285
|
+
}], cancelLabel: [{
|
|
2286
|
+
type: Input
|
|
2287
|
+
}], infoTextLabel: [{
|
|
2288
|
+
type: Input
|
|
2289
|
+
}], tableClass: [{
|
|
2290
|
+
type: Input
|
|
2291
|
+
}], pageSizeOptions: [{
|
|
2292
|
+
type: Input
|
|
2293
|
+
}], externalFilter: [{
|
|
2294
|
+
type: Input
|
|
2295
|
+
}], actions: [{
|
|
2296
|
+
type: Input
|
|
2297
|
+
}], idGenerator: [{
|
|
2298
|
+
type: Input
|
|
2299
|
+
}], deleteDefinitionAllowed: [{
|
|
2300
|
+
type: Input
|
|
2301
|
+
}], useAsync: [{
|
|
2302
|
+
type: Input
|
|
2303
|
+
}], displayedColumns: [{
|
|
2304
|
+
type: Input
|
|
2305
|
+
}], displayedColumnDefinition: [{
|
|
2306
|
+
type: Input
|
|
2307
|
+
}], tableData: [{
|
|
2308
|
+
type: Input
|
|
2309
|
+
}], page: [{
|
|
2310
|
+
type: Input
|
|
2311
|
+
}], columnDefinitions: [{
|
|
2312
|
+
type: Input
|
|
2313
|
+
}], loading: [{
|
|
2314
|
+
type: Input
|
|
2315
|
+
}], defaultPageSize: [{
|
|
2316
|
+
type: Input
|
|
2317
|
+
}], externalPaginator: [{
|
|
2318
|
+
type: Input
|
|
2319
|
+
}], paginationEnabled: [{
|
|
2320
|
+
type: Input
|
|
2321
|
+
}], allColumns: [{
|
|
2322
|
+
type: Input
|
|
2323
|
+
}], filterEnabled: [{
|
|
2324
|
+
type: Input
|
|
2325
|
+
}], forceMode: [{
|
|
2326
|
+
type: Input
|
|
2327
|
+
}], sortEvent: [{
|
|
2328
|
+
type: Output
|
|
2329
|
+
}], actionEvent: [{
|
|
2330
|
+
type: Output
|
|
2331
|
+
}], pageEvent: [{
|
|
2332
|
+
type: Output
|
|
2333
|
+
}], allColumnsEvent: [{
|
|
2334
|
+
type: Output
|
|
2335
|
+
}], columnDefinitionChangeEvent: [{
|
|
2336
|
+
type: Output
|
|
2337
|
+
}], viewDefinitionChangeEvent: [{
|
|
2338
|
+
type: Output
|
|
2339
|
+
}], paginator: [{
|
|
2340
|
+
type: ViewChild,
|
|
2341
|
+
args: [MatPaginator, { static: false }]
|
|
2342
|
+
}], sort: [{
|
|
2343
|
+
type: ViewChild,
|
|
2344
|
+
args: [MatSort, { static: true }]
|
|
2345
|
+
}] } });
|
|
2346
|
+
|
|
2347
|
+
class DataTableModule {
|
|
2348
|
+
}
|
|
2349
|
+
DataTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2350
|
+
DataTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, declarations: [DataTableComponent, DataTableColumnsModalComponent], imports: [CommonModule,
|
|
2351
|
+
MatButtonModule,
|
|
2352
|
+
MatIconModule,
|
|
2353
|
+
MatFormFieldModule,
|
|
2354
|
+
MatInputModule,
|
|
2355
|
+
MatMenuModule,
|
|
2356
|
+
MatPaginatorModule,
|
|
2357
|
+
MatSortModule,
|
|
2358
|
+
MatTableModule,
|
|
2359
|
+
MatProgressSpinnerModule,
|
|
2360
|
+
ButtonModule,
|
|
2361
|
+
TranslateModule,
|
|
2362
|
+
MatCheckboxModule,
|
|
2363
|
+
MatBadgeModule,
|
|
2364
|
+
DragDropModule,
|
|
2365
|
+
FormsModule], exports: [DataTableComponent, DataTableColumnsModalComponent] });
|
|
2366
|
+
DataTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, imports: [CommonModule,
|
|
2367
|
+
MatButtonModule,
|
|
2368
|
+
MatIconModule,
|
|
2369
|
+
MatFormFieldModule,
|
|
2370
|
+
MatInputModule,
|
|
2371
|
+
MatMenuModule,
|
|
2372
|
+
MatPaginatorModule,
|
|
2373
|
+
MatSortModule,
|
|
2374
|
+
MatTableModule,
|
|
2375
|
+
MatProgressSpinnerModule,
|
|
2376
|
+
ButtonModule,
|
|
2377
|
+
TranslateModule,
|
|
2378
|
+
MatCheckboxModule,
|
|
2379
|
+
MatBadgeModule,
|
|
2380
|
+
DragDropModule,
|
|
2381
|
+
FormsModule] });
|
|
2382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: DataTableModule, decorators: [{
|
|
2383
|
+
type: NgModule,
|
|
2384
|
+
args: [{
|
|
2385
|
+
declarations: [DataTableComponent, DataTableColumnsModalComponent],
|
|
2386
|
+
imports: [
|
|
2387
|
+
CommonModule,
|
|
2388
|
+
MatButtonModule,
|
|
2389
|
+
MatIconModule,
|
|
2390
|
+
MatFormFieldModule,
|
|
2391
|
+
MatInputModule,
|
|
2392
|
+
MatMenuModule,
|
|
2393
|
+
MatPaginatorModule,
|
|
2394
|
+
MatSortModule,
|
|
2395
|
+
MatTableModule,
|
|
2396
|
+
MatProgressSpinnerModule,
|
|
2397
|
+
ButtonModule,
|
|
2398
|
+
TranslateModule,
|
|
2399
|
+
MatCheckboxModule,
|
|
2400
|
+
MatBadgeModule,
|
|
2401
|
+
DragDropModule,
|
|
2402
|
+
FormsModule,
|
|
2403
|
+
],
|
|
2404
|
+
exports: [DataTableComponent, DataTableColumnsModalComponent],
|
|
2405
|
+
}]
|
|
2406
|
+
}] });
|
|
2407
|
+
|
|
2408
|
+
class StepHeaderComponent extends CdkStepHeader {
|
|
2409
|
+
constructor(_focusMonitor, _elementRef) {
|
|
2410
|
+
super(_elementRef);
|
|
2411
|
+
this._focusMonitor = _focusMonitor;
|
|
2412
|
+
}
|
|
2413
|
+
ngAfterViewInit() {
|
|
2414
|
+
this._focusMonitor.monitor(this._elementRef, true);
|
|
2415
|
+
}
|
|
2416
|
+
ngOnDestroy() {
|
|
2417
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
2418
|
+
}
|
|
2419
|
+
/** Focuses the step header. */
|
|
2420
|
+
focus(origin, options) {
|
|
2421
|
+
if (origin) {
|
|
2422
|
+
this._focusMonitor.focusVia(this._elementRef, origin, options);
|
|
2423
|
+
}
|
|
2424
|
+
else {
|
|
2425
|
+
this._elementRef.nativeElement.focus(options);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
getCssForState() {
|
|
2429
|
+
if (this.state === STEP_STATE.NUMBER && !this.completed && !this.hasError) {
|
|
2430
|
+
return 'step-state-neutral'; //initiale state is 'number'
|
|
2431
|
+
}
|
|
2432
|
+
else if (this.completed) {
|
|
2433
|
+
return 'step-state-complete';
|
|
2434
|
+
}
|
|
2435
|
+
else if (this.hasError) {
|
|
2436
|
+
return 'step-state-error';
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
getIcon() {
|
|
2440
|
+
if (this.completed) {
|
|
2441
|
+
return 'check_circle_outline';
|
|
2442
|
+
}
|
|
2443
|
+
else if (this.hasError) {
|
|
2444
|
+
return 'error_outline';
|
|
2445
|
+
}
|
|
2446
|
+
return '';
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
StepHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepHeaderComponent, deps: [{ token: i1$5.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2450
|
+
StepHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: StepHeaderComponent, selector: "mad-step-header", inputs: { color: "color", index: "index", label: "label", state: "state", errorMessage: "errorMessage", selected: "selected", active: "active", optional: "optional", hasError: "hasError", completed: "completed", closed: "closed" }, host: { attributes: { "role": "tab" }, classAttribute: "mad-step-header" }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"header\"\n fxLayout=\"row\"\n fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [ngClass]=\"this.hasError ? 'error-border' : 'check-border'\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n <div *ngIf=\"this.completed || this.hasError\" class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n <span *ngIf=\"!this.hasError && !this.completed\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n <div class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--warn-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid lightgrey;width:100%;height:62px}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:green}.step-state-error{width:5px;background:var(--warn-color)}.step-state-neutral{width:5px;background:lightgrey}.green-check{color:green}.red-error{color:var(--warn-color)}.check-border{border-color:#d3d3d3}.error-border{border-color:var(--warn-color)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2451
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepHeaderComponent, decorators: [{
|
|
2452
|
+
type: Component,
|
|
2453
|
+
args: [{ selector: 'mad-step-header', inputs: ['color'], host: {
|
|
2454
|
+
class: 'mad-step-header',
|
|
2455
|
+
role: 'tab',
|
|
2456
|
+
}, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"header\"\n fxLayout=\"row\"\n fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [ngClass]=\"this.hasError ? 'error-border' : 'check-border'\"\n>\n <div [ngClass]=\"this.getCssForState()\"></div>\n <div class=\"header-label\">\n <mat-icon class=\"material-icons-outlined\">\n {{ this.selected && !this.closed ? 'keyboard_arrow_down' : 'keyboard_arrow_right' }}\n </mat-icon>\n </div>\n <div *ngIf=\"this.completed || this.hasError\" class=\"header-label\">\n <mat-icon [ngClass]=\"this.completed ? 'green-check' : 'red-error'\">\n {{ getIcon() }}\n </mat-icon>\n </div>\n <span *ngIf=\"!this.hasError && !this.completed\" class=\"header-label\">{{ this.index + 1 + '.' }}</span>\n <div class=\"header-label\">{{ this.label }}</div>\n</div>\n", styles: [".header{overflow:hidden;outline:var(--warn-color);cursor:pointer;box-sizing:content-box;-webkit-tap-highlight-color:transparent;border:1px solid lightgrey;width:100%;height:62px}.header-label{align-items:center;display:flex}.step-state-complete{width:5px;background:green}.step-state-error{width:5px;background:var(--warn-color)}.step-state-neutral{width:5px;background:lightgrey}.green-check{color:green}.red-error{color:var(--warn-color)}.check-border{border-color:#d3d3d3}.error-border{border-color:var(--warn-color)}\n"] }]
|
|
2457
|
+
}], ctorParameters: function () { return [{ type: i1$5.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { index: [{
|
|
2458
|
+
type: Input
|
|
2459
|
+
}], label: [{
|
|
2460
|
+
type: Input
|
|
2461
|
+
}], state: [{
|
|
2462
|
+
type: Input
|
|
2463
|
+
}], errorMessage: [{
|
|
2464
|
+
type: Input
|
|
2465
|
+
}], selected: [{
|
|
2466
|
+
type: Input
|
|
2467
|
+
}], active: [{
|
|
2468
|
+
type: Input
|
|
2469
|
+
}], optional: [{
|
|
2470
|
+
type: Input
|
|
2471
|
+
}], hasError: [{
|
|
2472
|
+
type: Input
|
|
2473
|
+
}], completed: [{
|
|
2474
|
+
type: Input
|
|
2475
|
+
}], closed: [{
|
|
2476
|
+
type: Input
|
|
2477
|
+
}] } });
|
|
2478
|
+
|
|
2479
|
+
/**
|
|
2480
|
+
* Animations used by the MAD stepper.
|
|
2481
|
+
*/
|
|
2482
|
+
const madStepperAnimations = {
|
|
2483
|
+
verticalStepTransition: trigger('stepTransition', [
|
|
2484
|
+
state('previous', style({ height: '0px', visibility: 'hidden' })),
|
|
2485
|
+
state('next', style({ height: '0px', visibility: 'hidden' })),
|
|
2486
|
+
state('current', style({ height: '*', visibility: 'visible' })),
|
|
2487
|
+
transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
|
2488
|
+
]),
|
|
2489
|
+
};
|
|
2490
|
+
|
|
2491
|
+
class StepComponent extends CdkStep {
|
|
2492
|
+
constructor(stepper, _viewContainerRef) {
|
|
2493
|
+
super(stepper);
|
|
2494
|
+
this.stepper = stepper;
|
|
2495
|
+
this._viewContainerRef = _viewContainerRef;
|
|
2496
|
+
/** Action event for the next button. If not set the StepComponent will handle the step navigation */
|
|
2497
|
+
this.onNext = new EventEmitter();
|
|
2498
|
+
/** Action event for the done button. If not set the StepComponent will handle the step navigation */
|
|
2499
|
+
this.onDone = new EventEmitter();
|
|
2500
|
+
/*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
|
|
2501
|
+
this.onHeaderClick = new EventEmitter();
|
|
2502
|
+
this.stepClosed = false;
|
|
2503
|
+
this._isSelected = Subscription.EMPTY;
|
|
2504
|
+
}
|
|
2505
|
+
ngAfterContentInit() {
|
|
2506
|
+
this._isSelected = this._stepper.steps.changes
|
|
2507
|
+
.pipe(switchMap(() => this._stepper.selectionChange.pipe(map(event => event.selectedStep === this), tap(() => (this.stepClosed = false)), startWith(this._stepper.selected === this))))
|
|
2508
|
+
.subscribe();
|
|
2509
|
+
}
|
|
2510
|
+
ngOnDestroy() {
|
|
2511
|
+
this._isSelected.unsubscribe();
|
|
2512
|
+
}
|
|
2513
|
+
next(markFormAsTouched = true) {
|
|
2514
|
+
this.stepValidation(markFormAsTouched);
|
|
2515
|
+
if (this.onNext.observers.length <= 0) {
|
|
2516
|
+
this.stepper.next();
|
|
2517
|
+
}
|
|
2518
|
+
this.onNext.emit();
|
|
2519
|
+
}
|
|
2520
|
+
selectAndMarkAsTouched(index) {
|
|
2521
|
+
var _a, _b;
|
|
2522
|
+
//Mark current selected step as touched before selecting to display errors in the from
|
|
2523
|
+
(_b = (_a = this._stepper.selected) === null || _a === void 0 ? void 0 : _a.stepControl) === null || _b === void 0 ? void 0 : _b.markAllAsTouched();
|
|
2524
|
+
this.stepClosed = false;
|
|
2525
|
+
if (this.onHeaderClick.observers.length <= 0) {
|
|
2526
|
+
this.select();
|
|
2527
|
+
}
|
|
2528
|
+
this.onHeaderClick.emit(index);
|
|
2529
|
+
}
|
|
2530
|
+
completeLast() {
|
|
2531
|
+
this.stepValidation(true);
|
|
2532
|
+
this.stepClosed = true;
|
|
2533
|
+
if (this.onDone.observers.length <= 0) {
|
|
2534
|
+
this.stepper.next();
|
|
2535
|
+
}
|
|
2536
|
+
this.onDone.emit();
|
|
2537
|
+
}
|
|
2538
|
+
resetValidations() {
|
|
2539
|
+
this.hasError = false;
|
|
2540
|
+
this.completed = true;
|
|
2541
|
+
this.state = STEP_STATE.DONE;
|
|
2542
|
+
}
|
|
2543
|
+
stepValidation(markFormAsTouched) {
|
|
2544
|
+
var _a, _b;
|
|
2545
|
+
if (markFormAsTouched) {
|
|
2546
|
+
(_a = this.stepControl) === null || _a === void 0 ? void 0 : _a.markAllAsTouched();
|
|
2547
|
+
}
|
|
2548
|
+
if ((_b = this.stepControl) === null || _b === void 0 ? void 0 : _b.valid) {
|
|
2549
|
+
this.hasError = false;
|
|
2550
|
+
this.completed = true;
|
|
2551
|
+
this.state = STEP_STATE.DONE;
|
|
2552
|
+
}
|
|
2553
|
+
else {
|
|
2554
|
+
this.completed = false;
|
|
2555
|
+
this.hasError = true;
|
|
2556
|
+
this.state = STEP_STATE.ERROR;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
StepComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepComponent, deps: [{ token: forwardRef(() => StepperComponent) }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2561
|
+
StepComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: StepComponent, selector: "mad-step", outputs: { onNext: "onNext", onDone: "onDone", onHeaderClick: "onHeaderClick" }, providers: [{ provide: CdkStep, useExisting: StepComponent }], usesInheritance: true, ngImport: i0, template: "<ng-template let-last=\"last\" let-nextBtnLbl=\"nextBtnLbl\" let-doneBtnLbl=\"doneBtnLbl\">\n <div class=\"step-container\" fxLayout=\"column\">\n <div class=\"step-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"step-buttons\">\n <div *ngIf=\"!last\">\n <button mat-stroked-button color=\"primary\" (click)=\"next()\">{{nextBtnLbl}}</button>\n </div>\n <div *ngIf=\"last\">\n <button mat-stroked-button color=\"primary\" (click)=\"completeLast()\">{{doneBtnLbl}}</button>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.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}.step-content,.step-buttons{padding:2em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2562
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepComponent, decorators: [{
|
|
2563
|
+
type: Component,
|
|
2564
|
+
args: [{ selector: 'mad-step', providers: [{ provide: CdkStep, useExisting: StepComponent }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template let-last=\"last\" let-nextBtnLbl=\"nextBtnLbl\" let-doneBtnLbl=\"doneBtnLbl\">\n <div class=\"step-container\" fxLayout=\"column\">\n <div class=\"step-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"step-buttons\">\n <div *ngIf=\"!last\">\n <button mat-stroked-button color=\"primary\" (click)=\"next()\">{{nextBtnLbl}}</button>\n </div>\n <div *ngIf=\"last\">\n <button mat-stroked-button color=\"primary\" (click)=\"completeLast()\">{{doneBtnLbl}}</button>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.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}.step-content,.step-buttons{padding:2em}\n"] }]
|
|
2565
|
+
}], ctorParameters: function () {
|
|
2566
|
+
return [{ type: StepperComponent, decorators: [{
|
|
2567
|
+
type: Inject,
|
|
2568
|
+
args: [forwardRef(() => StepperComponent)]
|
|
2569
|
+
}] }, { type: i0.ViewContainerRef }];
|
|
2570
|
+
}, propDecorators: { onNext: [{
|
|
2571
|
+
type: Output
|
|
2572
|
+
}], onDone: [{
|
|
2573
|
+
type: Output
|
|
2574
|
+
}], onHeaderClick: [{
|
|
2575
|
+
type: Output
|
|
2576
|
+
}] } });
|
|
2577
|
+
class StepperComponent extends CdkStepper {
|
|
2578
|
+
constructor(dir, changeDetectorRef, elementRef) {
|
|
2579
|
+
super(dir, changeDetectorRef, elementRef);
|
|
2580
|
+
/** Event emitted when the current step is done transitioning in. */
|
|
2581
|
+
this.animationDone = new EventEmitter();
|
|
2582
|
+
/** Steps that belong to the current stepper, excluding ones from nested steppers. */
|
|
2583
|
+
this.steps = new QueryList();
|
|
2584
|
+
this._animationDone = new Subject();
|
|
2585
|
+
this.orientation = 'vertical';
|
|
2586
|
+
}
|
|
2587
|
+
ngOnInit() {
|
|
2588
|
+
// Only linear stepper implementation is supported
|
|
2589
|
+
super.linear = true;
|
|
2590
|
+
}
|
|
2591
|
+
ngAfterContentInit() {
|
|
2592
|
+
super.ngAfterContentInit();
|
|
2593
|
+
this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
2594
|
+
this._stateChanged();
|
|
2595
|
+
});
|
|
2596
|
+
this._animationDone
|
|
2597
|
+
.pipe(distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState), takeUntil(this._destroyed))
|
|
2598
|
+
.subscribe(event => {
|
|
2599
|
+
if (event.toState === 'current') {
|
|
2600
|
+
this.animationDone.emit();
|
|
2601
|
+
}
|
|
2602
|
+
});
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Method patched to enable the closing of the last step.
|
|
2606
|
+
*/
|
|
2607
|
+
_getAnimationDirection(index) {
|
|
2608
|
+
var _a, _b;
|
|
2609
|
+
const closeLastStep = this.selectedIndex === this.steps.length - 1 && ((_a = this._steps.last) === null || _a === void 0 ? void 0 : _a.completed) && ((_b = this._steps.last) === null || _b === void 0 ? void 0 : _b.stepClosed);
|
|
2610
|
+
if (closeLastStep) {
|
|
2611
|
+
return 'next';
|
|
2612
|
+
}
|
|
2613
|
+
return super._getAnimationDirection(index);
|
|
2614
|
+
}
|
|
2615
|
+
_stepIsNavigable(index, step) {
|
|
2616
|
+
return step.completed || this.selectedIndex === index || !this.linear;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
StepperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperComponent, deps: [{ token: i4$2.Directionality, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2620
|
+
StepperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", 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\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"vertical-stepper-content\" 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 <div class=\"vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{step: step, i: i, last: isLast, first: isFirst, nextBtnLbl: this.nextButtonLabel, doneBtnLbl: this.doneButtonLabel}\"></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\"></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.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}.step-content,.step-buttons{padding:2em}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.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 });
|
|
2621
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperComponent, decorators: [{
|
|
2622
|
+
type: Component,
|
|
2623
|
+
args: [{ selector: 'mad-stepper', host: {
|
|
2624
|
+
'[class.stepper-vertical]': 'true',
|
|
2625
|
+
'[attr.aria-orientation]': '"vertical"',
|
|
2626
|
+
role: 'tablist',
|
|
2627
|
+
}, 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\n [ngTemplateOutlet]=\"stepTemplate\"\n [ngTemplateOutletContext]=\"{step: step, i: i}\"></ng-container>\n <div class=\"vertical-content-container\" [class.mat-stepper-vertical-line]=\"!isLast\">\n <div class=\"vertical-stepper-content\" 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 <div class=\"vertical-content\">\n <ng-container [ngTemplateOutlet]=\"step.content\"\n [ngTemplateOutletContext]=\"{step: step, i: i, last: isLast, first: isFirst, nextBtnLbl: this.nextButtonLabel, doneBtnLbl: this.doneButtonLabel}\"></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\"></mad-step-header>\n</ng-template>\n", styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{display:flex;align-items:center;border:none!important;height:10px}.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}.step-content,.step-buttons{padding:2em}\n"] }]
|
|
2628
|
+
}], ctorParameters: function () {
|
|
2629
|
+
return [{ type: i4$2.Directionality, decorators: [{
|
|
2630
|
+
type: Optional
|
|
2631
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }];
|
|
2632
|
+
}, propDecorators: { animationDone: [{
|
|
2633
|
+
type: Output
|
|
2634
|
+
}], nextButtonLabel: [{
|
|
2635
|
+
type: Input
|
|
2636
|
+
}], doneButtonLabel: [{
|
|
2637
|
+
type: Input
|
|
2638
|
+
}], _stepHeader: [{
|
|
2639
|
+
type: ViewChildren,
|
|
2640
|
+
args: [StepHeaderComponent]
|
|
2641
|
+
}], _steps: [{
|
|
2642
|
+
type: ContentChildren,
|
|
2643
|
+
args: [StepComponent, { descendants: true }]
|
|
2644
|
+
}] } });
|
|
2645
|
+
|
|
2646
|
+
class StepperModule {
|
|
2647
|
+
}
|
|
2648
|
+
StepperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2649
|
+
StepperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, declarations: [StepperComponent, StepHeaderComponent, StepComponent], imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule], exports: [StepperComponent, StepHeaderComponent, StepComponent] });
|
|
2650
|
+
StepperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule] });
|
|
2651
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: StepperModule, decorators: [{
|
|
2652
|
+
type: NgModule,
|
|
2653
|
+
args: [{
|
|
2654
|
+
declarations: [StepperComponent, StepHeaderComponent, StepComponent],
|
|
2655
|
+
imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule],
|
|
2656
|
+
exports: [StepperComponent, StepHeaderComponent, StepComponent],
|
|
2657
|
+
}]
|
|
2658
|
+
}] });
|
|
2659
|
+
|
|
2660
|
+
class ContentHeaderComponent {
|
|
2661
|
+
}
|
|
2662
|
+
ContentHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2663
|
+
ContentHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentHeaderComponent, selector: "mad-content-header", ngImport: i0, template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem}\n"] });
|
|
2664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentHeaderComponent, decorators: [{
|
|
2665
|
+
type: Component,
|
|
2666
|
+
args: [{ selector: 'mad-content-header', template: "<div class=\"content-header\">\n <ng-content></ng-content>\n</div>\n", styles: [".content-header{padding-right:.5rem}\n"] }]
|
|
2667
|
+
}] });
|
|
2668
|
+
|
|
2669
|
+
class ContentPanelContainerComponent {
|
|
2670
|
+
}
|
|
2671
|
+
ContentPanelContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2672
|
+
ContentPanelContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerComponent, selector: "mad-content-panel-container", ngImport: i0, template: "<div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-height:.05rem}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;flex-direction:column}\n"] });
|
|
2673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerComponent, decorators: [{
|
|
2674
|
+
type: Component,
|
|
2675
|
+
args: [{ selector: 'mad-content-panel-container', template: "<div class=\"content-panel-outer-wrapper\">\n <ng-content select=\"mad-content-panel-container-content\"></ng-content>\n <ng-content select=\"mad-content-panel-container-footer\"></ng-content>\n</div>\n", styles: [":host{position:relative;overflow:hidden;display:flex;flex:1 1 auto;min-height:.05rem}.content-panel-outer-wrapper{display:flex;flex:1 1 auto;flex-direction:column}\n"] }]
|
|
2676
|
+
}] });
|
|
2677
|
+
|
|
2678
|
+
class ContentPanelContainerContentComponent {
|
|
2679
|
+
}
|
|
2680
|
+
ContentPanelContainerContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2681
|
+
ContentPanelContainerContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerContentComponent, selector: "mad-content-panel-container-content", ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{flex:1 1 auto;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem;height:1rem}\n"] });
|
|
2682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerContentComponent, decorators: [{
|
|
2683
|
+
type: Component,
|
|
2684
|
+
args: [{ selector: 'mad-content-panel-container-content', template: "<ng-content></ng-content>", styles: [":host{flex:1 1 auto;overflow-y:auto;border-top:.05rem solid #cccccc;padding:1rem;height:1rem}\n"] }]
|
|
2685
|
+
}] });
|
|
2686
|
+
|
|
2687
|
+
class ContentPanelContainerFooterComponent {
|
|
2688
|
+
}
|
|
2689
|
+
ContentPanelContainerFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2690
|
+
ContentPanelContainerFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ContentPanelContainerFooterComponent, selector: "mad-content-panel-container-footer", ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem}\n"] });
|
|
2691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelContainerFooterComponent, decorators: [{
|
|
2692
|
+
type: Component,
|
|
2693
|
+
args: [{ selector: 'mad-content-panel-container-footer', template: "<ng-content></ng-content>", styles: [":host{border-top:.05rem solid #cccccc;padding:.25rem 1rem;display:flex;flex:0 0 auto;align-items:center;min-height:2rem}\n"] }]
|
|
2694
|
+
}] });
|
|
2695
|
+
|
|
2696
|
+
class MainContainerComponent {
|
|
2697
|
+
}
|
|
2698
|
+
MainContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MainContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2699
|
+
MainContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: MainContainerComponent, selector: "mad-main-container", ngImport: i0, template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] });
|
|
2700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MainContainerComponent, decorators: [{
|
|
2701
|
+
type: Component,
|
|
2702
|
+
args: [{ selector: 'mad-main-container', template: "<div class=\"main-container\">\n <ng-content select=\"mad-content-header\"></ng-content>\n <ng-content select=\"mad-flowbar\"></ng-content>\n <ng-content select=\"mad-content-panel-container\"></ng-content>\n</div>\n", styles: [".main-container{height:100%;display:flex;flex-direction:column}\n"] }]
|
|
2703
|
+
}] });
|
|
2704
|
+
|
|
2705
|
+
class ContentPanelModule {
|
|
2706
|
+
}
|
|
2707
|
+
ContentPanelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2708
|
+
ContentPanelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, declarations: [ContentHeaderComponent,
|
|
2709
|
+
ContentPanelContainerComponent,
|
|
2710
|
+
ContentPanelContainerContentComponent,
|
|
2711
|
+
ContentPanelContainerFooterComponent,
|
|
2712
|
+
MainContainerComponent], imports: [CommonModule], exports: [ContentHeaderComponent,
|
|
2713
|
+
ContentPanelContainerComponent,
|
|
2714
|
+
ContentPanelContainerContentComponent,
|
|
2715
|
+
ContentPanelContainerFooterComponent,
|
|
2716
|
+
MainContainerComponent] });
|
|
2717
|
+
ContentPanelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, imports: [CommonModule] });
|
|
2718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContentPanelModule, decorators: [{
|
|
2719
|
+
type: NgModule,
|
|
2720
|
+
args: [{
|
|
2721
|
+
declarations: [
|
|
2722
|
+
ContentHeaderComponent,
|
|
2723
|
+
ContentPanelContainerComponent,
|
|
2724
|
+
ContentPanelContainerContentComponent,
|
|
2725
|
+
ContentPanelContainerFooterComponent,
|
|
2726
|
+
MainContainerComponent,
|
|
2727
|
+
],
|
|
2728
|
+
imports: [CommonModule],
|
|
2729
|
+
exports: [
|
|
2730
|
+
ContentHeaderComponent,
|
|
2731
|
+
ContentPanelContainerComponent,
|
|
2732
|
+
ContentPanelContainerContentComponent,
|
|
2733
|
+
ContentPanelContainerFooterComponent,
|
|
2734
|
+
MainContainerComponent,
|
|
2735
|
+
],
|
|
2736
|
+
}]
|
|
2737
|
+
}] });
|
|
2738
|
+
|
|
2739
|
+
class FlowbarComponent {
|
|
2740
|
+
constructor() {
|
|
2741
|
+
this._steps = [];
|
|
2742
|
+
this._activeStepChange = new EventEmitter(true);
|
|
2743
|
+
/**
|
|
2744
|
+
* Event emitted when a step header is clicked.
|
|
2745
|
+
* When defined header navigation has to be implemented programmatically.
|
|
2746
|
+
* e.g. {@see changeActiveStepOnHeader}
|
|
2747
|
+
*/
|
|
2748
|
+
this._headerClick = new EventEmitter(true);
|
|
2749
|
+
}
|
|
2750
|
+
get currentStepLabel() {
|
|
2751
|
+
return this._activeStep.label;
|
|
2752
|
+
}
|
|
2753
|
+
get currentSubStepLabel() {
|
|
2754
|
+
var _a;
|
|
2755
|
+
return (_a = this._activeStep.activeSubStep) === null || _a === void 0 ? void 0 : _a.label;
|
|
2756
|
+
}
|
|
2757
|
+
ngOnInit() {
|
|
2758
|
+
// If no active step is set as input or the active step is not enabled, select the first enabled step
|
|
2759
|
+
if (!this._activeStep || !this._activeStep.enabled) {
|
|
2760
|
+
this._activeStep = this._steps.find(step => step.enabled);
|
|
2761
|
+
if (this._activeStep) {
|
|
2762
|
+
// If sub steps exist then set the first non disabled sub step per default
|
|
2763
|
+
if (this.activeTabHasSubSteps()) {
|
|
2764
|
+
this._activeStep.activeSubStep = this._activeStep.subSteps.find(step => step.enabled);
|
|
2765
|
+
}
|
|
2766
|
+
this._activeStepChange.emit(this._activeStep);
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
ngAfterViewInit() {
|
|
2771
|
+
this.stepper._getIndicatorType = () => 'number';
|
|
2772
|
+
}
|
|
2773
|
+
getIndexForActiveStep() {
|
|
2774
|
+
const selectedIndex = this._steps.indexOf(this._activeStep);
|
|
2775
|
+
return selectedIndex === -1 ? 0 : selectedIndex;
|
|
2776
|
+
}
|
|
2777
|
+
changeActiveStep(step) {
|
|
2778
|
+
const previousIndex = this._steps.indexOf(this._activeStep);
|
|
2779
|
+
this._activeStep = step;
|
|
2780
|
+
if (this.activeTabHasSubSteps()) {
|
|
2781
|
+
if (previousIndex < this._steps.indexOf(this._activeStep)) {
|
|
2782
|
+
this._activeStep.activeSubStep = this._activeStep.subSteps[0];
|
|
2783
|
+
}
|
|
2784
|
+
else {
|
|
2785
|
+
this._activeStep.activeSubStep = this._activeStep.subSteps[this._activeStep.subSteps.length - 1];
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
this._activeStepChange.emit(this._activeStep);
|
|
2789
|
+
}
|
|
2790
|
+
changeActiveStepOnHeader(step) {
|
|
2791
|
+
const stepIndex = this._steps.indexOf(step);
|
|
2792
|
+
this._activeStep = step;
|
|
2793
|
+
this.stepper.selected = this.stepper._steps.find((_, i) => i === stepIndex);
|
|
2794
|
+
}
|
|
2795
|
+
changeActiveSubStep(subStep) {
|
|
2796
|
+
this._activeStep.activeSubStep = subStep;
|
|
2797
|
+
}
|
|
2798
|
+
previous() {
|
|
2799
|
+
if (this.isPreviousAvailable()) {
|
|
2800
|
+
// If active step has no sub steps or first sub step is selected -> go to previous main step
|
|
2801
|
+
if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) {
|
|
2802
|
+
const previousEnabledStep = this.findPreviousEnabledStep();
|
|
2803
|
+
this.changeActiveStep(previousEnabledStep);
|
|
2804
|
+
this.stepper.selectedIndex = this._steps.indexOf(previousEnabledStep);
|
|
2805
|
+
}
|
|
2806
|
+
else {
|
|
2807
|
+
const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep);
|
|
2808
|
+
this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex - 1];
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
next() {
|
|
2813
|
+
if (this.isNextAvailable()) {
|
|
2814
|
+
// If active step has no sub steps or last sub step is selected -> go to next main step
|
|
2815
|
+
if (!this.activeTabHasSubSteps() || this.isLastSubStep()) {
|
|
2816
|
+
const nextEnabledStep = this.findNextEnabledStep();
|
|
2817
|
+
this.changeActiveStep(nextEnabledStep);
|
|
2818
|
+
this.stepper.selectedIndex = this._steps.indexOf(nextEnabledStep);
|
|
2819
|
+
}
|
|
2820
|
+
else {
|
|
2821
|
+
const subStepIndex = this._activeStep.subSteps.indexOf(this._activeStep.activeSubStep);
|
|
2822
|
+
this._activeStep.activeSubStep = this._activeStep.subSteps[subStepIndex + 1];
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
isPreviousAvailable() {
|
|
2827
|
+
if (this._activeStep) {
|
|
2828
|
+
if (!this.activeTabHasSubSteps() || this.isFirstSubStep()) {
|
|
2829
|
+
const index = this.getCurrentIndex();
|
|
2830
|
+
return index > 0 && this.isAnyPreviousStepEnabled(index);
|
|
2831
|
+
}
|
|
2832
|
+
else {
|
|
2833
|
+
return true;
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
return false;
|
|
2837
|
+
}
|
|
2838
|
+
isNextAvailable() {
|
|
2839
|
+
if (this._activeStep) {
|
|
2840
|
+
if (!this.activeTabHasSubSteps() || this.isLastSubStep()) {
|
|
2841
|
+
const index = this.getCurrentIndex();
|
|
2842
|
+
return index < this._steps.length - 1 && this.isAnyFollowingStepEnabled(index);
|
|
2843
|
+
}
|
|
2844
|
+
else {
|
|
2845
|
+
return true;
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
return false;
|
|
2849
|
+
}
|
|
2850
|
+
isLastStep() {
|
|
2851
|
+
if (this.getCurrentIndex() === this._steps.length - 1) {
|
|
2852
|
+
if (this.activeTabHasSubSteps()) {
|
|
2853
|
+
return this.isLastSubStep();
|
|
2854
|
+
}
|
|
2855
|
+
else {
|
|
2856
|
+
return true;
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
return false;
|
|
2860
|
+
}
|
|
2861
|
+
getCurrentIndex() {
|
|
2862
|
+
return this._steps.findIndex(value => value === this._activeStep);
|
|
2863
|
+
}
|
|
2864
|
+
getCurrentSubStepIndex() {
|
|
2865
|
+
return this._activeStep.subSteps.findIndex(value => value === this._activeStep.activeSubStep);
|
|
2866
|
+
}
|
|
2867
|
+
triggerClick() {
|
|
2868
|
+
const selectedStep = this._steps[this.stepper.selectedIndex];
|
|
2869
|
+
this.changeActiveStep(selectedStep);
|
|
2870
|
+
}
|
|
2871
|
+
headerClick(event, step) {
|
|
2872
|
+
event.stopPropagation(); //stop processing current header click event
|
|
2873
|
+
this._headerClick.emit(step);
|
|
2874
|
+
}
|
|
2875
|
+
activeTabHasSubSteps() {
|
|
2876
|
+
return this._activeStep.subSteps && this._activeStep.subSteps.length > 0;
|
|
2877
|
+
}
|
|
2878
|
+
isFirstSubStep() {
|
|
2879
|
+
return this._activeStep.activeSubStep === this._activeStep.subSteps[0];
|
|
2880
|
+
}
|
|
2881
|
+
isLastSubStep() {
|
|
2882
|
+
return this._activeStep.activeSubStep === this._activeStep.subSteps[this._activeStep.subSteps.length - 1];
|
|
2883
|
+
}
|
|
2884
|
+
isAnyPreviousStepEnabled(index) {
|
|
2885
|
+
// eslint-disable-next-line id-blacklist
|
|
2886
|
+
return this._steps.slice(0, index).find(step => step.enabled) !== undefined;
|
|
2887
|
+
}
|
|
2888
|
+
isAnyFollowingStepEnabled(index) {
|
|
2889
|
+
// eslint-disable-next-line id-blacklist
|
|
2890
|
+
return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled) !== undefined;
|
|
2891
|
+
}
|
|
2892
|
+
findPreviousEnabledStep() {
|
|
2893
|
+
const index = this.getCurrentIndex();
|
|
2894
|
+
return this._steps
|
|
2895
|
+
.slice(0, index)
|
|
2896
|
+
.reverse()
|
|
2897
|
+
.find(step => step.enabled);
|
|
2898
|
+
}
|
|
2899
|
+
findNextEnabledStep() {
|
|
2900
|
+
const index = this.getCurrentIndex();
|
|
2901
|
+
return this._steps.slice(index + 1, this._steps.length).find(step => step.enabled);
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
FlowbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2905
|
+
FlowbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: FlowbarComponent, selector: "mad-flowbar", inputs: { _steps: ["steps", "_steps"], _activeStep: ["activeStep", "_activeStep"] }, outputs: { _activeStepChange: "activeStepChange", _headerClick: "headerClick" }, viewQueries: [{ propertyName: "stepper", first: true, predicate: ["stepper"], descendants: true }], ngImport: i0, template: "<div class=\"stepper-container\">\n <mat-horizontal-stepper #stepper [selectedIndex]=\"this.getIndexForActiveStep()\" (click)=\"triggerClick()\">\n <mat-step *ngFor=\"let step of _steps\" [aria-labelledby]=\"!step.enabled ? 'disabled' : null\">\n <ng-template matStepLabel>\n <div class=\"step-header-overlay\" *ngIf=\"this._headerClick.observers.length > 0\" (click)=\"headerClick($event, step)\"></div>\n <span>{{step.label}}</span>\n </ng-template>\n </mat-step>\n </mat-horizontal-stepper>\n</div>\n", styles: [".stepper-container{display:flex;padding:0 1rem}::ng-deep .mat-stepper-horizontal .mat-horizontal-stepper-header{padding:0;height:auto}::ng-deep .mat-step-header[aria-labelledby=disabled]{pointer-events:none!important;cursor:not-allowed}::ng-deep .mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 10px}::ng-deep .mat-stepper-horizontal .mat-stepper-horizontal-line{margin:0 5px;border-top-width:4px}.step-header-overlay{position:absolute;width:100%;height:100%;right:0;top:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$4.MatStep, selector: "mat-step", inputs: ["color"], exportAs: ["matStep"] }, { kind: "directive", type: i2$4.MatStepLabel, selector: "[matStepLabel]" }, { kind: "component", type: i2$4.MatStepper, selector: "mat-stepper, mat-vertical-stepper, mat-horizontal-stepper, [matStepper]", inputs: ["selectedIndex", "disableRipple", "color", "labelPosition", "headerPosition", "animationDuration"], outputs: ["animationDone"], exportAs: ["matStepper", "matVerticalStepper", "matHorizontalStepper"] }] });
|
|
2906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarComponent, decorators: [{
|
|
2907
|
+
type: Component,
|
|
2908
|
+
args: [{ selector: 'mad-flowbar', template: "<div class=\"stepper-container\">\n <mat-horizontal-stepper #stepper [selectedIndex]=\"this.getIndexForActiveStep()\" (click)=\"triggerClick()\">\n <mat-step *ngFor=\"let step of _steps\" [aria-labelledby]=\"!step.enabled ? 'disabled' : null\">\n <ng-template matStepLabel>\n <div class=\"step-header-overlay\" *ngIf=\"this._headerClick.observers.length > 0\" (click)=\"headerClick($event, step)\"></div>\n <span>{{step.label}}</span>\n </ng-template>\n </mat-step>\n </mat-horizontal-stepper>\n</div>\n", styles: [".stepper-container{display:flex;padding:0 1rem}::ng-deep .mat-stepper-horizontal .mat-horizontal-stepper-header{padding:0;height:auto}::ng-deep .mat-step-header[aria-labelledby=disabled]{pointer-events:none!important;cursor:not-allowed}::ng-deep .mat-stepper-horizontal .mat-horizontal-content-container{padding:0 0 10px}::ng-deep .mat-stepper-horizontal .mat-stepper-horizontal-line{margin:0 5px;border-top-width:4px}.step-header-overlay{position:absolute;width:100%;height:100%;right:0;top:0}\n"] }]
|
|
2909
|
+
}], propDecorators: { _steps: [{
|
|
2910
|
+
type: Input,
|
|
2911
|
+
args: ['steps']
|
|
2912
|
+
}], _activeStep: [{
|
|
2913
|
+
type: Input,
|
|
2914
|
+
args: ['activeStep']
|
|
2915
|
+
}], _activeStepChange: [{
|
|
2916
|
+
type: Output,
|
|
2917
|
+
args: ['activeStepChange']
|
|
2918
|
+
}], _headerClick: [{
|
|
2919
|
+
type: Output,
|
|
2920
|
+
args: ['headerClick']
|
|
2921
|
+
}], stepper: [{
|
|
2922
|
+
type: ViewChild,
|
|
2923
|
+
args: ['stepper']
|
|
2924
|
+
}] } });
|
|
2925
|
+
|
|
2926
|
+
class FlowbarModule {
|
|
2927
|
+
}
|
|
2928
|
+
FlowbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2929
|
+
FlowbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, declarations: [FlowbarComponent], imports: [CommonModule, MatStepperModule], exports: [FlowbarComponent] });
|
|
2930
|
+
FlowbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, imports: [CommonModule, MatStepperModule] });
|
|
2931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: FlowbarModule, decorators: [{
|
|
2932
|
+
type: NgModule,
|
|
2933
|
+
args: [{
|
|
2934
|
+
declarations: [FlowbarComponent],
|
|
2935
|
+
imports: [CommonModule, MatStepperModule],
|
|
2936
|
+
exports: [FlowbarComponent],
|
|
2937
|
+
}]
|
|
2938
|
+
}] });
|
|
2939
|
+
|
|
2940
|
+
class MaterialAddonsModule {
|
|
2941
|
+
}
|
|
2942
|
+
MaterialAddonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2943
|
+
MaterialAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, exports: [ReadOnlyFormFieldModule,
|
|
2944
|
+
ButtonModule,
|
|
2945
|
+
ToolbarModule,
|
|
2946
|
+
MaterialActionButtonModule,
|
|
2947
|
+
NumericFieldModule,
|
|
2948
|
+
CardModule,
|
|
2949
|
+
QuickListModule,
|
|
2950
|
+
ThrottleClickModule] });
|
|
2951
|
+
MaterialAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, imports: [ReadOnlyFormFieldModule,
|
|
2952
|
+
ButtonModule,
|
|
2953
|
+
ToolbarModule,
|
|
2954
|
+
MaterialActionButtonModule,
|
|
2955
|
+
NumericFieldModule,
|
|
2956
|
+
CardModule,
|
|
2957
|
+
QuickListModule,
|
|
2958
|
+
ThrottleClickModule] });
|
|
2959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: MaterialAddonsModule, decorators: [{
|
|
2960
|
+
type: NgModule,
|
|
2961
|
+
args: [{
|
|
2962
|
+
exports: [
|
|
2963
|
+
ReadOnlyFormFieldModule,
|
|
2964
|
+
ButtonModule,
|
|
2965
|
+
ToolbarModule,
|
|
2966
|
+
MaterialActionButtonModule,
|
|
2967
|
+
NumericFieldModule,
|
|
2968
|
+
CardModule,
|
|
2969
|
+
QuickListModule,
|
|
2970
|
+
ThrottleClickModule,
|
|
2971
|
+
],
|
|
2972
|
+
}]
|
|
2973
|
+
}] });
|
|
2974
|
+
|
|
2975
|
+
/*
|
|
2976
|
+
* Public API Surface of material-addons
|
|
2977
|
+
*/
|
|
2978
|
+
|
|
2979
|
+
/**
|
|
2980
|
+
* Generated bundle index. Do not edit.
|
|
2981
|
+
*/
|
|
2982
|
+
|
|
2983
|
+
export { BaseQuickListComponent, ButtonModule, CardComponent, CardModule, ContentHeaderComponent, ContentPanelContainerComponent, ContentPanelContainerContentComponent, ContentPanelContainerFooterComponent, ContentPanelModule, DangerButtonComponent, DataTableColumnsModalComponent, DataTableComponent, DataTableModule, FlowbarComponent, FlowbarModule, IconButtonComponent, LinkButtonComponent, MadBasicButton, MainContainerComponent, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldDirective, NumericFieldModule, OutlineButtonComponent, PrimaryButtonComponent, QuickListCompactComponent, QuickListComponent, QuickListModule, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, TableComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, ToolbarComponent, ToolbarModule, ToolbarService, madStepperAnimations };
|
|
2984
|
+
//# sourceMappingURL=porscheinformatik-material-addons.mjs.map
|