@porscheinformatik/material-addons 10.2.0 → 10.2.1
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/bundles/porscheinformatik-material-addons.umd.js +343 -30
- package/bundles/porscheinformatik-material-addons.umd.js.map +1 -1
- package/bundles/porscheinformatik-material-addons.umd.min.js +2 -2
- package/bundles/porscheinformatik-material-addons.umd.min.js.map +1 -1
- package/esm2015/lib/material-addons.module.js +3 -3
- package/esm2015/lib/numeric-field/numeric-field.directive.js +4 -2
- package/esm2015/lib/quick-list/base-quick-list.component.js +89 -0
- package/esm2015/lib/quick-list/quick-list-compact/quick-list-compact.component.js +18 -0
- package/esm2015/lib/quick-list/quick-list.component.js +6 -77
- package/esm2015/lib/quick-list/quick-list.module.js +6 -4
- package/esm2015/lib/stepper/mad-stepper-animation.js +13 -0
- package/esm2015/lib/stepper/step-header/step-header.component.js +75 -0
- package/esm2015/lib/stepper/stepper.component.js +167 -0
- package/esm2015/lib/stepper/stepper.module.js +18 -0
- package/esm2015/porscheinformatik-material-addons.js +4 -2
- package/esm2015/public-api.js +5 -1
- package/fesm2015/porscheinformatik-material-addons.js +311 -20
- package/fesm2015/porscheinformatik-material-addons.js.map +1 -1
- package/lib/quick-list/base-quick-list.component.d.ts +29 -0
- package/lib/quick-list/quick-list-compact/quick-list-compact.component.d.ts +6 -0
- package/lib/quick-list/quick-list.component.d.ts +4 -27
- package/lib/stepper/mad-stepper-animation.d.ts +7 -0
- package/lib/stepper/step-header/step-header.component.d.ts +23 -0
- package/lib/stepper/stepper.component.d.ts +47 -0
- package/lib/stepper/stepper.module.d.ts +2 -0
- package/package.json +1 -1
- package/porscheinformatik-material-addons.d.ts +3 -1
- package/porscheinformatik-material-addons.metadata.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, Input, NgModule, HostBinding, ViewChild, ElementRef, ChangeDetectorRef, ɵɵdefineInjectable, ɵɵinject, LOCALE_ID, Injectable, Inject, Renderer2, EventEmitter, Directive, forwardRef, Output, HostListener, ContentChild, TemplateRef, ViewChildren } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
1
|
+
import { Component, Input, NgModule, HostBinding, ViewChild, ElementRef, ChangeDetectorRef, ɵɵdefineInjectable, ɵɵinject, LOCALE_ID, Injectable, Inject, Renderer2, EventEmitter, Directive, forwardRef, Output, HostListener, ContentChild, TemplateRef, ViewChildren, ViewEncapsulation, ChangeDetectionStrategy, ViewContainerRef, QueryList, Optional, ContentChildren } from '@angular/core';
|
|
2
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
3
3
|
import { RouterModule, NavigationEnd, Router } from '@angular/router';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
5
5
|
import { MatIconModule } from '@angular/material/icon';
|
|
@@ -9,9 +9,9 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
9
9
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
10
10
|
import { Title } from '@angular/platform-browser';
|
|
11
11
|
import { TranslateService } from '@ngx-translate/core';
|
|
12
|
-
import { of, Subject } from 'rxjs';
|
|
12
|
+
import { of, Subject, Subscription } from 'rxjs';
|
|
13
13
|
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
|
|
14
|
-
import { map, throttleTime } from 'rxjs/operators';
|
|
14
|
+
import { map, throttleTime, switchMap, tap, startWith, takeUntil, distinctUntilChanged } from 'rxjs/operators';
|
|
15
15
|
import { MatMenuModule } from '@angular/material/menu';
|
|
16
16
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
17
17
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
@@ -20,6 +20,10 @@ import { trigger, transition, style, animate, state } from '@angular/animations'
|
|
|
20
20
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
21
21
|
import { MatSort, MatSortModule } from '@angular/material/sort';
|
|
22
22
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
23
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
24
|
+
import { CdkStepHeader, STEP_STATE, CdkStep, CdkStepper, CdkStepperModule } from '@angular/cdk/stepper';
|
|
25
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
26
|
+
import { FlexModule } from '@angular/flex-layout';
|
|
23
27
|
|
|
24
28
|
class MaterialActionButtonComponent {
|
|
25
29
|
constructor() {
|
|
@@ -857,7 +861,9 @@ class NumericFieldDirective {
|
|
|
857
861
|
set numericValue(value) {
|
|
858
862
|
if (this._numericValue !== value && !(isNaN(this._numericValue) && (isNaN(value) || value === null))) {
|
|
859
863
|
this.originalValue = value;
|
|
860
|
-
|
|
864
|
+
// Don't roundOrTruncate if value was set to empty otherwise input value will be set to 0 instead of empty
|
|
865
|
+
// which happens when an input is being reset
|
|
866
|
+
this._numericValue = value === null || value === undefined ? value : this.roundOrTruncate(value); // eslint-disable-line
|
|
861
867
|
this.handleInputChanged();
|
|
862
868
|
}
|
|
863
869
|
}
|
|
@@ -1238,8 +1244,7 @@ CardModule.decorators = [
|
|
|
1238
1244
|
},] }
|
|
1239
1245
|
];
|
|
1240
1246
|
|
|
1241
|
-
|
|
1242
|
-
class QuickListComponent {
|
|
1247
|
+
class BaseQuickListComponent {
|
|
1243
1248
|
constructor(changeDetectorRef) {
|
|
1244
1249
|
this.changeDetectorRef = changeDetectorRef;
|
|
1245
1250
|
this.allItems = [];
|
|
@@ -1251,7 +1256,7 @@ class QuickListComponent {
|
|
|
1251
1256
|
}
|
|
1252
1257
|
ngOnInit() {
|
|
1253
1258
|
this.addEventFunction = this.addItem.bind(this);
|
|
1254
|
-
if (
|
|
1259
|
+
if (this.minItems) {
|
|
1255
1260
|
for (let n = this.allItems.length; n < this.minItems; n++) {
|
|
1256
1261
|
this.interalAddItem();
|
|
1257
1262
|
}
|
|
@@ -1285,10 +1290,10 @@ class QuickListComponent {
|
|
|
1285
1290
|
});
|
|
1286
1291
|
}
|
|
1287
1292
|
isAddAllowed() {
|
|
1288
|
-
return
|
|
1293
|
+
return this.addPossible && (!this.maxItems || this.allItems.length < this.maxItems);
|
|
1289
1294
|
}
|
|
1290
1295
|
isDeleteAllowed() {
|
|
1291
|
-
return
|
|
1296
|
+
return !this.minItems || this.allItems.length > this.minItems;
|
|
1292
1297
|
}
|
|
1293
1298
|
interalAddItem() {
|
|
1294
1299
|
if (this.isAddAllowed()) {
|
|
@@ -1304,16 +1309,16 @@ class QuickListComponent {
|
|
|
1304
1309
|
return null;
|
|
1305
1310
|
}
|
|
1306
1311
|
}
|
|
1307
|
-
|
|
1312
|
+
BaseQuickListComponent.decorators = [
|
|
1308
1313
|
{ type: Component, args: [{
|
|
1309
|
-
selector: 'mad-quick-list',
|
|
1310
|
-
template:
|
|
1314
|
+
selector: 'mad-base-quick-list',
|
|
1315
|
+
template: ''
|
|
1311
1316
|
},] }
|
|
1312
1317
|
];
|
|
1313
|
-
|
|
1318
|
+
BaseQuickListComponent.ctorParameters = () => [
|
|
1314
1319
|
{ type: ChangeDetectorRef }
|
|
1315
1320
|
];
|
|
1316
|
-
|
|
1321
|
+
BaseQuickListComponent.propDecorators = {
|
|
1317
1322
|
allItems: [{ type: Input }],
|
|
1318
1323
|
addLabel: [{ type: Input }],
|
|
1319
1324
|
addPossible: [{ type: Input }],
|
|
@@ -1327,13 +1332,46 @@ QuickListComponent.propDecorators = {
|
|
|
1327
1332
|
itemRows: [{ type: ViewChildren, args: ['row',] }]
|
|
1328
1333
|
};
|
|
1329
1334
|
|
|
1335
|
+
// Based on https://github.com/porscheinformatik/clarity-addons/blob/master/src/clr-addons/generic-quick-list/generic-quick-list.ts
|
|
1336
|
+
class QuickListComponent extends BaseQuickListComponent {
|
|
1337
|
+
constructor(changeDetectorRef) {
|
|
1338
|
+
super(changeDetectorRef);
|
|
1339
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
QuickListComponent.decorators = [
|
|
1343
|
+
{ type: Component, args: [{
|
|
1344
|
+
selector: 'mad-quick-list',
|
|
1345
|
+
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"
|
|
1346
|
+
},] }
|
|
1347
|
+
];
|
|
1348
|
+
QuickListComponent.ctorParameters = () => [
|
|
1349
|
+
{ type: ChangeDetectorRef }
|
|
1350
|
+
];
|
|
1351
|
+
|
|
1352
|
+
class QuickListCompactComponent extends BaseQuickListComponent {
|
|
1353
|
+
constructor(changeDetectorRef) {
|
|
1354
|
+
super(changeDetectorRef);
|
|
1355
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
QuickListCompactComponent.decorators = [
|
|
1359
|
+
{ type: Component, args: [{
|
|
1360
|
+
selector: 'mad-quick-list-compact',
|
|
1361
|
+
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"
|
|
1362
|
+
},] }
|
|
1363
|
+
];
|
|
1364
|
+
QuickListCompactComponent.ctorParameters = () => [
|
|
1365
|
+
{ type: ChangeDetectorRef }
|
|
1366
|
+
];
|
|
1367
|
+
|
|
1330
1368
|
class QuickListModule {
|
|
1331
1369
|
}
|
|
1332
1370
|
QuickListModule.decorators = [
|
|
1333
1371
|
{ type: NgModule, args: [{
|
|
1334
|
-
declarations: [QuickListComponent],
|
|
1372
|
+
declarations: [QuickListComponent, BaseQuickListComponent, QuickListCompactComponent],
|
|
1335
1373
|
imports: [CommonModule, MatButtonModule, MatIconModule, ButtonModule],
|
|
1336
|
-
exports: [QuickListComponent],
|
|
1374
|
+
exports: [QuickListComponent, QuickListCompactComponent, BaseQuickListComponent],
|
|
1337
1375
|
},] }
|
|
1338
1376
|
];
|
|
1339
1377
|
|
|
@@ -1460,6 +1498,259 @@ TableModule.decorators = [
|
|
|
1460
1498
|
},] }
|
|
1461
1499
|
];
|
|
1462
1500
|
|
|
1501
|
+
class StepHeaderComponent extends CdkStepHeader {
|
|
1502
|
+
constructor(_focusMonitor, _elementRef) {
|
|
1503
|
+
super(_elementRef);
|
|
1504
|
+
this._focusMonitor = _focusMonitor;
|
|
1505
|
+
}
|
|
1506
|
+
ngAfterViewInit() {
|
|
1507
|
+
this._focusMonitor.monitor(this._elementRef, true);
|
|
1508
|
+
}
|
|
1509
|
+
ngOnDestroy() {
|
|
1510
|
+
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
1511
|
+
}
|
|
1512
|
+
/** Focuses the step header. */
|
|
1513
|
+
focus(origin, options) {
|
|
1514
|
+
if (origin) {
|
|
1515
|
+
this._focusMonitor.focusVia(this._elementRef, origin, options);
|
|
1516
|
+
}
|
|
1517
|
+
else {
|
|
1518
|
+
this._elementRef.nativeElement.focus(options);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
getCssForState() {
|
|
1522
|
+
if (this.state === STEP_STATE.NUMBER && !this.completed && !this.hasError) {
|
|
1523
|
+
return 'step-state-neutral'; //initiale state is 'number'
|
|
1524
|
+
}
|
|
1525
|
+
else if (this.completed) {
|
|
1526
|
+
return 'step-state-complete';
|
|
1527
|
+
}
|
|
1528
|
+
else if (this.hasError) {
|
|
1529
|
+
return 'step-state-error';
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
getIcon() {
|
|
1533
|
+
if (this.completed) {
|
|
1534
|
+
return 'check_circle_outline';
|
|
1535
|
+
}
|
|
1536
|
+
else if (this.hasError) {
|
|
1537
|
+
return 'error_outline';
|
|
1538
|
+
}
|
|
1539
|
+
return '';
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
StepHeaderComponent.decorators = [
|
|
1543
|
+
{ type: Component, args: [{
|
|
1544
|
+
selector: 'mad-step-header',
|
|
1545
|
+
template: "<div class=\"header\" fxLayout=\"row\" fxLayoutGap=\"1em\"\n [style.background]=\"this.selected && !this.closed ? '#d8e2e9' : '#ffffff'\"\n [style.border-color]=\"this.hasError ? '#f44336' : '#d3d3d3'\">\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",
|
|
1546
|
+
inputs: ['color'],
|
|
1547
|
+
host: {
|
|
1548
|
+
'class': 'mad-step-header',
|
|
1549
|
+
'role': 'tab',
|
|
1550
|
+
},
|
|
1551
|
+
encapsulation: ViewEncapsulation.None,
|
|
1552
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1553
|
+
styles: [".header{-webkit-tap-highlight-color:transparent;border:1px solid #d3d3d3;box-sizing:content-box;cursor:pointer;height:62px;outline:#f44336;overflow:hidden;width:100%}.header-label{align-items:center;display:flex}.step-state-complete{background:green;width:5px}.step-state-error{background:#f44336;width:5px}.step-state-neutral{background:#d3d3d3;width:5px}.green-check{color:green}.red-error{color:#f44336}"]
|
|
1554
|
+
},] }
|
|
1555
|
+
];
|
|
1556
|
+
StepHeaderComponent.ctorParameters = () => [
|
|
1557
|
+
{ type: FocusMonitor },
|
|
1558
|
+
{ type: ElementRef }
|
|
1559
|
+
];
|
|
1560
|
+
StepHeaderComponent.propDecorators = {
|
|
1561
|
+
index: [{ type: Input }],
|
|
1562
|
+
label: [{ type: Input }],
|
|
1563
|
+
state: [{ type: Input }],
|
|
1564
|
+
errorMessage: [{ type: Input }],
|
|
1565
|
+
selected: [{ type: Input }],
|
|
1566
|
+
active: [{ type: Input }],
|
|
1567
|
+
optional: [{ type: Input }],
|
|
1568
|
+
hasError: [{ type: Input }],
|
|
1569
|
+
completed: [{ type: Input }],
|
|
1570
|
+
closed: [{ type: Input }]
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Animations used by the MAD stepper.
|
|
1575
|
+
*/
|
|
1576
|
+
const madStepperAnimations = {
|
|
1577
|
+
verticalStepTransition: trigger('stepTransition', [
|
|
1578
|
+
state('previous', style({ height: '0px', visibility: 'hidden' })),
|
|
1579
|
+
state('next', style({ height: '0px', visibility: 'hidden' })),
|
|
1580
|
+
state('current', style({ height: '*', visibility: 'visible' })),
|
|
1581
|
+
transition('* <=> current', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
|
|
1582
|
+
]),
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1585
|
+
class StepComponent extends CdkStep {
|
|
1586
|
+
constructor(stepper, _viewContainerRef) {
|
|
1587
|
+
super(stepper);
|
|
1588
|
+
this.stepper = stepper;
|
|
1589
|
+
this._viewContainerRef = _viewContainerRef;
|
|
1590
|
+
/** Action event for the next button. If not set the StepComponent will handle the step navigation */
|
|
1591
|
+
this.onNext = new EventEmitter();
|
|
1592
|
+
/** Action event for the done button. If not set the StepComponent will handle the step navigation */
|
|
1593
|
+
this.onDone = new EventEmitter();
|
|
1594
|
+
/*** Action event when the header is clicked. If not set the StepComponent will handle the step navigation*/
|
|
1595
|
+
this.onHeaderClick = new EventEmitter();
|
|
1596
|
+
this.stepClosed = false;
|
|
1597
|
+
this._isSelected = Subscription.EMPTY;
|
|
1598
|
+
}
|
|
1599
|
+
ngAfterContentInit() {
|
|
1600
|
+
this._isSelected = this._stepper.steps.changes
|
|
1601
|
+
.pipe(switchMap(() => this._stepper.selectionChange.pipe(map(event => event.selectedStep === this), tap(() => (this.stepClosed = false)), startWith(this._stepper.selected === this))))
|
|
1602
|
+
.subscribe();
|
|
1603
|
+
}
|
|
1604
|
+
ngOnDestroy() {
|
|
1605
|
+
this._isSelected.unsubscribe();
|
|
1606
|
+
}
|
|
1607
|
+
next() {
|
|
1608
|
+
this.stepValidation();
|
|
1609
|
+
if (this.onNext.observers.length <= 0) {
|
|
1610
|
+
this.stepper.next();
|
|
1611
|
+
}
|
|
1612
|
+
this.onNext.emit();
|
|
1613
|
+
}
|
|
1614
|
+
selectAndMarkAsTouched(index) {
|
|
1615
|
+
var _a, _b;
|
|
1616
|
+
//Mark current selected step as touched before selecting to display errors in the from
|
|
1617
|
+
(_b = (_a = this._stepper.selected) === null || _a === void 0 ? void 0 : _a.stepControl) === null || _b === void 0 ? void 0 : _b.markAllAsTouched();
|
|
1618
|
+
this.stepClosed = false;
|
|
1619
|
+
if (this.onHeaderClick.observers.length <= 0) {
|
|
1620
|
+
this.select();
|
|
1621
|
+
}
|
|
1622
|
+
this.onHeaderClick.emit(index);
|
|
1623
|
+
}
|
|
1624
|
+
completeLast() {
|
|
1625
|
+
this.stepValidation();
|
|
1626
|
+
this.stepClosed = true;
|
|
1627
|
+
if (this.onDone.observers.length <= 0) {
|
|
1628
|
+
this.stepper.next();
|
|
1629
|
+
}
|
|
1630
|
+
this.onDone.emit();
|
|
1631
|
+
}
|
|
1632
|
+
resetValidations() {
|
|
1633
|
+
this.hasError = false;
|
|
1634
|
+
this.completed = true;
|
|
1635
|
+
this.state = STEP_STATE.DONE;
|
|
1636
|
+
}
|
|
1637
|
+
stepValidation() {
|
|
1638
|
+
var _a, _b;
|
|
1639
|
+
(_a = this.stepControl) === null || _a === void 0 ? void 0 : _a.markAllAsTouched();
|
|
1640
|
+
if ((_b = this.stepControl) === null || _b === void 0 ? void 0 : _b.valid) {
|
|
1641
|
+
this.hasError = false;
|
|
1642
|
+
this.completed = true;
|
|
1643
|
+
this.state = STEP_STATE.DONE;
|
|
1644
|
+
}
|
|
1645
|
+
else {
|
|
1646
|
+
this.completed = false;
|
|
1647
|
+
this.hasError = true;
|
|
1648
|
+
this.state = STEP_STATE.ERROR;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
StepComponent.decorators = [
|
|
1653
|
+
{ type: Component, args: [{
|
|
1654
|
+
selector: 'mad-step',
|
|
1655
|
+
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",
|
|
1656
|
+
providers: [{ provide: CdkStep, useExisting: StepComponent }],
|
|
1657
|
+
encapsulation: ViewEncapsulation.None,
|
|
1658
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1659
|
+
styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{align-items:center;border:none!important;display:flex;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{outline:0;overflow:hidden}.vertical-content{padding:0 24px}.step-container{border-bottom:1px solid #d3d3d3;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3}.step-buttons,.step-content{padding:2em}"]
|
|
1660
|
+
},] }
|
|
1661
|
+
];
|
|
1662
|
+
StepComponent.ctorParameters = () => [
|
|
1663
|
+
{ type: StepperComponent, decorators: [{ type: Inject, args: [forwardRef(() => StepperComponent),] }] },
|
|
1664
|
+
{ type: ViewContainerRef }
|
|
1665
|
+
];
|
|
1666
|
+
StepComponent.propDecorators = {
|
|
1667
|
+
onNext: [{ type: Output }],
|
|
1668
|
+
onDone: [{ type: Output }],
|
|
1669
|
+
onHeaderClick: [{ type: Output }]
|
|
1670
|
+
};
|
|
1671
|
+
class StepperComponent extends CdkStepper {
|
|
1672
|
+
constructor(dir, changeDetectorRef, elementRef, _document) {
|
|
1673
|
+
super(dir, changeDetectorRef, elementRef, _document);
|
|
1674
|
+
/** Event emitted when the current step is done transitioning in. */
|
|
1675
|
+
this.animationDone = new EventEmitter();
|
|
1676
|
+
/** Steps that belong to the current stepper, excluding ones from nested steppers. */
|
|
1677
|
+
this.steps = new QueryList();
|
|
1678
|
+
this._animationDone = new Subject();
|
|
1679
|
+
this._orientation = 'vertical';
|
|
1680
|
+
}
|
|
1681
|
+
ngOnInit() {
|
|
1682
|
+
// Only linear stepper implementation is supported
|
|
1683
|
+
super.linear = true;
|
|
1684
|
+
}
|
|
1685
|
+
ngAfterContentInit() {
|
|
1686
|
+
super.ngAfterContentInit();
|
|
1687
|
+
this.steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
1688
|
+
this._stateChanged();
|
|
1689
|
+
});
|
|
1690
|
+
this._animationDone
|
|
1691
|
+
.pipe(distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState), takeUntil(this._destroyed))
|
|
1692
|
+
.subscribe(event => {
|
|
1693
|
+
if (event.toState === 'current') {
|
|
1694
|
+
this.animationDone.emit();
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Method patched to enable the closing of the last step.
|
|
1700
|
+
*/
|
|
1701
|
+
_getAnimationDirection(index) {
|
|
1702
|
+
var _a, _b;
|
|
1703
|
+
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);
|
|
1704
|
+
if (closeLastStep) {
|
|
1705
|
+
return 'next';
|
|
1706
|
+
}
|
|
1707
|
+
return super._getAnimationDirection(index);
|
|
1708
|
+
}
|
|
1709
|
+
_stepIsNavigable(index, step) {
|
|
1710
|
+
return step.completed || this.selectedIndex === index || !this.linear;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
StepperComponent.decorators = [
|
|
1714
|
+
{ type: Component, args: [{
|
|
1715
|
+
selector: 'mad-stepper',
|
|
1716
|
+
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",
|
|
1717
|
+
host: {
|
|
1718
|
+
'[class.stepper-vertical]': 'true',
|
|
1719
|
+
'[attr.aria-orientation]': '"vertical"',
|
|
1720
|
+
'role': 'tablist',
|
|
1721
|
+
},
|
|
1722
|
+
animations: [madStepperAnimations.verticalStepTransition],
|
|
1723
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
1724
|
+
providers: [{ provide: CdkStepper, useExisting: StepperComponent }],
|
|
1725
|
+
encapsulation: ViewEncapsulation.None,
|
|
1726
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1727
|
+
styles: [".stepper-vertical{display:block}.mat-vertical-stepper-header{align-items:center;border:none!important;display:flex;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{outline:0;overflow:hidden}.vertical-content{padding:0 24px}.step-container{border-bottom:1px solid #d3d3d3;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3}.step-buttons,.step-content{padding:2em}"]
|
|
1728
|
+
},] }
|
|
1729
|
+
];
|
|
1730
|
+
StepperComponent.ctorParameters = () => [
|
|
1731
|
+
{ type: Directionality, decorators: [{ type: Optional }] },
|
|
1732
|
+
{ type: ChangeDetectorRef },
|
|
1733
|
+
{ type: ElementRef },
|
|
1734
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
1735
|
+
];
|
|
1736
|
+
StepperComponent.propDecorators = {
|
|
1737
|
+
animationDone: [{ type: Output }],
|
|
1738
|
+
nextButtonLabel: [{ type: Input }],
|
|
1739
|
+
doneButtonLabel: [{ type: Input }],
|
|
1740
|
+
_stepHeader: [{ type: ViewChildren, args: [StepHeaderComponent,] }],
|
|
1741
|
+
_steps: [{ type: ContentChildren, args: [StepComponent, { descendants: true },] }]
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
class StepperModule {
|
|
1745
|
+
}
|
|
1746
|
+
StepperModule.decorators = [
|
|
1747
|
+
{ type: NgModule, args: [{
|
|
1748
|
+
declarations: [StepperComponent, StepHeaderComponent, StepComponent],
|
|
1749
|
+
imports: [CommonModule, MatButtonModule, MatIconModule, CdkStepperModule, FlexModule],
|
|
1750
|
+
exports: [StepperComponent, StepHeaderComponent, StepComponent],
|
|
1751
|
+
},] }
|
|
1752
|
+
];
|
|
1753
|
+
|
|
1463
1754
|
class MaterialAddonsModule {
|
|
1464
1755
|
}
|
|
1465
1756
|
MaterialAddonsModule.decorators = [
|
|
@@ -1472,8 +1763,8 @@ MaterialAddonsModule.decorators = [
|
|
|
1472
1763
|
NumericFieldModule,
|
|
1473
1764
|
CardModule,
|
|
1474
1765
|
QuickListModule,
|
|
1475
|
-
ThrottleClickModule
|
|
1476
|
-
]
|
|
1766
|
+
ThrottleClickModule,
|
|
1767
|
+
],
|
|
1477
1768
|
},] }
|
|
1478
1769
|
];
|
|
1479
1770
|
|
|
@@ -1485,5 +1776,5 @@ MaterialAddonsModule.decorators = [
|
|
|
1485
1776
|
* Generated bundle index. Do not edit.
|
|
1486
1777
|
*/
|
|
1487
1778
|
|
|
1488
|
-
export { ButtonModule, CardModule, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldModule, QuickListModule, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, TableModule, ThrottleClickDirective, ThrottleClickModule, ToolbarComponent, ToolbarModule, ToolbarService, PrimaryButtonComponent as ɵa, MadBasicButton as ɵb, OutlineButtonComponent as ɵc, LinkButtonComponent as ɵd, DangerButtonComponent as ɵe, IconButtonComponent as ɵf, NumericFieldDirective as ɵg, CardComponent as ɵh, QuickListComponent as ɵi,
|
|
1779
|
+
export { ButtonModule, CardModule, MaterialActionButtonComponent, MaterialActionButtonModule, MaterialAddonsModule, NumberFormatService, NumericFieldModule, QuickListModule, ReadOnlyFormFieldComponent, ReadOnlyFormFieldModule, ReadOnlyFormFieldWrapperComponent, StepComponent, StepHeaderComponent, StepperComponent, StepperModule, TableModule, ThrottleClickDirective, ThrottleClickModule, ToolbarComponent, ToolbarModule, ToolbarService, madStepperAnimations, PrimaryButtonComponent as ɵa, MadBasicButton as ɵb, OutlineButtonComponent as ɵc, LinkButtonComponent as ɵd, DangerButtonComponent as ɵe, IconButtonComponent as ɵf, NumericFieldDirective as ɵg, CardComponent as ɵh, QuickListComponent as ɵi, BaseQuickListComponent as ɵj, QuickListCompactComponent as ɵk, TableComponent as ɵl };
|
|
1489
1780
|
//# sourceMappingURL=porscheinformatik-material-addons.js.map
|